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