]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/automated-engraving/implementing-notation.itexi
Typeset all systems when inlining a score using \markup \score.
[lilypond.git] / Documentation / automated-engraving / implementing-notation.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.  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 @sourceimage{engraver-noteheads,,,.png}
32 @divEnd
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 @sourceimage{engraver-staff,,,.png}
45 @divEnd
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 @sourceimage{engraver-clef,,,.png}
54 @divEnd
55
56
57
58 @item
59
60 For the flags and stems we add  a @code{Stem_engraver}:
61
62 @divClass{float-center}
63 @sourceimage{engraver-stem,,,.png}
64 @divEnd
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 @sourceimage{engraver-slur,,,.png}
78 @divEnd
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 @sourceimage{engraver-acc,,,.png}
90 @divEnd
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 @c @unnumberedsec  Polyphonic notation
101 @heading  Polyphonic notation
102
103 The system shown in the last section works well for monophonic music,
104 but what about polyphony?  In polyphonic notation, many voices can
105 share a staff:
106
107 @divClass{float-center}
108 @sourceimage{engraver-final,,,.png}
109 @divEnd
110
111 In this situation, the accidentals and staff are shared, but the
112 stems, slurs, beams, etc. are private to each voice. Hence, engravers
113 should be grouped.  The engravers for note head, stems, slurs, etc. go
114 into a group called "Voice context," while the engravers for key,
115 accidental, bar, etc. go into a group called "Staff context."  In the
116 case of polyphony, a single Staff context contains more than one Voice
117 context.  Similarly, more Staff contexts can be put into a single
118 Score context:
119
120 @divClass{float-center}
121 @sourceimage{engraver-score,,,.png}
122 @divEnd
123
124 @divClass{float-right}
125 Next: @ref{engraving,The art of stamping}:
126 how @emph{did} they make hand-made music?
127 @divEnd