]> git.donarmstrong.com Git - lilypond.git/blob - ly/engraver-init.ly
* ly/engraver-init.ly (VoiceContext): move Note_head_line_engraver
[lilypond.git] / ly / engraver-init.ly
1 \version "1.7.18"
2
3
4
5 %
6 % setup for Request->Element conversion. Guru-only
7 %
8
9 StaffContext=\translator {
10         \type "Engraver_group_engraver"
11         \name Staff
12
13         \description "Handles clefs, bar lines, keys, accidentals.  It can contain
14 @code{Voice} contexts."
15
16         
17         \consists "Output_property_engraver"    
18         
19         \consists "Bar_engraver"
20  % Bar_engraver must be first so default bars aren't overwritten
21 % with empty ones.
22         \consists "Font_size_engraver"
23
24 %       \consists "Repeat_engraver"
25         \consists "Volta_engraver"
26         \consists "Separating_line_group_engraver"      
27         SeparatingGroupSpanner \override #'spacing-procedure
28           =  #Separating_group_spanner::set_spacing_rods_and_seqs
29         \consists "Dot_column_engraver"
30
31         % perhaps move to Voice context?
32         \consists "Ottava_spanner_engraver"
33         \consists "Clef_engraver"
34         \consists "Key_engraver"
35         \consists "Time_signature_engraver"
36         \consists "Staff_symbol_engraver"
37         \consists "Collision_engraver"
38         \consists "Rest_collision_engraver"
39         \consists "Accidental_engraver"
40         \consists "Piano_pedal_engraver"
41         \consists "Instrument_name_engraver"
42         \consists "Grob_pq_engraver"
43         \consists "Forbid_line_break_engraver"
44         \consistsend "Axis_group_engraver"
45
46         minimumVerticalExtent = #'(-6 . 6)
47         extraVerticalExtent = ##f
48         verticalExtent = ##f 
49         localKeySignature = #'()
50
51         % explicitly set instrument, so we don't get 
52         % weird effects when doing instrument names for
53         % piano staves
54
55         instrument = #'()
56         instr = #'()
57           
58         \accepts "Voice"
59 }
60
61
62 StaffContainerContext = \translator {
63         \type Engraver_group_engraver
64         \consists "Axis_group_engraver"
65         minimumVerticalExtent = ##f
66         extraVerticalExtent = ##f
67         verticalExtent = ##f 
68         localKeySignature = #'()
69
70         \accepts Staff
71         \name StaffContainer
72 }
73
74 InnerChoirStaffContext = \translator {
75         \type "Engraver_group_engraver"
76         \name InnerChoirStaff
77         \consists "System_start_delimiter_engraver"
78         systemStartDelimiter = #'SystemStartBracket
79         localKeySignature = #'()
80
81         \accepts "Staff"
82         \accepts "RhythmicStaff"
83         \accepts "GrandStaff"
84         \accepts "PianoStaff"
85         \accepts "Lyrics"
86         \accepts "ChordNames"
87 }
88
89 ChoirStaffContext = \translator {
90         \InnerChoirStaffContext
91         \name ChoirStaff
92         
93         \description "Identical to @code{StaffGroup} except that the
94     contained staves are not connected vertically."
95         
96         \accepts "InnerChoirStaff"
97         \accepts "InnerStaffGroup"
98 }
99
100
101 RhythmicStaffContext=\translator{
102         \type "Engraver_group_engraver"
103         
104         \consists "Output_property_engraver"    
105
106 \description  "
107     A context like @code{Staff} but for printing rhythms.  Pitches are
108     ignored; the notes are printed on one line.  
109 "
110         minimumVerticalExtent = ##f
111         extraVerticalExtent = ##f
112         verticalExtent = ##f 
113         localKeySignature = #'()
114
115         \consists "Pitch_squash_engraver"
116         \consists "Separating_line_group_engraver"      
117         \name RhythmicStaff
118         \alias "Staff"
119         
120         BarLine \override #'bar-size = #4
121         VoltaBracket \override #'minimum-space =  #15  % urg, in \pt
122         VoltaBracket \override #'padding =  #5  % urg, in \pt
123         StaffSymbol \override #'line-count = #1 
124
125         Stem \override #'neutral-direction = #1
126         Beam \override #'neutral-direction = #1         
127 %       \consists "Repeat_engraver"
128         \consists "Dot_column_engraver"
129         \consists "Volta_engraver"
130         \consists "Bar_engraver"
131         \consists "Time_signature_engraver"
132         \consists "Staff_symbol_engraver"
133         \consists "Instrument_name_engraver"
134         \consistsend "Axis_group_engraver"
135         \accepts "Voice"
136 }
137
138
139 VoiceContext = \translator {
140         \type "Engraver_group_engraver"
141         \name Voice
142 \description "
143     Corresponds to a voice on a staff.  This context handles the
144     conversion of dynamic signs, stems, beams, super- and subscripts,
145     slurs, ties, and rests.
146
147     You have to instantiate this explicitly if you want to have
148     multiple voices on the same staff."
149
150         localKeySignature = #'()
151         \consists "Font_size_engraver"
152         
153         % must come before all
154         \consists "Voice_devnull_engraver"
155         \consists "Output_property_engraver"    
156         \consists "Arpeggio_engraver"
157         \consists "Multi_measure_rest_engraver"
158         \consists "Text_spanner_engraver"
159         \consists "Grob_pq_engraver"
160
161         \consists "Note_head_line_engraver"
162         \consists "Glissando_engraver"
163         \consists "Ligature_bracket_engraver"
164         \consists "Breathing_sign_engraver"
165         % \consists "Rest_engraver"
166         \consists "Stem_engraver"
167         \consists "Beam_engraver"
168         \consists "Grace_beam_engraver"
169         \consists "Auto_beam_engraver"
170         \consists "New_fingering_engraver"
171         \consists "Chord_tremolo_engraver"
172         \consists "Percent_repeat_engraver"
173         \consists "Slash_repeat_engraver"
174         \consists "Melisma_engraver"
175
176 %{
177  Must come before text_engraver, but after note_column engraver.
178
179 %}
180         \consists "Text_engraver"
181         \consists "Dynamic_engraver"
182         \consists "Fingering_engraver"
183
184         \consists "Script_engraver"
185         \consists "Script_column_engraver"
186         \consists "Rhythmic_column_engraver"
187         \consists "Phrasing_slur_engraver"
188         \consists "Cluster_engraver"
189         \consists "Slur_engraver"
190         \consists "Tie_engraver"
191         \consists "New_tie_engraver"
192         \consists "Tuplet_engraver"
193         \consists "A2_engraver"
194
195         \consists "Skip_event_swallow_translator"
196         \accepts Thread % bug if you leave out this!
197 }
198
199 ThreadContext = \translator{
200         \type Engraver_group_engraver
201         \name Thread
202         localKeySignature = #'()
203 \description "
204     Handles note heads, and is contained in the Voice context.  You
205     have to instantiate this explicitly if you want to adjust the
206     style of individual note heads.
207 "
208         \consists "Font_size_engraver"  
209         \consists "Thread_devnull_engraver"
210         \consists "Note_heads_engraver"
211         \consists "Rest_engraver"
212
213         % why here ? 
214         \consists "Output_property_engraver"    
215
216 }
217
218
219
220 GrandStaffContext=\translator{
221         \type "Engraver_group_engraver"
222         \name GrandStaff
223         localKeySignature = #'()
224         
225         \description " A group of staffs, with a brace on the left
226     side, grouping the staves together.  The bar lines of the
227     contained staves are connected vertically.  "
228
229         \consists "Span_bar_engraver"
230         \consists "Span_arpeggio_engraver"
231         \consists "System_start_delimiter_engraver"
232         systemStartDelimiter = #'SystemStartBrace
233
234         \accepts "Staff"
235 }
236
237 PianoStaffContext = \translator{
238         \GrandStaffContext
239         \name "PianoStaff"
240         \alias "GrandStaff"
241 \description "
242     Just like @code{GrandStaff} but with @code{minVerticalAlign} set
243     equal to @code{maxVerticalAlign} so that interstaff beaming and
244     slurring can be used."
245         verticalAlignmentChildCallback = #Align_interface::fixed_distance_alignment_callback
246         VerticalAlignment \override #'forced-distance = #12
247         VerticalAlignment \override #'self-alignment-Y = #0
248
249         \consists "Vertical_align_engraver"
250         \consists "Instrument_name_engraver"
251         
252         instrument = #'()
253         instr = #'()
254         
255 %       \consistsend "Axis_group_engraver"
256 }
257
258 InnerStaffGroupContext= \translator {
259         \type "Engraver_group_engraver"
260         \name InnerStaffGroup
261         localKeySignature = #'()
262
263         \consists "Span_bar_engraver"
264         \consists "Span_arpeggio_engraver"
265         \consists "Output_property_engraver"    
266         systemStartDelimiter = #'SystemStartBracket
267
268         \consists "System_start_delimiter_engraver"
269         \accepts "Staff"
270         \accepts "RhythmicStaff"
271         \accepts "GrandStaff"
272         \accepts "PianoStaff"
273         \accepts "TabStaff"     
274         \accepts "Lyrics"
275         \accepts "ChordNames"
276 }
277
278 StaffGroupContext = \translator {
279         \InnerStaffGroupContext
280         \name StaffGroup
281         
282         \description
283
284         " Groups staffs while adding a bracket on the left side,
285         grouping the staves together.  The bar lines of the contained
286         staves are connected vertically.
287 "
288         
289         \accepts "InnerChoirStaff"
290         \accepts "ChoirStaff"
291         \accepts "InnerStaffGroup"
292         \accepts "FiguredBass"
293 }
294
295
296 % UGH! JUNKME
297 LyricsVoiceContext= \translator{
298         \type "Engraver_group_engraver"
299         \consistsend "Hara_kiri_engraver"
300         minimumVerticalExtent = #'(-1.2 . 1.2)
301         extraVerticalExtent = ##f
302         verticalExtent = ##f
303
304         \description "
305     Corresponds to a voice with lyrics.  Handles the printing of a
306     single line of lyrics.
307 "
308         
309         \name LyricsVoice 
310         \consists "Separating_line_group_engraver"
311         \consists "Lyric_engraver"
312         \consists "Extender_engraver"
313         \consists "Hyphen_engraver"
314         \consists "Stanza_number_engraver"
315         \consists "Skip_event_swallow_translator"
316         phrasingPunctuation = #".,:!?\""
317         
318 }
319 NoteNamesContext = \translator {
320         \type "Engraver_group_engraver"
321         \name NoteNames
322         \consistsend "Axis_group_engraver"
323
324         minimumVerticalExtent = ##f
325         extraVerticalExtent = ##f
326         verticalExtent = ##f 
327
328         
329         \consists "Note_name_engraver"
330         \consists "Separating_line_group_engraver"
331 }
332
333 LyricsContext = \translator {
334         \type "Engraver_group_engraver"
335         \name Lyrics
336         \description  "Typesets lyrics."
337         %% To get folded repeats right.
338         \consists Vertical_align_engraver 
339
340         \consistsend "Hara_kiri_engraver"
341         minimumVerticalExtent = ##f
342         extraVerticalExtent = ##f
343         verticalExtent = ##f 
344         
345         \accepts "LyricsVoice"
346 }
347
348
349 ChordNamesContext = \translator {
350         \type "Engraver_group_engraver"
351         \name ChordNames
352 \description "    Typesets chord names."
353         
354         \consists "Rest_swallow_translator" 
355         \consists "Output_property_engraver"    
356         \consists "Separating_line_group_engraver"
357         \consists "Chord_name_engraver"
358         \consists "Skip_event_swallow_translator"
359         \consistsend "Hara_kiri_engraver"
360         minimumVerticalExtent = #'(0 . 2.5)
361         extraVerticalExtent = ##f
362         verticalExtent = ##f 
363 }
364
365
366 RemoveEmptyStaffContext = \translator {
367         \StaffContext
368         \remove "Axis_group_engraver"
369         \consistsend "Hara_kiri_engraver"
370         \consists "Instrument_name_engraver"
371         \accepts "Voice"
372
373         % hara kiri & auto knee don't work together.
374         Beam \override #'auto-knee-gap = #'()
375 }
376
377 HaraKiriStaffContext = \translator { \RemoveEmptyStaffContext }
378
379 ScoreContext = \translator {
380         \type Score_engraver
381         \name Score
382         localKeySignature = #'()
383
384         \description "This is the top level notation context.  No
385     other context can contain a @code{Score} context.  This context
386     handles the administration of time signatures.  It also makes sure
387     that items such as clefs, time signatures, and key-signatures are
388     aligned across staves.
389
390     You cannot explicitly instantiate a Score context (since it is
391     not contained in any other context).  It is instantiated
392     automatically when an output definition (a @code{\score} or
393     @code{\paper} block) is processed."
394         
395         \consists "Repeat_acknowledge_engraver"
396         \consists "Staff_collecting_engraver"
397
398         % move the alias along with the engraver.
399
400         %% TODO? add this alias from Timing_engraver::initialize() ? 
401         \consists "Timing_engraver"
402         \alias "Timing"
403         
404         \consists "Output_property_engraver"
405         \consists "System_start_delimiter_engraver"
406         \consists "Mark_engraver"       
407         \consists "Metronome_mark_engraver"     
408         \consists "Break_align_engraver"
409         \consists "Spacing_engraver"
410         \consists "Vertical_align_engraver"
411         \consists "Lyric_phrasing_engraver"
412         \consists "Bar_number_engraver"
413         \consists "Span_arpeggio_engraver"
414
415         \accepts "Staff"
416         \accepts "TabStaff"
417         \accepts "StaffContainer"
418         \accepts "StaffGroup"
419         \accepts "RhythmicStaff"        
420         \accepts "Lyrics"
421         \accepts "ChordNames"
422         \accepts "GrandStaff"
423         \accepts "ChoirStaff"
424         \accepts "PianoStaff"
425         \accepts "NoteNames"
426         \accepts "FiguredBass"  
427
428         soloText = #"Solo"
429         soloIIText = #"Solo II"
430         aDueText = #"a2"
431         soloADue = ##t
432         splitInterval = #'(0 . 1)
433         changeMoment = #`(,(ly:make-moment 0 0) . ,(ly:make-moment 1 512))
434         systemStartDelimiter =#'SystemStartBar
435
436
437         clefGlyph = #"clefs-G"
438         clefPosition = #-2
439         centralCPosition = #-6
440         
441         automaticPhrasing = ##t
442         automaticMelismata = ##t
443         
444         defaultBarType = #"|"
445         barNumberVisibility = #default-bar-number-visibility
446
447         explicitClefVisibility = #all-visible
448         explicitKeySignatureVisibility = #all-visible
449         autoBeamSettings = #default-auto-beam-settings
450         autoBeaming = ##t
451         scriptDefinitions = #default-script-alist
452
453         verticalAlignmentChildCallback = #Align_interface::alignment_callback
454
455         pedalSustainStrings = #'("Ped." "*Ped." "*")
456         pedalUnaCordaStrings = #'("una corda" "" "tre corde")
457
458         %% These are in ordinary italic font, including the *,
459         %% but they are unlikely to be used, 
460         %% as the default pedal-style for SostenutoPedal is 'mixed':
461         %% i.e.  Sost. Ped_____________________ 
462         pedalSostenutoStrings = #'("Sost. Ped." "*Sost. Ped." "*") 
463
464         tupletNumberFormatFunction = #denominator-tuplet-formatter
465         
466         subdivideBeams = ##f
467         allowBeamBreak = ##f
468         extraNatural = ##t
469         autoAccidentals = #'(Staff (same-octave . 0))
470         autoCautionaries = #'()  
471
472        keyAccidentalOrder = #'(
473          (6 . -1) (2  . -1) (5 . -1 ) (1  . -1) (4  . -1) (0  . -1) (3  . -1)
474          (3  . 1) (0 . 1) (4 . 1) (1 . 1) (5 . 1) (2 . 1) (6 . 1)
475          (6 . -2) (2  . -2) (5 . -2 ) (1  . -2) (4  . -2) (0  . -2) (3 . -2)
476          (3  . 2) (0 . 2) (4 . 2) (2 . 2) (5 . 2) (2 . 2) (6 . 2)
477         )
478         breakAlignOrder = #'(
479           instrument-name
480           left-edge
481           ambitus
482           span-bar
483           breathing-sign
484           clef
485           key-signature
486           staff-bar
487           time-signature
488           custos
489         )
490         barCheckSynchronize = ##t
491
492         %% chord names:
493         chordNameFunction = #ignatzek-chord-names
494         majorSevenSymbol = #whiteTriangleMarkup
495         chordNameSeparator = #(make-simple-markup  "/")
496         chordNameExceptions = #ignatzekExceptions
497         chordNoteNamer = #'()
498         chordRootNamer = #note-name->markup
499         
500         %% tablature:
501         stringOneTopmost = ##t
502         highStringOne = ##t
503
504         %% One may change the strings tuning as following :
505         %% The lenght of the list must be equal to the number of string
506         stringTunings   = #guitar-tunings
507         tablatureFormat = #fret-number-tablature-format
508
509         %%
510         bassFigureFormatFunction = #make-bass-figure-markup
511         metronomeMarkFormatter = #make-metronome-markup
512
513         \grobdescriptions #all-grob-descriptions
514 }
515
516 OrchestralScoreContext= \translator {
517         \ScoreContext
518 }
519
520 EasyNotation =  \translator {
521         \ScoreContext
522         NoteHead \override #'molecule-callback = #Note_head::brew_ez_molecule
523 }
524
525
526
527 FiguredBassContext = \translator {
528         \type "Engraver_group_engraver"
529         \name FiguredBass 
530         \consists "Figured_bass_engraver"
531         \consists "Rest_swallow_translator"
532         \consists "Note_swallow_translator"
533         \consists "Separating_line_group_engraver"
534         
535         \consistsend "Hara_kiri_engraver"
536 }
537
538 TabVoiceContext =   \translator {
539       \VoiceContext
540       \name "TabVoice"
541       \denies "Thread"
542       \consists "Tab_note_heads_engraver"
543
544       Slur \override #'font-family       = #'roman
545       Slur \override #'molecule-callback = #hammer-molecule-callback
546       Slur \override #'direction    = #-1
547
548       % Draws all stems/beams out of the staff (and not in the middle of the staff !)
549       % This feature is now disabled because most of the tab does not use it.
550       %Beam \override #'damping = #100000
551       %Stem \override #'up-to-staff = ##t
552
553       % No accidental in tablature !
554       \remove Accidental_engraver
555 }
556
557 TabStaffContext = \translator {
558       \StaffContext
559       \alias "Staff"
560       \name "TabStaff"
561       \denies "Voice"
562
563       \description "Context for generating tablature. [DOCME]"
564       
565       \accepts "TabVoice"
566       
567       % 6 strings
568       StaffSymbol \override #'line-count  = #6
569       StaffSymbol \override #'staff-space = #1.5
570
571      % Don't draw stems over the tablature figures !
572       Stem \override #'avoid-note-head = ##t
573       
574       % No accidental in tablature !
575       \remove Accidental_engraver
576       \remove Key_engraver
577
578       % Special "TAB" clef
579       clefGlyph = #"clefs-tab"
580       clefPosition = #0
581 }
582