]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/automated-engraving/problem-statement.itexi
Doc: Add converted essay.
[lilypond.git] / Documentation / automated-engraving / problem-statement.itexi
1 \input texinfo @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.  See TRANSLATION for details.
7 @end ignore
8
9
10
11
12 @node problem-statement 
13 @unnumberedsec Designing notation software: how not to do it
14
15 It would be nice if notation software didn't need any babysitting to
16 produce acceptable output. 
17
18 Our goal with @emph{LilyPond} was to write such a system: a program
19 that will produce beautiful music ("engraving") automatically.
20
21 At first sight, music notation follows a straightforward hierarchical
22 pattern.  Consider the example below, with two staves containing two
23 measures.
24
25 @image{pictures/naive-notation,,,.png}
26
27 Isn't writing software all about finding hierarchies and modeling the
28 real world in terms of trees? In the view of a naive programmer, the
29 above fragment of notation is easily abstracted to a nested set of
30 boxes
31
32 @image{pictures/naive-notation-uml,,,.png}
33
34 It's easy to follow this model when writing software.  It's obvious
35 how to store this data in memory, and writing on disk can be easily
36 mirrored. In an XML-file you could write something like
37
38 @verbatim
39
40   <score>
41     <staff>
42       <measure id="1">
43          <chord length="1/2">
44            <pitch name="c">
45          </chord>
46          <chord>
47          
48          ....
49       </measure>
50     </staff>
51   </score>
52
53 @end verbatim
54
55 In short, this model is obvious, simple and neat.  It's the format
56 used by a lot software. Unfortunately, it's also wrong.  The
57 hierarchical representation works for a lot of simpler music, but it
58 falls apart for advanced use. Consider the following example:
59
60 @image{pictures/nonnaive-notation,,,.png}
61
62 In this example, several assumptions of the previous model are
63 violated: staves start and stop at will, voices jump around between
64 staves, and sometimes span two staves.
65
66 Music notation is really different from music itself. Notation is an
67 intricate symbolic diagramming language for visualizing an often much
68 simpler musical concept. Hence, software should reflect that separation.
69
70 @divClass{float-right}
71 @divEnd
72 Next: @ref{divide-and-conquer.html,Divide and conqueror},
73 a blue print for automated notation
74
75 @bye
76