]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/engravers-one-by-one.ly
Fix 2241: Proper copyright/header/tagline handling with multiple bookparts
[lilypond.git] / Documentation / snippets / engravers-one-by-one.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.14.2"
8
9 \header {
10   lsrtags = "contexts-and-engravers, specific-notation"
11
12   texidoc = "
13 The notation problem, creating a certain symbol, is handled by plugins.
14  Each plugin is called an Engraver. In this example, engravers are
15 switched on one by one, in the following order:
16
17 - note heads,
18
19
20 - staff symbol,
21
22
23 - clef,
24
25
26 - stem,
27
28
29 - beams, slurs, accents,
30
31
32 - accidentals, bar lines, time signature and key signature.
33
34
35
36 Engravers are grouped. For example, note heads, slurs, beams etc. form
37 a @code{Voice} context. Engravers for key signature, accidentals, bar
38 line, etc. form a @code{Staff} context.
39
40 "
41   doctitle = "Engravers one-by-one"
42 } % begin verbatim
43
44
45 %% sample music
46 topVoice = \relative c' {
47   \key d \major
48   es8([ g] a[ fis])
49   b4
50   b16[-. b-. b-. cis-.]
51   d4->
52 }
53
54 botVoice = \relative c' {
55   \key d \major
56   c8[( f] b[ a)]
57   es4
58   es16[-. es-. es-. fis-.]
59   b4->
60 }
61
62 hoom = \relative c {
63   \key d \major
64   \clef bass
65   g8-. r
66   r4
67   fis8-.
68   r8
69   r4
70   b'4->
71 }
72
73 pah = \relative c' {
74   r8 b-.
75   r4
76   r8 g8-.
77   r16 g-. r8
78   \clef treble
79   fis'4->
80 }
81
82 %
83 % setup for Request->Element conversion. Guru-only
84 %
85
86 MyStaff = \context {
87   \type "Engraver_group"
88   \name Staff
89
90   \description "Handles clefs, bar lines, keys, accidentals.  It can contain
91 @code{Voice} contexts."
92
93   \consists "Output_property_engraver"
94
95   \consists "Font_size_engraver"
96
97   \consists "Volta_engraver"
98   \consists "Separating_line_group_engraver"
99   \consists "Dot_column_engraver"
100
101   \consists "Ottava_spanner_engraver"
102   \consists "Rest_collision_engraver"
103   \consists "Piano_pedal_engraver"
104   \consists "Piano_pedal_align_engraver"
105   \consists "Instrument_name_engraver"
106   \consists "Grob_pq_engraver"
107   \consists "Forbid_line_break_engraver"
108   \consists "Axis_group_engraver"
109
110   \consists "Pitch_squash_engraver"
111
112   localKeySignature = #'()
113
114   % explicitly set instrumentName, so we don't get
115   % weird effects when doing instrument names for
116   % piano staves
117
118   instrumentName = #'()
119   shortInstrumentName = #'()
120
121   \accepts "Voice"
122 }
123
124
125 MyVoice = \context {
126   \type "Engraver_group"
127   \name Voice
128
129   \description "
130     Corresponds to a voice on a staff.  This context handles the
131     conversion of dynamic signs, stems, beams, super- and subscripts,
132     slurs, ties, and rests.
133
134     You have to instantiate this explicitly if you want to have
135     multiple voices on the same staff."
136
137   localKeySignature = #'()
138   \consists "Font_size_engraver"
139
140   % must come before all
141   \consists "Output_property_engraver"
142   \consists "Arpeggio_engraver"
143   \consists "Multi_measure_rest_engraver"
144   \consists "Text_spanner_engraver"
145   \consists "Grob_pq_engraver"
146   \consists "Note_head_line_engraver"
147   \consists "Glissando_engraver"
148   \consists "Ligature_bracket_engraver"
149   \consists "Breathing_sign_engraver"
150   % \consists "Rest_engraver"
151   \consists "Grace_beam_engraver"
152   \consists "New_fingering_engraver"
153   \consists "Chord_tremolo_engraver"
154   \consists "Percent_repeat_engraver"
155   \consists "Slash_repeat_engraver"
156
157   %{
158     Must come before text_engraver, but after note_column engraver.
159   %}
160   \consists "Text_engraver"
161   \consists "Dynamic_engraver"
162   \consists "Fingering_engraver"
163
164   \consists "Script_column_engraver"
165   \consists "Rhythmic_column_engraver"
166   \consists "Cluster_spanner_engraver"
167   \consists "Tie_engraver"
168   \consists "Tie_engraver"
169   \consists "Tuplet_engraver"
170   \consists "Note_heads_engraver"
171   \consists "Rest_engraver"
172 }
173
174
175 \score {
176   \topVoice
177   \layout {
178     \context { \MyStaff }
179     \context { \MyVoice }
180   }
181 }
182
183
184 MyStaff = \context {
185   \MyStaff
186   \consists "Staff_symbol_engraver"
187 }
188
189 \score {
190   \topVoice
191   \layout {
192     \context { \MyStaff }
193     \context { \MyVoice }
194   }
195 }
196
197 MyStaff = \context {
198   \MyStaff
199   \consists "Clef_engraver"
200   \remove "Pitch_squash_engraver"
201 }
202
203 \score {
204   \topVoice
205   \layout {
206     \context { \MyStaff }
207     \context { \MyVoice }
208   }
209 }
210
211 MyVoice = \context {
212   \MyVoice
213   \consists "Stem_engraver"
214 }
215
216 \score {
217   \topVoice
218   \layout {
219     \context { \MyStaff }
220     \context { \MyVoice }
221   }
222 }
223
224 MyVoice = \context {
225   \MyVoice
226   \consists "Beam_engraver"
227 }
228
229 \score {
230   \topVoice
231   \layout {
232     \context { \MyStaff }
233     \context { \MyVoice }
234   }
235 }
236
237 MyVoice = \context {
238   \MyVoice
239   \consists "Phrasing_slur_engraver"
240   \consists "Slur_engraver"
241   \consists "Script_engraver"
242 }
243
244
245 \score {
246   \topVoice
247   \layout {
248     \context { \MyStaff }
249     \context { \MyVoice }
250   }
251 }
252
253 MyStaff = \context {
254   \MyStaff
255   \consists "Bar_engraver"
256   \consists "Time_signature_engraver"
257 }
258
259 \score {
260   \topVoice
261   \layout {
262     \context { \MyStaff }
263     \context { \MyVoice }
264   }
265 }
266
267 MyStaff = \context {
268   \MyStaff
269   \consists "Accidental_engraver"
270   \consists "Key_engraver"
271 }
272 \score {
273   \topVoice
274   \layout {
275     \context { \MyStaff }
276     \context { \MyVoice }
277   }
278 }