]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/engravers-one-by-one.ly
e4bf7cee974ddde08c297095b681915ae58f5d36
[lilypond.git] / Documentation / snippets / engravers-one-by-one.ly
1 %% Do not edit this file; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% This file is in the public domain.
4 \version "2.13.16"
5
6 \header {
7   lsrtags = "contexts-and-engravers"
8
9 %% Translation of GIT committish: 2b0dc29608d6c3f5a03ead4877ae514c647adb74
10   texidoces = "
11 Del problema central de la notación, esto es, crear un determinado
12 símbolo, se encargan los «plugins» o complementos añadidos.  Cada
13 uno de los complementos se conoce como un grabador. En este
14 ejemplo, los grabadores se van activando uno por uno, en el orden
15 siguiente:
16
17 - cabeza de las notas,
18
19 - el símbolo del pentagrama,
20
21 - clave,
22
23 - plicas,
24
25 - barras, ligaduras de expresión, acentos,
26
27 - alteraciones, líneas divisorias, indicación del compás, y armadura.
28
29 Los grabadores se encuentran agrupados. Por ejemplo, las cabezas de
30 nota, ligaduras de expresión, barras de corchea, etc. forman un
31 contexto de voz, @code{Voice}. Los grabadores de la armadura,
32 alteraciones, líneas de compás, etc. forman un contexto de pentagrama,
33 @code{Staff}.
34
35 "
36   doctitlees = "Los grabadores uno por uno"
37
38   texidoc = "
39 The notation problem, creating a certain symbol, is handled by plugins.
40  Each plugin is called an Engraver. In this example, engravers are
41 switched on one by one, in the following order:
42
43 - note heads,
44
45
46 - staff symbol,
47
48
49 - clef,
50
51
52 - stem,
53
54
55 - beams, slurs, accents,
56
57
58 - accidentals, bar lines, time signature and key signature.
59
60
61
62 Engravers are grouped. For example, note heads, slurs, beams etc. form
63 a @code{Voice} context. Engravers for key signature, accidentals, bar
64 line, etc. form a @code{Staff} context.
65
66 "
67   doctitle = "Engravers one-by-one"
68 } % begin verbatim
69
70 %% sample music
71 topVoice = \relative c' {
72   \key d \major
73   es8([ g] a[ fis])
74   b4
75   b16[-. b-. b-. cis-.]
76   d4->
77 }
78
79 botVoice = \relative c' {
80   \key d \major
81   c8[( f] b[ a)]
82   es4
83   es16[-. es-. es-. fis-.]
84   b4->
85 }
86
87 hoom = \relative c {
88   \key d \major
89   \clef bass
90   g8-. r
91   r4
92   fis8-.
93   r8
94   r4
95   b'4->
96 }
97
98 pah = \relative c' {
99   r8 b-.
100   r4
101   r8 g8-.
102   r16 g-. r8
103   \clef treble
104   fis'4->
105 }
106
107 %
108 % setup for Request->Element conversion. Guru-only
109 %
110
111 MyStaff = \context {
112   \type "Engraver_group"
113   \name Staff
114
115   \description "Handles clefs, bar lines, keys, accidentals.  It can contain
116 @code{Voice} contexts."
117
118   \consists "Output_property_engraver"
119
120   \consists "Font_size_engraver"
121
122   \consists "Volta_engraver"
123   \consists "Separating_line_group_engraver"
124   \consists "Dot_column_engraver"
125
126   \consists "Ottava_spanner_engraver"
127   \consists "Rest_collision_engraver"
128   \consists "Piano_pedal_engraver"
129   \consists "Piano_pedal_align_engraver"
130   \consists "Instrument_name_engraver"
131   \consists "Grob_pq_engraver"
132   \consists "Forbid_line_break_engraver"
133   \consists "Axis_group_engraver"
134
135   \consists "Pitch_squash_engraver"
136
137   \override VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 6)
138   localKeySignature = #'()
139
140   % explicitly set instrumentName, so we don't get
141   % weird effects when doing instrument names for
142   % piano staves
143
144   instrumentName = #'()
145   shortInstrumentName = #'()
146
147   \accepts "Voice"
148 }
149
150
151 MyVoice = \context {
152   \type "Engraver_group"
153   \name Voice
154
155   \description "
156     Corresponds to a voice on a staff.  This context handles the
157     conversion of dynamic signs, stems, beams, super- and subscripts,
158     slurs, ties, and rests.
159
160     You have to instantiate this explicitly if you want to have
161     multiple voices on the same staff."
162
163   localKeySignature = #'()
164   \consists "Font_size_engraver"
165
166   % must come before all
167   \consists "Output_property_engraver"
168   \consists "Arpeggio_engraver"
169   \consists "Multi_measure_rest_engraver"
170   \consists "Text_spanner_engraver"
171   \consists "Grob_pq_engraver"
172   \consists "Note_head_line_engraver"
173   \consists "Glissando_engraver"
174   \consists "Ligature_bracket_engraver"
175   \consists "Breathing_sign_engraver"
176   % \consists "Rest_engraver"
177   \consists "Grace_beam_engraver"
178   \consists "New_fingering_engraver"
179   \consists "Chord_tremolo_engraver"
180   \consists "Percent_repeat_engraver"
181   \consists "Slash_repeat_engraver"
182
183   %{
184     Must come before text_engraver, but after note_column engraver.
185   %}
186   \consists "Text_engraver"
187   \consists "Dynamic_engraver"
188   \consists "Fingering_engraver"
189
190   \consists "Script_column_engraver"
191   \consists "Rhythmic_column_engraver"
192   \consists "Cluster_spanner_engraver"
193   \consists "Tie_engraver"
194   \consists "Tie_engraver"
195   \consists "Tuplet_engraver"
196   \consists "Note_heads_engraver"
197   \consists "Rest_engraver"
198 }
199
200
201 \score {
202   \topVoice
203   \layout {
204     \context { \MyStaff }
205     \context { \MyVoice }
206   }
207 }
208
209
210 MyStaff = \context {
211   \MyStaff
212   \consists "Staff_symbol_engraver"
213 }
214
215 \score {
216   \topVoice
217   \layout {
218     \context { \MyStaff }
219     \context { \MyVoice }
220   }
221 }
222
223 MyStaff = \context {
224   \MyStaff
225   \consists "Clef_engraver"
226   \remove "Pitch_squash_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 "Stem_engraver"
240 }
241
242 \score {
243   \topVoice
244   \layout {
245     \context { \MyStaff }
246     \context { \MyVoice }
247   }
248 }
249
250 MyVoice = \context {
251   \MyVoice
252   \consists "Beam_engraver"
253 }
254
255 \score {
256   \topVoice
257   \layout {
258     \context { \MyStaff }
259     \context { \MyVoice }
260   }
261 }
262
263 MyVoice = \context {
264   \MyVoice
265   \consists "Phrasing_slur_engraver"
266   \consists "Slur_engraver"
267   \consists "Script_engraver"
268 }
269
270
271 \score {
272   \topVoice
273   \layout {
274     \context { \MyStaff }
275     \context { \MyVoice }
276   }
277 }
278
279 MyStaff = \context {
280   \MyStaff
281   \consists "Bar_engraver"
282   \consists "Time_signature_engraver"
283 }
284
285 \score {
286   \topVoice
287   \layout {
288     \context { \MyStaff }
289     \context { \MyVoice }
290   }
291 }
292
293 MyStaff = \context {
294   \MyStaff
295   \consists "Accidental_engraver"
296   \consists "Key_engraver"
297 }
298 \score {
299   \topVoice
300   \layout {
301     \context { \MyStaff }
302     \context { \MyVoice }
303   }
304 }
305