]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/engravers-one-by-one.ly
Docs: update LSR
[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.4"
5
6 \header {
7   lsrtags = "contexts-and-engravers"
8
9 %% Translation of GIT committish: b2d4318d6c53df8469dfa4da09b27c15a374d0ca
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
30 de nota, ligaduras de expresión, barras de corchea, etc. forman un
31 contexto de voz. Los grabadores de la armadura, alteraciones,
32 compás, etc. forman un contexto de pentagrama.
33
34 Sólo podemos ver el primer ejemplo en este documento; para ver los
35 demás debemos descartar el fragmento de código y procesarlo en
36 nuestro ordenador.
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 Voice context. Engravers for key, accidental, bar, etc. form a Staff
67 context.
68
69
70 You may only see the first example in this document; please download
71 this snippet and run it from your own computer. 
72
73 "
74   doctitle = "Engravers one-by-one"
75 } % begin verbatim
76
77 %% sample music
78 topVoice =  \relative c' {
79   \key d\major
80   es8([ g] a[ fis])
81   b4
82   b16[-. b-. b-. cis-.]
83   d4->
84 }
85
86 botVoice =  \relative c' {
87   \key d\major
88   c8[( f] b[ a)]
89   es4
90   es16[-. es-. es-. fis-.]
91   b4->
92 }
93
94 hoom =  \relative c {
95   \key d \major
96   \clef bass
97   g8-. r
98   r4 
99   fis8-.
100   r8
101   r4
102   b'4->
103 }
104
105 pah =  \relative c' {
106   r8 b-.
107   r4
108   r8 g8-.
109   r16 g-. r8
110   \clef treble
111   fis'4->
112 }
113
114 %
115 % setup for Request->Element conversion. Guru-only
116 %
117
118 MyStaff =\context {
119   \type "Engraver_group"
120   \name Staff
121
122   \description "Handles clefs, bar lines, keys, accidentals.  It can contain
123 @code{Voice} contexts."
124
125   
126   \consists "Output_property_engraver"  
127   
128   \consists "Font_size_engraver"
129
130   \consists "Volta_engraver"
131   \consists "Separating_line_group_engraver"    
132   \consists "Dot_column_engraver"
133
134   \consists "Ottava_spanner_engraver"
135   \consists "Rest_collision_engraver"
136   \consists "Piano_pedal_engraver"
137   \consists "Piano_pedal_align_engraver"
138   \consists "Instrument_name_engraver"
139   \consists "Grob_pq_engraver"
140   \consists "Forbid_line_break_engraver"
141   \consists "Axis_group_engraver"
142
143   \consists "Pitch_squash_engraver"
144
145   \override VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 6)
146   extraVerticalExtent = ##f
147   verticalExtent = ##f 
148   localKeySignature = #'()
149
150                                 % explicitly set instrument, so we don't get 
151                                 % weird effects when doing instrument names for
152                                 % piano staves
153
154   instrumentName = #'()
155   shortInstrumentName = #'()
156   
157   \accepts "Voice"
158 }
159
160
161 MyVoice = \context {
162   \type "Engraver_group"
163   \name Voice
164
165   \description "
166     Corresponds to a voice on a staff.  This context handles the
167     conversion of dynamic signs, stems, beams, super- and subscripts,
168     slurs, ties, and rests.
169
170     You have to instantiate this explicitly if you want to have
171     multiple voices on the same staff."
172
173   localKeySignature = #'()
174   \consists "Font_size_engraver"
175   
176                                 % must come before all
177   \consists "Output_property_engraver"  
178   \consists "Arpeggio_engraver"
179   \consists "Multi_measure_rest_engraver"
180   \consists "Text_spanner_engraver"
181   \consists "Grob_pq_engraver"
182   \consists "Note_head_line_engraver"
183   \consists "Glissando_engraver"
184   \consists "Ligature_bracket_engraver"
185   \consists "Breathing_sign_engraver"
186                                 % \consists "Rest_engraver"
187   \consists "Grace_beam_engraver"
188   \consists "New_fingering_engraver"
189   \consists "Chord_tremolo_engraver"
190   \consists "Percent_repeat_engraver"
191   \consists "Slash_repeat_engraver"
192
193 %{
194   Must come before text_engraver, but after note_column engraver.
195
196 %}
197   \consists "Text_engraver"
198   \consists "Dynamic_engraver"
199   \consists "Fingering_engraver"
200
201   \consists "Script_column_engraver"
202   \consists "Rhythmic_column_engraver"
203   \consists "Cluster_spanner_engraver"
204   \consists "Tie_engraver"
205   \consists "Tie_engraver"
206   \consists "Tuplet_engraver"
207   \consists "Note_heads_engraver"
208   \consists "Rest_engraver"
209
210   \consists "Skip_event_swallow_translator"
211 }
212
213
214 \score {
215   \topVoice
216   \layout {
217     \context { \MyStaff }
218     \context { \MyVoice }
219   }
220 }
221
222
223 MyStaff = \context {
224     \MyStaff
225     \consists "Staff_symbol_engraver"
226 }
227
228 \score {
229   \topVoice
230   \layout {
231       \context { \MyStaff }
232       \context { \MyVoice }
233             }
234 }
235
236 MyStaff = \context {
237     \MyStaff
238     \consists "Clef_engraver"
239     \remove "Pitch_squash_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 "Stem_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 "Beam_engraver"
266 }
267
268 \score {
269   \topVoice
270   \layout {
271     \context { \MyStaff }
272     \context { \MyVoice }
273   }
274 }
275
276 MyVoice= \context {
277   \MyVoice
278   \consists "Phrasing_slur_engraver"
279   \consists "Slur_engraver"
280   \consists "Script_engraver"
281 }
282
283
284 \score {
285   \topVoice
286   \layout {
287     \context { \MyStaff }
288     \context { \MyVoice }
289   }
290 }
291
292 MyStaff = \context {
293   \MyStaff
294   \consists "Bar_engraver"
295   \consists "Time_signature_engraver"
296 }
297
298 \score {
299   \topVoice
300   \layout {
301     \context { \MyStaff }
302     \context { \MyVoice }
303   }
304 }
305
306 MyStaff = \context {
307   \MyStaff
308   \consists "Accidental_engraver"    
309   \consists "Key_engraver"
310 }
311 \score {
312   \topVoice
313   \layout {
314     \context { \MyStaff }
315     \context { \MyVoice }
316   }
317 }
318
319