]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/automated-engraving/implementing-notation.itexi
ee9711c963a2c3c116934dd5f8dd5fc71cfa4fcf
[lilypond.git] / Documentation / automated-engraving / implementing-notation.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 @node implementing-notation 
12
13 @unnumberedsec Music notation
14
15 Common music notation encompasses some 500 years of music. Its
16 applications range from monophonic melodies to monstruous counterpoint
17 for large orchestras.  How can we get a grip on such a many-headed
18 beast?  Our solution is to make a strict distinction between notation,
19 @emph{what} symbols to use, and engraving, @emph{where} to put
20 them.  For tackling notation, we have broken up the problem into
21 digestible (and programmable) chunks: every type of symbol is handled
22 by a separate plugin.  All plugins cooperate through the LilyPond
23 architecture.  They are completely modular and independent, so each
24 can be developed and improved separately.
25
26 @itemize
27 @item
28 The most basic plug-in creates Note-heads:
29
30 @divClass{float-center}
31 @divEnd
32 @image{pictures/engraver-noteheads,,,.png}
33
34 This plug-in creates graphical objects from musical events.  People
35 that put graphics to musical ideas are called copyists or engravers,
36 so by analogy, this plug-in is called @code{Note_head_engraver}.
37
38
39 @item
40  The @code{Staff_symbol_engraver} generates the object
41 representing the staff lines.
42
43 @divClass{float-center}
44 @divEnd
45 @image{pictures/engraver-staff,,,.png}
46
47 @item
48
49  The @code{Clef_engraver} tells @code{Note_head_engraver} how high
50 each head should be placed.
51
52 @divClass{float-center}
53 @divEnd
54 @image{pictures/engraver-clef,,,.png}
55
56
57
58 @item
59
60 For the flags and stems we add  a @code{Stem_engraver}:
61
62 @divClass{float-center}
63 @divEnd
64 @image{pictures/engraver-stem,,,.png}
65
66 This engraver is notified of any note head coming along.  Every time
67 one (or more, for a chord) note head is seen, a stem object is
68 created, and attached to the note head.
69
70 @item
71
72 Beams, slurs, accents are handled by separate engravers. Like the
73 @code{Stem_engraver}, they create objects and connect them to stems,
74 note heads, etc.:
75
76 @divClass{float-center}
77 @divEnd
78 @image{pictures/engraver-slur,,,.png}
79
80
81
82 @item
83
84 Accidentals, bar lines, time signature, and key signature each have a
85 separate
86 engraver.
87
88 @divClass{float-center}
89 @divEnd
90 @image{pictures/engraver-acc,,,.png}
91
92 The @code{Accidental_engraver} is the most complex plug-in: it has
93 to look at the key signature, note pitches, ties, and bar lines to
94 decide when to print accidentals.
95
96
97 @end itemize
98
99
100 @unnumberedsec  Polyphonic notation
101
102 The system shown in the last section works well for monophonic music,
103 but what about polyphony?  In polyphonic notation, many voices can
104 share a staff:
105
106 @divClass{float-center}
107 @divEnd
108 @image{pictures/engraver-final,,,.png}
109
110 In this situation, the accidentals and staff are shared, but the
111 stems, slurs, beams, etc. are private to each voice. Hence, engravers
112 should be grouped.  The engravers for note head, stems, slurs, etc. go
113 into a group called "Voice context," while the engravers for key,
114 accidental, bar, etc. go into a group called "Staff context."  In the
115 case of polyphony, a single Staff context contains more than one Voice
116 context.  Similarly, more Staff contexts can be put into a single
117 Score context:
118
119 @divClass{float-center}
120 @divEnd
121 @image{pictures/engraver-score,,,.png}
122
123 @divClass{float-right}
124 @divEnd
125 Next: @ref{engraving.html,The art of stamping}:
126 how @emph{did} they make hand-made music? 
127
128 @bye
129