]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/automated-engraving/scoring-esthetics.itexi
DOC: [nl] node name fixups.
[lilypond.git] / Documentation / automated-engraving / scoring-esthetics.itexi
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @ignore
3     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
4
5     When revising a translation, copy the HEAD committish of the
6     version that you are working on.  For details, see the Contributors'
7     Guide, node Updating translation committishes..
8 @end ignore
9
10
11 @node scoring-esthetics
12 @unnumberedsec Beautiful numbers 
13         
14 How do we actually make formatting decisions?  In other words, which
15 of the three configurations should we choose for the following slur?
16
17 @sourceimage{slur-esthetics,,,.png}
18
19 There are a few books on the art of music engraving
20 available. Unfortunately, they contain rules of simple thumbs and some
21 examples.  Such rules can be instructive, but they are a far cry from
22 an algorithm that we could readily implement in a computer.  Following
23 the instructions from literature leads to algorithms with lots of
24 handcoded exceptions. Doing all this case analysis is a lot of work,
25 and often not all cases are covered completely.
26
27 @divClass{float-center}
28 @sourceimage{ross-beam-scan,,,.png}
29 @divEnd
30
31 @divClass{float-center}
32 @emph{Formatting rules defined by example. Image from Ted Ross' The Art of
33 Music Engraving}
34 @divEnd
35
36 We have developed a much easier and robust method of determining the
37 best formatting solution: score based formatting. The principle is the
38 same as a beauty contest: for each possible configuration, we compute an
39 ugliness score. Then we choose the least ugly configuration.
40
41 @sourceimage{slur-esthetics-annotate-1,,,.png}
42
43 For example, in the above configuration, the slur nicely connects the
44 starting and ending note of the figure, a desirable trait. However, it
45 also grazes one note head closely, while staying away from the others.
46 Therefore, for this configuration, we deduct a `variance' score of
47 15.39.
48
49 @sourceimage{slur-esthetics-annotate-2,,,.png}
50
51 In this configuration, the slur keeps a uniform distance from the
52 heads, but we have to deduct some points because the slur doesn't
53 start and end on the note heads.  For the left edge, we deduct 1.71,
54 and for the right edge (which is further from the head) we deduct 9.37
55 points.
56
57 Furthermore, the slur goes up, while the melody goes down. This incurs
58 a penalty of 2.00 points
59
60 @sourceimage{slur-esthetics-annotate-3,,,.png}
61
62 Finally, in this configuration, only the ending the slur is far away
63 from the ending note head, at a score of 10.04 ugliness points.
64
65 Adding up all scores, we notice that the third option is the least
66 ugly, or most beautiful version.   Hence we select that one.
67
68 This technique is a general technique, and it is used in a lot of
69 situations, for example
70
71 @itemize
72 @item
73  determining beam slopes
74
75 @sourceimage{beam-scoring-example,,,.png}
76
77 @item
78  formatting tied chords
79
80 @sourceimage{ties-scoring-example,,,.png}
81 @item
82  formatting dotted chords
83
84
85 @item
86  line breaking
87
88 @item
89  page breaking  
90
91 @end itemize
92
93 This technique evaluates a lot of possibilities, which takes some time
94 to compute. However, that is a worthwhile expense, because the end
95 result is much better, and because it makes our lives easy.
96
97 @divClass{float-right}
98 Next: @ref{benchmarking,Man is the measure of things}: is a
99 flexible architecture enough?
100 @divEnd