]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/engravers-one-by-one.ly
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond
[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.10"
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 @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 %% sample music
74 topVoice = \relative c' {
75   \key d \major
76   es8([ g] a[ fis])
77   b4
78   b16[-. b-. b-. cis-.]
79   d4->
80 }
81
82 botVoice = \relative c' {
83   \key d \major
84   c8[( f] b[ a)]
85   es4
86   es16[-. es-. es-. fis-.]
87   b4->
88 }
89
90 hoom = \relative c {
91   \key d \major
92   \clef bass
93   g8-. r
94   r4
95   fis8-.
96   r8
97   r4
98   b'4->
99 }
100
101 pah = \relative c' {
102   r8 b-.
103   r4
104   r8 g8-.
105   r16 g-. r8
106   \clef treble
107   fis'4->
108 }
109
110 %
111 % setup for Request->Element conversion. Guru-only
112 %
113
114 MyStaff = \context {
115   \type "Engraver_group"
116   \name Staff
117
118   \description "Handles clefs, bar lines, keys, accidentals.  It can contain
119 @code{Voice} contexts."
120
121   \consists "Output_property_engraver"
122
123   \consists "Font_size_engraver"
124
125   \consists "Volta_engraver"
126   \consists "Separating_line_group_engraver"
127   \consists "Dot_column_engraver"
128
129   \consists "Ottava_spanner_engraver"
130   \consists "Rest_collision_engraver"
131   \consists "Piano_pedal_engraver"
132   \consists "Piano_pedal_align_engraver"
133   \consists "Instrument_name_engraver"
134   \consists "Grob_pq_engraver"
135   \consists "Forbid_line_break_engraver"
136   \consists "Axis_group_engraver"
137
138   \consists "Pitch_squash_engraver"
139
140   \override VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 6)
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