5 % setup for Request->Element conversion. Guru-only
8 StaffContext
=\translator {
9 \type "Engraver_group_engraver"
12 \description "Handles clefs, bar lines, keys, accidentals. It can contain
13 @code{Voice} contexts."
16 \consists "Output_property_engraver"
18 \consists "Bar_engraver"
19 % Bar_engraver must be first so default bars aren't overwritten
21 \consists "Font_size_engraver"
23 % \consists "Repeat_engraver"
24 \consists "Volta_engraver"
25 \consists "Separating_line_group_engraver"
26 SeparatingGroupSpanner
\override #'spacing-procedure
27 = #Separating
_group
_spanner
::set
_spacing
_rods
_and
_seqs
28 \consists "Dot_column_engraver"
30 % perhaps move to Voice context?
31 \consists "Ottava_spanner_engraver"
32 \consists "Clef_engraver"
33 \consists "Key_engraver"
34 \consists "Time_signature_engraver"
35 \consists "Staff_symbol_engraver"
36 \consists "Collision_engraver"
37 \consists "Rest_collision_engraver"
38 \consists "Accidental_engraver"
39 \consists "Piano_pedal_engraver"
40 \consists "Instrument_name_engraver"
41 \consists "Grob_pq_engraver"
42 \consists "Forbid_line_break_engraver"
43 \consistsend "Axis_group_engraver"
45 minimumVerticalExtent
= #'(-
6 . 6)
46 extraVerticalExtent
= ##f
48 localKeySignature
= #'()
50 % explicitly set instrument, so we don't get
51 % weird effects when doing instrument names for
61 StaffContainerContext
= \translator {
62 \type Engraver
_group
_engraver
63 \consists "Axis_group_engraver"
64 minimumVerticalExtent
= ##f
65 extraVerticalExtent
= ##f
67 localKeySignature
= #'()
73 InnerChoirStaffContext
= \translator {
74 \type "Engraver_group_engraver"
76 \consists "System_start_delimiter_engraver"
77 systemStartDelimiter
= #'SystemStartBracket
78 localKeySignature
= #'()
81 \accepts "RhythmicStaff"
88 ChoirStaffContext
= \translator {
89 \InnerChoirStaffContext
92 \description "Identical to @code{StaffGroup} except that the
93 contained staves are not connected vertically."
95 \accepts "InnerChoirStaff"
96 \accepts "InnerStaffGroup"
100 RhythmicStaffContext
=\translator{
101 \type "Engraver_group_engraver"
103 \consists "Output_property_engraver"
106 A context like @code{Staff} but for printing rhythms. Pitches are
107 ignored; the notes are printed on one line.
109 minimumVerticalExtent
= ##f
110 extraVerticalExtent
= ##f
112 localKeySignature
= #'()
114 \consists "Pitch_squash_engraver"
115 \consists "Separating_line_group_engraver"
119 BarLine
\override #'bar-size
= #4
120 VoltaBracket
\override #'minimum-space
= #15 % urg, in \pt
121 VoltaBracket
\override #'padding
= #5 % urg, in \pt
122 StaffSymbol
\override #'line-count
= #1
124 Stem
\override #'neutral-direction
= #1
125 Beam
\override #'neutral-direction
= #1
126 % \consists "Repeat_engraver"
127 \consists "Dot_column_engraver"
128 \consists "Volta_engraver"
129 \consists "Bar_engraver"
130 \consists "Time_signature_engraver"
131 \consists "Staff_symbol_engraver"
132 \consists "Instrument_name_engraver"
133 \consistsend "Axis_group_engraver"
138 VoiceContext
= \translator {
139 \type "Engraver_group_engraver"
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.
147 You have to instantiate this explicitly if you want to have
148 multiple voices on the same staff."
150 localKeySignature
= #'()
151 \consists "Font_size_engraver"
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"
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"
177 Must come before text_engraver, but after note_column engraver.
180 \consists "Text_engraver"
181 \consists "Dynamic_engraver"
182 \consists "Fingering_engraver"
184 \consists "Script_engraver"
185 \consists "Script_column_engraver"
186 \consists "Rhythmic_column_engraver"
187 \consists "Phrasing_slur_engraver"
188 \consists "Cluster_spanner_engraver"
189 \consists "Slur_engraver"
190 \consists "Tie_engraver"
191 \consists "Tuplet_engraver"
192 \consists "A2_engraver"
194 \consists "Skip_event_swallow_translator"
195 \accepts Thread % bug if you leave out this!
198 ThreadContext = \translator{
199 \type Engraver_group_engraver
201 localKeySignature = #'()
203 Handles note heads, and is contained in the Voice context. You
204 have to instantiate this explicitly if you want to adjust the
205 style of individual note heads.
207 \consists "Font_size_engraver"
208 \consists "Thread_devnull_engraver"
209 \consists "Note_heads_engraver"
210 \consists "Rest_engraver"
213 \consists "Output_property_engraver"
218 GrandStaffContext=\translator{
219 \type "Engraver_group_engraver"
221 localKeySignature = #'()
223 \description " A group of staffs, with a brace on the left
224 side, grouping the staves together. The bar lines of the
225 contained staves are connected vertically. "
227 \consists "Span_bar_engraver"
228 \consists "Span_arpeggio_engraver"
229 \consists "System_start_delimiter_engraver"
230 systemStartDelimiter = #'SystemStartBrace
235 PianoStaffContext = \translator{
240 Just like @code{GrandStaff} but with @code{minVerticalAlign} set
241 equal to @code{maxVerticalAlign} so that interstaff beaming and
242 slurring can be used."
243 verticalAlignmentChildCallback = #Align_interface::fixed_distance_alignment_callback
244 VerticalAlignment \override #'forced-distance = #12
245 VerticalAlignment \override #'self-alignment-Y = #0
247 \consists "Vertical_align_engraver"
248 \consists "Instrument_name_engraver"
253 % \consistsend "Axis_group_engraver"
256 InnerStaffGroupContext= \translator {
257 \type "Engraver_group_engraver"
258 \name InnerStaffGroup
259 localKeySignature = #'()
261 \consists "Span_bar_engraver"
262 \consists "Span_arpeggio_engraver"
263 \consists "Output_property_engraver"
264 systemStartDelimiter = #'SystemStartBracket
266 \consists "System_start_delimiter_engraver"
268 \accepts "RhythmicStaff"
269 \accepts "GrandStaff"
270 \accepts "PianoStaff"
273 \accepts "ChordNames"
276 StaffGroupContext = \translator {
277 \InnerStaffGroupContext
282 " Groups staffs while adding a bracket on the left side,
283 grouping the staves together. The bar lines of the contained
284 staves are connected vertically.
287 \accepts "InnerChoirStaff"
288 \accepts "ChoirStaff"
289 \accepts "InnerStaffGroup"
290 \accepts "FiguredBass"
295 LyricsVoiceContext= \translator{
296 \type "Engraver_group_engraver"
297 \consistsend "Hara_kiri_engraver"
298 minimumVerticalExtent = #'(-1.2 . 2.4)
299 extraVerticalExtent = ##f
303 Corresponds to a voice with lyrics. Handles the printing of a
304 single line of lyrics.
308 \consists "Separating_line_group_engraver"
309 \consists "Lyric_engraver"
310 \consists "Extender_engraver"
311 \consists "Hyphen_engraver"
312 \consists "Stanza_number_engraver"
313 \consists "Skip_event_swallow_translator"
314 phrasingPunctuation = #".,:!?\""
315 SeparationItem \set #'padding = #0.5
317 NoteNamesContext = \translator {
318 \type "Engraver_group_engraver"
320 \consistsend "Axis_group_engraver"
322 minimumVerticalExtent = ##f
323 extraVerticalExtent = ##f
327 \consists "Note_name_engraver"
328 \consists "Separating_line_group_engraver"
331 LyricsContext = \translator {
332 \type "Engraver_group_engraver"
334 \description "Typesets lyrics."
335 %% To get folded repeats right.
336 \consists Vertical_align_engraver
338 % \consistsend "Hara_kiri_engraver"
339 minimumVerticalExtent = ##f
340 extraVerticalExtent = ##f
343 \accepts "LyricsVoice"
347 ChordNamesContext = \translator {
348 \type "Engraver_group_engraver"
350 \description "Typesets chord names."
352 \consists "Rest_swallow_translator"
353 \consists "Output_property_engraver"
354 \consists "Separating_line_group_engraver"
355 \consists "Chord_name_engraver"
356 \consists "Skip_event_swallow_translator"
357 \consistsend "Hara_kiri_engraver"
359 minimumVerticalExtent = #'(0 . 2.5)
360 extraVerticalExtent = ##f
365 RemoveEmptyStaffContext = \translator {
367 \remove "Axis_group_engraver"
368 \consistsend "Hara_kiri_engraver"
371 % hara kiri & auto knee don't work together.
372 Beam \override #'auto-knee-gap = #'()
375 RemoveEmptyStaffContext = \translator {
376 \RemoveEmptyStaffContext
377 \accepts "VaticanaVoice"
378 \accepts "GregorianTranscriptionVoice"
381 ScoreContext = \translator {
384 localKeySignature = #'()
386 \description "This is the top level notation context. No
387 other context can contain a @code{Score} context. This context
388 handles the administration of time signatures. It also makes sure
389 that items such as clefs, time signatures, and key-signatures are
390 aligned across staves.
392 You cannot explicitly instantiate a Score context (since it is
393 not contained in any other context). It is instantiated
394 automatically when an output definition (a @code{\score} or
395 @code{\paper} block) is processed."
397 \consists "Repeat_acknowledge_engraver"
398 \consists "Staff_collecting_engraver"
400 % move the alias along with the engraver.
402 %% TODO? add this alias from Timing_engraver::initialize() ?
403 \consists "Timing_engraver"
406 \consists "Output_property_engraver"
407 \consists "System_start_delimiter_engraver"
408 \consists "Mark_engraver"
409 \consists "Metronome_mark_engraver"
410 \consists "Break_align_engraver"
411 \consists "Spacing_engraver"
412 \consists "Vertical_align_engraver"
413 \consists "Lyric_phrasing_engraver"
414 \consists "Bar_number_engraver"
415 \consists "Span_arpeggio_engraver"
419 \accepts "VaticanaStaff"
420 \accepts "GregorianTranscriptionStaff"
421 \accepts "StaffContainer"
422 \accepts "StaffGroup"
423 \accepts "RhythmicStaff"
425 \accepts "ChordNames"
426 \accepts "GrandStaff"
427 \accepts "ChoirStaff"
428 \accepts "PianoStaff"
430 \accepts "FiguredBass"
433 soloIIText = #"Solo II"
436 splitInterval = #'(0 . 1)
437 changeMoment = #`(,(ly:make-moment 0 0) . ,(ly:make-moment 1 512))
438 systemStartDelimiter =#'SystemStartBar
440 melismaBusyProperties = #'(melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy)
442 clefGlyph = #"clefs-G"
444 centralCPosition = #-6
446 automaticPhrasing = ##t
447 automaticMelismata = ##t
449 defaultBarType = #"|"
450 barNumberVisibility = #default-bar-number-visibility
453 explicitClefVisibility = #all-visible
454 explicitKeySignatureVisibility = #all-visible
455 autoBeamSettings = #default-auto-beam-settings
457 scriptDefinitions = #default-script-alist
459 verticalAlignmentChildCallback = #Align_interface::alignment_callback
461 pedalSustainStrings = #'("Ped." "*Ped." "*")
462 pedalSustainStyle = #'text
463 pedalUnaCordaStrings = #'("una corda" "" "tre corde")
464 pedalUnaCordaStyle = #'text
466 %% These are in ordinary italic font, including the *,
467 %% but they are unlikely to be used,
468 %% as the default pedal-style for SostenutoPedal is 'mixed':
469 %% i.e. Sost. Ped_____________________
470 pedalSostenutoStrings = #'("Sost. Ped." "*Sost. Ped." "*")
471 pedalSostenutoStyle = #'mixed
473 fingeringOrientations = #'(up down)
474 tupletNumberFormatFunction = #denominator-tuplet-formatter
479 autoAccidentals = #'(Staff (same-octave . 0))
480 autoCautionaries = #'()
482 keyAccidentalOrder = #'(
483 (6 . -1) (2 . -1) (5 . -1 ) (1 . -1) (4 . -1) (0 . -1) (3 . -1)
484 (3 . 1) (0 . 1) (4 . 1) (1 . 1) (5 . 1) (2 . 1) (6 . 1)
485 (6 . -2) (2 . -2) (5 . -2 ) (1 . -2) (4 . -2) (0 . -2) (3 . -2)
486 (3 . 2) (0 . 2) (4 . 2) (2 . 2) (5 . 2) (2 . 2) (6 . 2)
488 breakAlignOrder = #'(
499 barCheckSynchronize = ##t
502 chordNameFunction = #ignatzek-chord-names
503 majorSevenSymbol = #whiteTriangleMarkup
504 chordNameSeparator = #(make-simple-markup "/")
505 chordNameExceptions = #ignatzekExceptions
506 chordNoteNamer = #'()
507 chordRootNamer = #note-name->markup
509 chordNameExceptionsFull = #fullJazzExceptions
510 chordNameExceptionsPartial = #partialJazzExceptions
513 stringOneTopmost = ##t
516 %% One may change the strings tuning as following :
517 %% The lenght of the list must be equal to the number of string
518 stringTunings = #guitar-tunings
519 tablatureFormat = #fret-number-tablature-format
522 bassFigureFormatFunction = #make-bass-figure-markup
523 metronomeMarkFormatter = #make-metronome-markup
527 (Voice Stem direction 1)
529 ;; TODO: should take from existing definition.
530 ;; c&p from define-grobs.scm
532 (Voice Stem lengths ,(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0)))
533 (Voice Stem stem-shorten (0.4 0))
534 (Voice Stem font-relative-size -1)
535 (Voice NoteHead font-relative-size -1)
536 (Voice Dots font-relative-size -1)
537 (Voice Stem beamed-lengths
538 ,(map (lambda (x) (* 0.8 x)) '(3.26)))
539 (Voice Stem beamed-minimum-free-lengths
540 ,(map (lambda (x) (* 0.8 x)) '(2.5 2.0 1.5)))
541 (Voice Stem beamed-extreme-minimum-free-lengths
542 ,(map (lambda (x) (* 0.8 x)) '(1.83 1.5)))
544 (Voice Stem no-stem-extend #t)
545 (Voice Beam thickness 0.384)
546 (Voice Beam space-function ,(lambda (beam mult)
547 (* 0.8 (Beam::space_function
549 (Voice Beam position-callbacks (,Beam::least_squares
551 ,Beam::slope_damping))
552 (Staff Accidental font-relative-size -2)
553 (Voice Slur direction -1)
556 \grobdescriptions #all-grob-descriptions
559 OrchestralScoreContext= \translator {
563 EasyNotation = \translator {
565 NoteHead \override #'molecule-callback = #Note_head::brew_ez_molecule
570 FiguredBassContext = \translator {
571 \type "Engraver_group_engraver"
573 \consists "Figured_bass_engraver"
574 \consists "Rest_swallow_translator"
575 \consists "Note_swallow_translator"
576 \consists "Separating_line_group_engraver"
578 \consistsend "Hara_kiri_engraver"
581 TabVoiceContext = \translator {
585 \consists "Tab_note_heads_engraver"
586 \remove "Fingering_engraver"
587 \remove "New_fingering_engraver"
589 Slur \override #'font-family = #'roman
590 Slur \override #'molecule-callback = #hammer-molecule-callback
591 Slur \override #'direction = #-1
593 % Draws all stems/beams out of the staff (and not in the middle of the staff !)
594 % This feature is now disabled because most of the tab does not use it.
595 %Beam \override #'damping = #100000
596 %Stem \override #'up-to-staff = ##t
598 % No accidental in tablature !
599 \remove Accidental_engraver
602 TabStaffContext = \translator {
608 \description "Context for generating tablature. [DOCME]"
613 StaffSymbol \override #'line-count = #6
614 StaffSymbol \override #'staff-space = #1.5
616 % Don't draw stems over the tablature figures !
617 Stem \override #'avoid-note-head = ##t
619 % No accidental in tablature !
620 \remove Accidental_engraver
624 clefGlyph = #"clefs-tab"
628 % TODO: Gregorian Chant contexts should be moved to gregorian-init.ly,
629 % but this does not work (is this a bug or intended behaviour?):
631 % If I try to do so, I get "error: unknown escaped string:
632 % `\VaticanaStaffContext'" in params-init.ly. If I also move
633 % "\translator { \Vaticana*Context }" from params-init.ly to the end
634 % of gregorian-init.ly, then I get "error: parse error, unexpected
635 % TRANSLATOR: \translator { \VaticanaStaffContext }" in
636 % gregorian-init.ly. --jr
638 VaticanaVoiceContext = \translator {
640 \name "VaticanaVoice"
642 \description "Same as @code{Voice} context, except that it is accommodated for tyepsetting Gregorian Chant in the notational style of Editio Vaticana."
644 % We can not remove Slur_engraver, since \addlyrics depends on it.
645 % Instead, we make the grob transparent.
646 % Unfortunately, this gives us a lot of warnings ("Degenerate bow:
647 % infinite steepness reqd"), since in ligatures, all note heads are in
648 % the same paper column such that the (transparent) slurs eventually may
649 % start and end in the same column.
650 Slur \override #'transparent = ##t
652 % We can not remove Stem_engraver, since slurs depend on stems. If
653 % we try anyway, lily will crash in slur.scm:16:6: "Wrong type argument
654 % in position 1 (expecting grob): ()".
655 % As a workaround, we make the grob transparent.
656 Stem \set #'transparent = ##t
658 % Since we do not remove stems, but only make it transparent, we have
659 % to set the length to 0.0. Otherwise, articulation marks (such as
660 % ictus, circulus or accentus) may be vertically placed quite away from
662 Stem \set #'length = #'0.0
664 \remove "Ligature_bracket_engraver"
665 \consists "Vaticana_ligature_engraver"
667 % Set default head for notes outside of \[ \].
668 NoteHead \set #'style = #'vaticana_punctum
670 % Put some space before and after divisiones.
671 % FIXME: This does not seem to show any effect.
672 Script \set #'padding = #0.5
674 % There are no beams in Gregorian Chant notation.
677 % Prepare TextSpanner for \episem{Initium|Finis} use.
678 TextSpanner \set #'style = #'line
679 TextSpanner \set #'edge-height = #'(0 . 0)
680 TextSpanner \set #'padding = #0.5
681 TextSpanner \set #'enclose-bounds = ##t
682 TextSpanner \set #'edge-text = #'("" . "")
685 VaticanaStaffContext = \translator {
687 \name "VaticanaStaff"
690 \accepts "VaticanaVoice"
691 \description "Same as @code{Staff} context, except that it is accommodated for tyepsetting Gregorian Chant in the notational style of Editio Vaticana."
693 \remove "Time_signature_engraver"
694 \consists "Custos_engraver"
696 % We can not remove Bar_engraver; otherwise clefs and custodes will
697 % not show up any more among other line breaking issues.
698 % Instead, we make the grob transparent.
699 BarLine \set #'transparent = ##t
701 StaffSymbol \set #'line-count = #4
702 StaffSymbol \set #'thickness = #0.6
704 % FIXME: unit on StaffSymbol's width should be \linewidth.
705 % StaffSymbol \set #'width = #60.0
707 % Choose vaticana do clef on 3rd line as default.
708 clefGlyph = #"clefs-vaticana_do"
709 centralCPosition = #1
713 % Select vaticana style font.
714 KeySignature \set #'style = #'vaticana
715 Accidental \set #'style = #'vaticana
716 Custos \set #'style = #'vaticana
717 Custos \set #'neutral-position = #3
718 Custos \set #'neutral-direction = #-1
719 Custos \set #'adjust-if-on-staffline = ##t
722 % Score.barAlways = ##t
725 GregorianTranscriptionVoiceContext = \translator {
727 \name "GregorianTranscriptionVoice"
730 % Removing ligature bracket engraver without replacing it by some
731 % other ligature engraver would cause a "Junking event: `LigatureEvent'"
732 % warning for every "\[" and "\]". Therefore, we make the grob
733 % transparent instead.
734 LigatureBracket \set #'transparent = ##t
736 % We can not remove Slur_engraver, since \addlyrics depends on it.
737 % Instead, we make the grob transparent.
738 % Unfortunately, this gives us a lot of warnings ("Degenerate bow:
739 % infinite steepness reqd"), since in ligatures, all note heads are in
740 % the same paper column such that the (transparent) slurs eventually may
741 % start and end in the same column.
742 Slur \override #'transparent = ##t
744 % We can not remove Stem_engraver, since slurs depend on stems. If
745 % we try anyway, lily will crash in slur.scm:16:6: "Wrong type argument
746 % in position 1 (expecting grob): ()".
747 % As a workaround, we make the grob transparent.
748 Stem \set #'transparent = ##t
750 % Since we do not remove stems, but only make it transparent, we have
751 % to set the length to 0.0. Otherwise, articulation marks (such as
752 % ictus, circulus or accentus) may be vertically placed quite away from
754 Stem \set #'length = #'0.0
756 % Put some space before and after divisiones.
757 % FIXME: This does not seem to show any effect.
758 Script \set #'padding = #0.5
760 % There are no beams in Gregorian Chant notation.
763 % Prepare TextSpanner for \episem{Initium|Finis} use.
764 TextSpanner \set #'style = #'line
765 TextSpanner \set #'edge-height = #'(0 . 0)
766 TextSpanner \set #'padding = #0.5
767 TextSpanner \set #'enclose-bounds = ##t
768 TextSpanner \set #'edge-text = #'("" . "")
771 GregorianTranscriptionStaffContext = \translator {
773 \name "GregorianTranscriptionStaff"
776 \accepts "GregorianTranscriptionVoice"
778 % We can not remove Bar_engraver; otherwise clefs and custodes will
779 % not show up any more among other line breaking issues.
780 % Instead, we make the grob transparent.
781 BarLine \set #'transparent = ##t