]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/engravers-one-by-one.ly
Doc-fr: updates texidocs
[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.19.7"
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   localAlterations = #'()
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   \defaultchild "Voice"
123 }
124
125
126 MyVoice = \context {
127   \type "Engraver_group"
128   \name Voice
129
130   \description "
131     Corresponds to a voice on a staff.  This context handles the
132     conversion of dynamic signs, stems, beams, super- and subscripts,
133     slurs, ties, and rests.
134
135     You have to instantiate this explicitly if you want to have
136     multiple voices on the same staff."
137
138   localAlterations = #'()
139   \consists "Font_size_engraver"
140
141   % must come before all
142   \consists "Output_property_engraver"
143   \consists "Arpeggio_engraver"
144   \consists "Multi_measure_rest_engraver"
145   \consists "Text_spanner_engraver"
146   \consists "Grob_pq_engraver"
147   \consists "Note_head_line_engraver"
148   \consists "Glissando_engraver"
149   \consists "Ligature_bracket_engraver"
150   \consists "Breathing_sign_engraver"
151   % \consists "Rest_engraver"
152   \consists "Grace_beam_engraver"
153   \consists "New_fingering_engraver"
154   \consists "Chord_tremolo_engraver"
155   \consists "Percent_repeat_engraver"
156   \consists "Slash_repeat_engraver"
157
158   %{
159     Must come before text_engraver, but after note_column engraver.
160   %}
161   \consists "Text_engraver"
162   \consists "Dynamic_engraver"
163   \consists "Dynamic_align_engraver"
164   \consists "Fingering_engraver"
165
166   \consists "Script_column_engraver"
167   \consists "Rhythmic_column_engraver"
168   \consists "Cluster_spanner_engraver"
169   \consists "Tie_engraver"
170   \consists "Tie_engraver"
171   \consists "Tuplet_engraver"
172   \consists "Note_heads_engraver"
173   \consists "Rest_engraver"
174 }
175
176
177 \score {
178   \topVoice
179   \layout {
180     \context { \MyStaff }
181     \context { \MyVoice }
182   }
183 }
184
185
186 MyStaff = \context {
187   \MyStaff
188   \consists "Staff_symbol_engraver"
189 }
190
191 \score {
192   \topVoice
193   \layout {
194     \context { \MyStaff }
195     \context { \MyVoice }
196   }
197 }
198
199 MyStaff = \context {
200   \MyStaff
201   \consists "Clef_engraver"
202   \remove "Pitch_squash_engraver"
203 }
204
205 \score {
206   \topVoice
207   \layout {
208     \context { \MyStaff }
209     \context { \MyVoice }
210   }
211 }
212
213 MyVoice = \context {
214   \MyVoice
215   \consists "Stem_engraver"
216 }
217
218 \score {
219   \topVoice
220   \layout {
221     \context { \MyStaff }
222     \context { \MyVoice }
223   }
224 }
225
226 MyVoice = \context {
227   \MyVoice
228   \consists "Beam_engraver"
229 }
230
231 \score {
232   \topVoice
233   \layout {
234     \context { \MyStaff }
235     \context { \MyVoice }
236   }
237 }
238
239 MyVoice = \context {
240   \MyVoice
241   \consists "Phrasing_slur_engraver"
242   \consists "Slur_engraver"
243   \consists "Script_engraver"
244 }
245
246
247 \score {
248   \topVoice
249   \layout {
250     \context { \MyStaff }
251     \context { \MyVoice }
252   }
253 }
254
255 MyStaff = \context {
256   \MyStaff
257   \consists "Bar_engraver"
258   \consists "Time_signature_engraver"
259 }
260
261 \score {
262   \topVoice
263   \layout {
264     \context { \MyStaff }
265     \context { \MyVoice }
266   }
267 }
268
269 MyStaff = \context {
270   \MyStaff
271   \consists "Accidental_engraver"
272   \consists "Key_engraver"
273 }
274 \score {
275   \topVoice
276   \layout {
277     \context { \MyStaff }
278     \context { \MyVoice }
279   }
280 }