]> git.donarmstrong.com Git - lilypond.git/blob - ly/engraver.ly
release: 1.3.131
[lilypond.git] / ly / engraver.ly
1 \version "1.3.122"
2
3 %
4 % setup for Request->Element conversion. Guru-only
5 %
6
7 StaffContext=\translator {
8         \type "Engraver_group_engraver";
9         \name Staff ;
10         \consists "Output_property_engraver";   
11         Generic_property_list = #generic-staff-properties
12         \consists "Property_engraver";
13         
14         \consists "Multi_measure_rest_engraver";
15
16         \consists "Bar_engraver";
17  % Bar_engraver must be first so default bars aren't overwritten
18 % with empty ones.
19
20
21 %       \consists "Repeat_engraver";
22         \consists "Volta_engraver";
23         \consists "Separating_line_group_engraver";     
24
25
26
27         \consists "Clef_engraver";
28         \consists "Key_engraver";
29         \consists "Time_signature_engraver";
30         \consists "Staff_symbol_engraver";
31         \consists "Collision_engraver";
32         \consists "Rest_collision_engraver";
33         \consists "Local_key_engraver";
34         \consists "Piano_pedal_engraver";
35
36 %{
37         The Instrument_name_engraver puts the name of the instrument
38         (\property Staff.instrument; Staff.instr for subsequent lines)
39         to the left of a staff.
40
41         This is commented out, so you don't get funny things on the
42         PianoStaff      
43         \consists "Instrument_name_engraver";
44 %}
45
46         \consistsend "Axis_group_engraver";
47
48           
49         \accepts "Voice";
50 }
51
52
53 StaffContainerContext = \translator {
54         \type Engraver_group_engraver;
55         \consists "Axis_group_engraver";
56         \accepts Staff;
57         \name StaffContainer;
58 }
59
60 ChoirStaffContext = \translator {
61         \type "Engraver_group_engraver";
62         \name ChoirStaff;
63         alignmentReference = \center;
64         \consists "System_start_delimiter_engraver";
65         SystemStartDelimiter \override #'glyph = #'bracket
66
67         \accepts "Staff";
68         \accepts "RhythmicStaff";
69         \accepts "GrandStaff";
70         \accepts "PianoStaff";
71         \accepts "Lyrics";
72         \accepts "ChordNames";
73 }
74
75
76 RhythmicStaffContext=\translator{
77         \type "Engraver_group_engraver";
78         
79         \consists "Property_engraver";
80         \consists "Output_property_engraver";   
81
82         Generic_property_list = #generic-staff-properties
83
84         \consists "Pitch_squash_engraver";
85         \consists "Separating_line_group_engraver";     
86         \name RhythmicStaff;
87         Bar \override #'bar-size = #4
88         VoltaBracket \override #'minimum-space =  #15  % urg, in \pt
89         VoltaBracket \override #'padding =  #5  % urg, in \pt
90         StaffSymbol \override #'line-count = #1 
91
92 %       \consists "Repeat_engraver";
93         \consists "Volta_engraver";
94         \consists "Bar_engraver";
95         \consists "Time_signature_engraver";
96         \consists "Staff_symbol_engraver";
97         \consistsend "Axis_group_engraver";
98         \accepts "Voice";
99 }
100
101
102 VoiceContext = \translator {
103         \type "Engraver_group_engraver";
104         \name Voice;
105
106         Generic_property_list = #generic-voice-properties
107         
108         \consists "Output_property_engraver";   
109         \consists "Arpeggio_engraver";
110
111         \consists "Text_spanner_engraver";
112         \consists "Property_engraver";
113         
114         \consists "Breathing_sign_engraver";
115         \consists "Rest_engraver";
116         \consists "Dot_column_engraver";
117         \consists "Stem_engraver";
118         \consists "Beam_engraver";
119         \consists "Auto_beam_engraver";
120
121         \consists "Chord_tremolo_engraver";
122         \consists "Melisma_engraver";
123
124 %{
125  Must come before text_engraver, but after note_column engraver.
126
127 %}
128         \consists "Dynamic_engraver";
129         \consists "Text_engraver";
130
131         \consists "Script_engraver";
132         \consists "Script_column_engraver";
133         \consists "Rhythmic_column_engraver";
134         \consists "Phrasing_slur_engraver";
135         \consists "Slur_engraver";
136         \consists "Tie_engraver";
137         \consists "Tuplet_engraver";
138         \consists "Grace_position_engraver";
139         \consists "A2_engraver";
140         \consists "Voice_devnull_engraver";
141
142         \consists "Skip_req_swallow_translator";
143         \accepts Thread; % bug if you leave out this!
144         \accepts Grace;
145 }
146
147 GraceContext=\translator {
148         \type "Grace_engraver_group";
149         \name "Grace";
150         \consists "Output_property_engraver";   
151
152         Generic_property_list = #generic-grace-properties
153         
154         \consists "Note_heads_engraver";
155         \consists "Local_key_engraver";
156         \consists "Stem_engraver";
157         \consists "Beam_engraver";
158         \consists "Slur_engraver";
159
160         \consists "Auto_beam_engraver";
161         \consists "Align_note_column_engraver";
162
163         \consists "Rhythmic_column_engraver";
164
165         \consists "Dynamic_engraver";% in Grace ???
166         \consists "Text_engraver"; % in Grace ???
167
168         \consists "Property_engraver";
169
170         Stem \override  #'flag-style = #"grace"
171         Stem \override  #'stem-length = #6.0
172         Stem \override  #'direction = #1
173
174         NoteHead \override #'font-relative-size = #-1
175         Stem \override #'font-relative-size = #-1
176         Stem \override #'stem-shorten = #'(0)
177         Beam \override #'font-relative-size = #-1
178         TextScript \override #'font-relative-size = #-1
179         Slur \override #'font-relative-size = #-1
180         Accidentals \override #'font-relative-size = #-1
181         Beam \override #'thickness = #0.3
182         Beam \override #'space-function = #(lambda (x) 0.5)
183
184         Stem \override #'lengths = #(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0))
185         Stem \override #'beamed-lengths =
186                 #'(0.0 2.5 2.0 1.5)
187         Stem \override #'beamed-minimum-lengths
188                  = #(map (lambda (x) (* 0.8 x)) '(0.0 2.5 2.0 1.5))
189
190         weAreGraceContext = ##t   
191         graceAccidentalSpace= 1.5 ; % in staff space
192 }
193
194 ThreadContext = \translator{
195         \type Engraver_group_engraver;
196         \name Thread;
197         
198         \consists "Thread_devnull_engraver";
199         \consists "Note_heads_engraver";
200         \consists "Note_head_line_engraver";
201         \consists "Output_property_engraver";   
202         Generic_property_list = #generic-thread-properties
203         \consists "Property_engraver";
204 }
205
206 GrandStaffContext=\translator{
207         \type "Engraver_group_engraver";
208         \name GrandStaff;
209         \consists "Span_bar_engraver";
210         \consists "Span_arpeggio_engraver";
211         \consists "System_start_delimiter_engraver";
212         SystemStartDelimiter \override #'glyph = #'brace
213         
214         \consists "Property_engraver";  
215         Generic_property_list = #generic-grand-staff-properties
216         \accepts "Staff";
217 }
218
219 PianoStaffContext = \translator{
220         \GrandStaffContext
221         \name "PianoStaff";
222
223         \consists "Vertical_align_engraver";
224
225         alignmentReference = \center;
226         verticalAlignmentChildCallback = #Align_interface::fixed_distance_alignment_callback
227         VerticalAlignment \override #'forced-distance = #12
228
229 %       \consistsend "Axis_group_engraver";
230 }
231
232 StaffGroupContext= \translator {
233         \type "Engraver_group_engraver";
234         \name StaffGroup;
235
236         \consists "Span_bar_engraver";
237         \consists "Span_arpeggio_engraver";
238         \consists "Output_property_engraver";   
239         SystemStartDelimiter \override #'glyph = #'bracket
240
241         \consists "System_start_delimiter_engraver";
242         \accepts "Staff";
243         \accepts "RhythmicStaff";
244         \accepts "GrandStaff";
245         \accepts "PianoStaff";
246         
247         \accepts "Lyrics";
248         \accepts "ChordNames";
249 }
250
251
252 % UGH! JUNKME
253 LyricsVoiceContext= \translator{
254         \type "Engraver_group_engraver";
255         \consistsend "Axis_group_engraver";
256         LyricsVoiceMinimumVerticalExtent = #(cons -1.2 1.2)
257
258         \name LyricsVoice ;
259         \consists "Separating_line_group_engraver";
260         \consists "Lyric_engraver";
261         \consists "Extender_engraver";
262         \consists "Hyphen_engraver";
263         \consists "Stanza_number_engraver";
264         phrasingPunctuation = #".,;:!?\""
265         
266 }
267 NoteNamesContext = \translator {
268         \type "Engraver_group_engraver";
269         \name NoteNames;
270         \consistsend "Axis_group_engraver";
271         \consists "Note_name_engraver";
272         \consists "Separating_line_group_engraver";
273 }
274
275 LyricsContext = \translator {
276         \type "Engraver_group_engraver";
277         \name Lyrics;
278         \consists Vertical_align_engraver; %need this for getting folded repeats right.
279         Generic_property_list = #generic-lyrics-properties
280         \consists "Property_engraver";
281         \consistsend "Axis_group_engraver";
282         
283         \accepts "LyricsVoice";
284 }
285
286 ChordNamesVoiceContext = \translator {
287         \type "Engraver_group_engraver";
288         \name ChordNamesVoice ;
289
290         \consists "Output_property_engraver";   
291         \consistsend "Axis_group_engraver";
292         \consists "Separating_line_group_engraver";
293         \consists "Chord_name_engraver";
294         \consists "Skip_req_swallow_translator";
295 }
296
297 ChordNamesContext = \translator {
298         \type "Engraver_group_engraver";
299         \name ChordNames;
300
301         Generic_property_list = #generic-chord-staff-properties
302
303         \consists "Property_engraver";  
304         \consists "Output_property_engraver";   
305         \accepts "ChordNamesVoice";
306
307         VerticalAxisGroup \override #'invisible-staff = ##t
308         \consistsend "Axis_group_engraver";
309         }
310
311
312
313 StupidScore = \translator {
314         \type "Score_engraver";
315         \name Score;
316         \consists "Note_heads_engraver";
317 }
318
319
320
321
322 HaraKiriStaffContext = \translator {
323         \StaffContext
324         \remove "Axis_group_engraver";
325         \consistsend "Hara_kiri_engraver";        
326         \consists "Instrument_name_engraver";
327         \accepts "Voice";
328 }
329 %{
330   The HaraKiriStaffContexts doesn't override \name,
331   so it is still named `Staff'.
332
333   %\translator { \HaraKiriStaffContext }
334 %}
335
336
337
338
339 ScoreContext = \translator {
340         \type Score_engraver;
341         \name Score;
342         
343
344         \consists "Repeat_acknowledge_engraver";
345         \consists "Timing_engraver";
346         \consists "Output_property_engraver";   
347         \consists "System_start_delimiter_engraver";
348         \consists "Mark_engraver";      
349         \consists "Break_align_engraver";
350         \consists "Spacing_engraver";
351         \consists "Vertical_align_engraver";
352
353         \consists "Lyric_phrasing_engraver";
354         \consists "Bar_number_engraver";
355         \consists "Span_arpeggio_engraver";
356
357         \accepts "Staff";       
358         \accepts "StaffContainer";
359         \accepts "StaffGroup";
360         \accepts "RhythmicStaff";       
361         \accepts "Lyrics";
362         \accepts "ChordNames";
363         \accepts "GrandStaff";
364         \accepts "ChoirStaff";
365         \accepts "PianoStaff";
366         \accepts "NoteNames";
367
368         soloText = #"Solo"
369         soloIIText = #"Solo II"
370         aDueText = #"\\`a2"
371         soloADue = ##t
372         splitInterval = #'(0 . 1)
373         changeMoment = #`(,(make-moment 0 0) . ,(make-moment 1 512))
374
375         %devNullThread = #'unisolo
376         %devNullVoice = #'unisolo
377
378         StaffMinimumVerticalExtent = #(cons -4.0 4.0)
379
380         barAuto = ##t
381         voltaVisibility = ##t
382         %  name, glyph id, clef position 
383         % where is c0 in this clef?
384         clefPitches = #'(("clefs-G" . -4)
385           ("clefs-C" . 0)
386           ("clefs-F" . 4)
387           ("clefs-vaticana_do" . 0)
388           ("clefs-vaticana_fa" . 4)
389           ("clefs-medicaea_do" . 0)
390           ("clefs-medicaea_fa" . 4)
391           ("clefs-hufnagel_do" . 0)
392           ("clefs-hufnagel_fa" . 4)
393           ("clefs-hufnagel_do_fa" . 0)
394           ("clefs-mensural1_c" . 0)
395           ("clefs-mensural2_c" . 0)
396           ("clefs-mensural3_c" . 0)
397           ("clefs-mensural1_f" . 4)
398           ("clefs-mensural2_f" . 4)
399           ("clefs-mensural_g" . -4))
400
401         clefGlyph = #"clefs-G"
402         clefPosition = #-2
403
404         automaticPhrasing = ##t;
405         alignmentReference = \down;
406         defaultBarType = #"|"
407
408         explicitClefVisibility = #all-visible
409         explicitKeySignatureVisibility = #all-visible
410         
411         scriptDefinitions = #default-script-alist
412
413         verticalAlignmentChildCallback = #Align_interface::alignment_callback
414
415         pedalSustainStrings = #'("Ped." "*Ped." "*")
416         pedalUnaChordaStrings = #'("una chorda" "" "tre chorde")
417         pedalSostenutoStrings = #'()  % FIXME
418
419         tupletNumberFormatFunction = #denominator-tuplet-formatter
420         
421        keyAccidentalOrder = #'(
422          (6 . -1) (2  . -1) (5 . -1 ) (1  . -1) (4  . -1) (0  . -1) (3  . -1)
423          (3  . 1) (0 . 1) (4 . 1) (1 . 1) (5 . 1) (2 . 1) (6 . 1)
424        )
425         breakAlignOrder = #'(
426           Instrument_name
427           Left_edge_item
428           Span_bar
429           Breathing_sign
430           Clef_item
431           Key_item
432           Staff_bar
433           Time_signature
434           Custos
435           Stanza_number
436         )
437
438
439         \elementdescriptions #all-grob-descriptions
440 }
441
442 OrchestralScoreContext= \translator {
443         \ScoreContext
444 }
445