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