X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ly%2Fengraver-init.ly;h=0b2a4479028ada041961dd98beaac68d79413eed;hb=fedb5fe3fe4dda3c89c29af07a7b92cecd6eac70;hp=4b9421e64797689c61c579e29953ae13c9e4faab;hpb=1aeb5031376f96ee3407989e7696e5c106d27ee0;p=lilypond.git diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 4b9421e647..0b2a447902 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -1,30 +1,28 @@ -\version "2.1.19" +\version "2.3.2" +\context { + \name Global -% -% setup for Request->Element conversion. Guru-only -% + \accepts Score + \description "Hard coded entry point for LilyPond. Cannot be tuned." + \grobdescriptions #all-grob-descriptions +} -\translator { +\context { \type "Engraver_group_engraver" \name Staff - \description "Handles clefs, bar lines, keys, accidentals. It can contain -@code{Voice} contexts." - \consists "Output_property_engraver" \consists "Bar_engraver" % Bar_engraver must be first so default bars aren't overwritten % with empty ones. + \consists "Font_size_engraver" - -% \consists "Repeat_engraver" + \consists "Volta_engraver" \consists "Separating_line_group_engraver" - SeparatingGroupSpanner \override #'spacing-procedure - = #Separating_group_spanner::set_spacing_rods_and_seqs \consists "Dot_column_engraver" % perhaps move to Voice context? @@ -38,8 +36,6 @@ \consists "Accidental_engraver" \consists "Piano_pedal_engraver" \consists "Instrument_name_engraver" - \consists "Grob_pq_engraver" - \consists "Forbid_line_break_engraver" \consists "String_number_engraver" \consistsend "Axis_group_engraver" @@ -47,7 +43,8 @@ extraVerticalExtent = ##f verticalExtent = ##f localKeySignature = #'() - + createSpacing = ##t + % explicitly set instrument, so we don't get % weird effects when doing instrument names for % piano staves @@ -56,10 +53,13 @@ instr = #'() \accepts "Voice" + \description "Handles clefs, bar lines, keys, accidentals. It can contain +@code{Voice} contexts." + } -\translator { - \StaffContext +\context { + \Staff \type "Engraver_group_engraver" \name DrumStaff \alias Staff @@ -77,76 +77,60 @@ clefGlyph = #"clefs-percussion" clefPosition = #0 - Script \set #'staff-padding = #0.75 + \override Script #'staff-padding = #0.75 } -\translator { - \type Engraver_group_engraver - \consists "Axis_group_engraver" - minimumVerticalExtent = ##f - extraVerticalExtent = ##f - verticalExtent = ##f - localKeySignature = #'() - - \accepts Staff - \name StaffContainer -} - -\translator { +\context { \type "Engraver_group_engraver" \name InnerChoirStaff \consists "System_start_delimiter_engraver" systemStartDelimiter = #'SystemStartBracket - localKeySignature = #'() \accepts "Staff" \accepts "DrumStaff" \accepts "RhythmicStaff" \accepts "GrandStaff" \accepts "PianoStaff" - \accepts "LyricsVoice" + \accepts "Lyrics" \accepts "ChordNames" } -\translator { - \InnerChoirStaffContext +\context { + \InnerChoirStaff \name ChoirStaff + \accepts "InnerChoirStaff" + \accepts "InnerStaffGroup" \description "Identical to @code{StaffGroup} except that the contained staves are not connected vertically." - \accepts "InnerChoirStaff" - \accepts "InnerStaffGroup" } -\translator{ +\context{ \type "Engraver_group_engraver" \consists "Output_property_engraver" - \description " - A context like @code{Staff} but for printing rhythms. Pitches are - ignored; the notes are printed on one line. -" minimumVerticalExtent = ##f extraVerticalExtent = ##f verticalExtent = ##f localKeySignature = #'() \consists "Pitch_squash_engraver" + squashedPosition = #0 \consists "Separating_line_group_engraver" \name RhythmicStaff \alias "Staff" - BarLine \override #'bar-size = #4 - VoltaBracket \override #'minimum-space = #15 - VoltaBracket \override #'padding = #5 - StaffSymbol \override #'line-count = #1 + \override BarLine #'bar-size = #4 + \override VoltaBracket #'minimum-space = #15 + \override VoltaBracket #'padding = #5 + \override StaffSymbol #'line-count = #1 - Stem \override #'neutral-direction = #1 - Beam \override #'neutral-direction = #1 + \override Stem #'neutral-direction = #1 + \override Beam #'neutral-direction = #1 % \consists "Repeat_engraver" \consists "Dot_column_engraver" \consists "Volta_engraver" @@ -156,10 +140,14 @@ \consists "Instrument_name_engraver" \consistsend "Axis_group_engraver" \accepts "Voice" + \description " + A context like @code{Staff} but for printing rhythms. Pitches are + ignored; the notes are printed on one line. +" } -\translator { +\context { \type "Engraver_group_engraver" \name Voice @@ -179,6 +167,7 @@ \consists "Multi_measure_rest_engraver" \consists "Text_spanner_engraver" \consists "Grob_pq_engraver" + \consists "Forbid_line_break_engraver" \consists "Note_head_line_engraver" \consists "Glissando_engraver" @@ -196,7 +185,7 @@ \consists "Chord_tremolo_engraver" \consists "Percent_repeat_engraver" \consists "Slash_repeat_engraver" - \consists "Melisma_engraver" + \consists "Melisma_translator" \consists "Part_combine_engraver" %{ @@ -219,14 +208,12 @@ \consists "Skip_event_swallow_translator" } -\translator { - \VoiceContext +\context { + \Voice \name DrumVoice \alias Voice - \description " A voice on a percussion staff." - - + \description "A voice on a percussion staff." \remove "Arpeggio_engraver" \consists "Multi_measure_rest_engraver" \consists "Text_spanner_engraver" @@ -242,15 +229,13 @@ \remove "Fingering_engraver" - \remove "Phrasing_slur_engraver" \remove "Cluster_spanner_engraver" - \remove "Slur_engraver" \consists "Tuplet_engraver" \consists "Skip_event_swallow_translator" } -\translator{ +\context{ \type "Engraver_group_engraver" \name GrandStaff localKeySignature = #'() @@ -267,8 +252,8 @@ \accepts "Staff" } -\translator{ - \GrandStaffContext +\context{ + \GrandStaff \name "PianoStaff" \alias "GrandStaff" @@ -277,8 +262,8 @@ the staves, so cross staff beaming and slurring can be used." verticalAlignmentChildCallback = #Align_interface::fixed_distance_alignment_callback - VerticalAlignment \override #'forced-distance = #12 - VerticalAlignment \override #'self-alignment-Y = #0 + \override VerticalAlignment #'forced-distance = #12 + \override VerticalAlignment #'self-alignment-Y = #0 \consists "Vertical_align_engraver" \consists "Instrument_name_engraver" @@ -287,10 +272,9 @@ instr = #'() } -\translator { +\context { \type "Engraver_group_engraver" \name InnerStaffGroup - localKeySignature = #'() \consists "Span_bar_engraver" \consists "Span_arpeggio_engraver" @@ -304,12 +288,12 @@ \accepts "GrandStaff" \accepts "PianoStaff" \accepts "TabStaff" - \accepts "LyricsVoice" + \accepts "Lyrics" \accepts "ChordNames" } -\translator { - \InnerStaffGroupContext +\context { + \InnerStaffGroup \name StaffGroup \description @@ -325,7 +309,7 @@ connected vertically. " } -\translator{ +\context{ \type "Engraver_group_engraver" \consistsend "Hara_kiri_engraver" minimumVerticalExtent = #'(-1.2 . 2.4) @@ -335,7 +319,7 @@ connected vertically. " \description " Corresponds to a voice with lyrics. Handles the printing of a single line of lyrics. " - \name LyricsVoice + \name Lyrics \consists "Separating_line_group_engraver" \consists "Lyric_engraver" \consists "Extender_engraver" @@ -343,10 +327,11 @@ printing of a single line of lyrics. " \consists "Stanza_number_engraver" \consists "Vocal_name_engraver" \consists "Skip_event_swallow_translator" - SeparationItem \set #'padding = #0.5 + \consists "Font_size_engraver" + \override SeparationItem #'padding = #0.2 } -\translator { +\context { \type "Engraver_group_engraver" \name NoteNames \consistsend "Axis_group_engraver" @@ -359,12 +344,11 @@ printing of a single line of lyrics. " \consists "Rest_swallow_translator" \consists "Skip_event_swallow_translator" \consists "Tie_engraver" - \consists "Note_swallow_translator" \consists "Note_name_engraver" \consists "Separating_line_group_engraver" } -\translator { +\context { \type "Engraver_group_engraver" \name ChordNames \description "Typesets chord names." @@ -378,22 +362,19 @@ printing of a single line of lyrics. " minimumVerticalExtent = #'(0 . 2.5) extraVerticalExtent = ##f - SeparatingGroupSpanner \override #'padding = #0.8 + \override SeparatingGroupSpanner #'padding = #0.8 verticalExtent = ##f } -RemoveEmptyStaffContext= \translator { - \StaffContext +RemoveEmptyStaffContext= \context { + \Staff \remove "Axis_group_engraver" \consistsend "Hara_kiri_engraver" - \accepts "Voice" - - % hara kiri & auto knee don't work together. - Beam \override #'auto-knee-gap = #'() + \override Beam #'auto-knee-gap = #'() } -AncientRemoveEmptyStaffContext = \translator { +AncientRemoveEmptyStaffContext = \context { %% why not add by default? \RemoveEmptyStaffContext @@ -401,10 +382,9 @@ AncientRemoveEmptyStaffContext = \translator { \accepts "GregorianTranscriptionVoice" } -\translator { +\context { \type Score_engraver \name Score - localKeySignature = #'() \description "This is the top level notation context. No other context can contain a @code{Score} context. This context @@ -422,9 +402,7 @@ AncientRemoveEmptyStaffContext = \translator { % move the alias along with the engraver. - %% TODO? add this alias from Timing_engraver::initialize() ? \consists "Timing_engraver" - \alias "Timing" \consists "Output_property_engraver" \consists "System_start_delimiter_engraver" @@ -433,7 +411,7 @@ AncientRemoveEmptyStaffContext = \translator { \consists "Break_align_engraver" \consists "Spacing_engraver" \consists "Vertical_align_engraver" - \consists "Lyric_phrasing_engraver" + \consists "Stanza_number_align_engraver" \consists "Bar_number_engraver" \consists "Span_arpeggio_engraver" @@ -441,11 +419,10 @@ AncientRemoveEmptyStaffContext = \translator { \accepts "TabStaff" \accepts "VaticanaStaff" \accepts "GregorianTranscriptionStaff" - \accepts "StaffContainer" \accepts "StaffGroup" \accepts "RhythmicStaff" \accepts "DrumStaff" - \accepts "LyricsVoice" + \accepts "Lyrics" \accepts "ChordNames" \accepts "GrandStaff" \accepts "ChoirStaff" @@ -466,7 +443,7 @@ AncientRemoveEmptyStaffContext = \translator { clefGlyph = #"clefs-G" clefPosition = #-2 - centralCPosition = #-6 + middleCPosition = #-6 defaultBarType = #"|" barNumberVisibility = #default-bar-number-visibility @@ -492,6 +469,8 @@ AncientRemoveEmptyStaffContext = \translator { pedalSostenutoStrings = #'("Sost. Ped." "*Sost. Ped." "*") pedalSostenutoStyle = #'mixed + + harmonicAccidentals = ##t fingeringOrientations = #'(up down) tupletNumberFormatFunction = #denominator-tuplet-formatter markFormatter = #format-mark-letters @@ -502,24 +481,26 @@ AncientRemoveEmptyStaffContext = \translator { autoAccidentals = #'(Staff (same-octave . 0)) autoCautionaries = #'() + printKeyCancellation = ##t keyAccidentalOrder = #`( (6 . ,FLAT) (2 . ,FLAT) (5 . ,FLAT ) (1 . ,FLAT) (4 . ,FLAT) (0 . ,FLAT) (3 . ,FLAT) (3 . ,SHARP) (0 . ,SHARP) (4 . ,SHARP) (1 . ,SHARP) (5 . ,SHARP) (2 . ,SHARP) (6 . ,SHARP) (6 . ,DOUBLE-FLAT) (2 . ,DOUBLE-FLAT) (5 . ,DOUBLE-FLAT ) (1 . ,DOUBLE-FLAT) (4 . ,DOUBLE-FLAT) (0 . ,DOUBLE-FLAT) (3 . ,DOUBLE-FLAT) (3 . ,DOUBLE-SHARP) (0 . ,DOUBLE-SHARP) (4 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (5 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (6 . ,DOUBLE-SHARP) ) - breakAlignOrder = #'( - instrument-name - left-edge - ambitus - breathing-sign - clef - rehearsal-mark - staff-bar - key-signature - time-signature - custos - ) + + %{ + + this order is more complex, see wansek p254 and further. + + for instance, order of clef and :|: depends on function of the clef + + (clef of start-repeat) :|: (change-clef) + + is the proper order. + + %} + barCheckSynchronize = ##f %% chord names: @@ -538,15 +519,14 @@ AncientRemoveEmptyStaffContext = \translator { %% One may change the strings tuning as following : %% The lenght of the list must be equal to the number of string - stringTunings = #guitar-tunings + stringTunings = #guitar-tunings tablatureFormat = #fret-number-tablature-format %% - bassFigureFormatFunction = #make-bass-figure-markup + bassFigureFormatFunction = #format-bass-figure metronomeMarkFormatter = #format-metronome-markup graceSettings = #`#( (Voice Stem direction 1) - ;; TODO: should take from existing definition. ;; c&p from define-grobs.scm @@ -556,7 +536,7 @@ AncientRemoveEmptyStaffContext = \translator { (Voice NoteHead font-size -3) (Voice Dots font-size -3) (Voice Stem beamed-lengths - ,(map (lambda (x) (* 0.8 x)) '(3.26))) + ,(map (lambda (x) (* 0.8 x)) '(3.3 3.3 4.0))) (Voice Stem beamed-minimum-free-lengths ,(map (lambda (x) (* 0.8 x)) '(2.5 2.0 1.5))) (Voice Stem beamed-extreme-minimum-free-lengths @@ -567,54 +547,46 @@ AncientRemoveEmptyStaffContext = \translator { (Voice Beam space-function ,(lambda (beam mult) (* 0.8 (Beam::space_function beam mult)))) - (Voice Beam position-callbacks (,Beam::least_squares - ,Beam::check_concave - ,Beam::slope_damping)) - (Staff Accidental font-size -4) + (Voice Accidental font-size -4) (Voice Slur direction -1) ) - \grobdescriptions #all-grob-descriptions -} - -OrchestralScoreContext = \translator { - \ScoreContext } -EasyNotation = \translator { - \ScoreContext - NoteHead \override #'molecule-callback = #Note_head::brew_ez_molecule - NoteHead \override #'Y-extent-callback = #'() - NoteHead \override #'X-extent-callback = #'() +EasyNotation = \context { % TODO: why \context override? + \Score + \override NoteHead #'print-function = #Note_head::brew_ez_stencil + \override NoteHead #'Y-extent-callback = #'() + \override NoteHead #'X-extent-callback = #'() } -\translator { +\context { \type "Engraver_group_engraver" \name FiguredBass \consists "Figured_bass_engraver" \consists "Rest_swallow_translator" \consists "Note_swallow_translator" + \consists "Skip_event_swallow_translator" \consists "Separating_line_group_engraver" \consistsend "Hara_kiri_engraver" } -\translator { +\context { \name "Devnull" \type "Engraver_group_engraver" %% don't want to route anything out of here: \alias "Staff" - \alias "Timing" \alias "Voice" \consists "Swallow_engraver" \description "Silently discards all musical information given to this context. " } -\translator { - \VoiceContext +\context { + \Voice \name "TabVoice" \consists "Tab_note_heads_engraver" \remove "Note_heads_engraver" @@ -622,42 +594,36 @@ EasyNotation = \translator { \remove "New_fingering_engraver" \description "Context for drawing notes in a Tab staff. " - Slur \override #'font-family = #'roman - Slur \override #'molecule-callback = #hammer-molecule-callback - Slur \override #'direction = #-1 + \override Slur #'font-family = #'roman + \override Slur #'print-function = #hammer-print-function + \override Slur #'direction = #-1 % Draws all stems/beams out of the staff (and not in the middle of the staff !) % This feature is now disabled because most of the tab does not use it. - %Beam \override #'damping = #100000 - %Stem \override #'up-to-staff = ##t + %\override Beam #'damping = #100000 + %\override Stem #'up-to-staff = ##t % No accidental in tablature ! \remove Accidental_engraver } -\translator { - \StaffContext +\context { + \Staff \alias "Staff" \name "TabStaff" \denies "Voice" - + \remove "Staff_symbol_engraver" + \consists "Tab_staff_symbol_engraver" + \description "Context for generating tablature. [DOCME]" -%{ - TODO: this context should use a special staff_symbol engraver that - takes the line count out of the stringTunings property. - -%} - - \accepts "TabVoice" % 6 strings - StaffSymbol \override #'line-count = #6 - StaffSymbol \override #'staff-space = #1.5 + \override StaffSymbol #'staff-space = #1.5 % Don't draw stems over the tablature figures ! - Stem \override #'avoid-note-head = ##t + \override Stem #'avoid-note-head = ##t % No accidental in tablature ! \remove "Accidental_engraver" @@ -672,14 +638,14 @@ EasyNotation = \translator { % but this does not work (is this a bug or intended behaviour?): % % If I try to do so, I get "error: unknown escaped string: -% `\VaticanaStaffContext'" in params-init.ly. If I also move -% "\translator { \Vaticana*Context }" from params-init.ly to the end +% `\VaticanaStaff'" in params-init.ly. If I also move +% "\context { \Vaticana*Context }" from params-init.ly to the end % of gregorian-init.ly, then I get "error: parse error, unexpected -% TRANSLATOR: \translator { \VaticanaStaffContext }" in +% TRANSLATOR: \context { \VaticanaStaff }" in % gregorian-init.ly. --jr -\translator { - \VoiceContext +\context { + \Voice \name "VaticanaVoice" \alias "Voice" \description "Same as @code{Voice} context, except that it is accommodated for tyepsetting Gregorian Chant in the notational style of Editio Vaticana." @@ -690,25 +656,25 @@ EasyNotation = \translator { \consists "Vaticana_ligature_engraver" % Set default head for notes outside of \[ \]. - NoteHead \set #'style = #'vaticana_punctum + \override NoteHead #'style = #'vaticana_punctum % Put some space before and after divisiones. % FIXME: This does not seem to show any effect. - Script \set #'padding = #0.5 + \override Script #'padding = #0.5 % There are no beams in Gregorian Chant notation. autobeaming = ##f % Prepare TextSpanner for \episem{Initium|Finis} use. - TextSpanner \set #'style = #'line - TextSpanner \set #'edge-height = #'(0 . 0) - TextSpanner \set #'padding = #0.5 - TextSpanner \set #'enclose-bounds = #1 - TextSpanner \set #'edge-text = #'("" . "") + \override TextSpanner #'style = #'line + \override TextSpanner #'edge-height = #'(0 . 0) + \override TextSpanner #'padding = #0.5 + \override TextSpanner #'enclose-bounds = #1 + \override TextSpanner #'edge-text = #'("" . "") } -\translator { - \StaffContext +\context { + \Staff \name "VaticanaStaff" \alias "Staff" \denies "Voice" @@ -721,34 +687,33 @@ EasyNotation = \translator { % We can not remove Bar_engraver; otherwise clefs and custodes will % not show up any more among other line breaking issues. % Instead, we make the grob transparent. - BarLine \set #'transparent = ##t + \override BarLine #'transparent = ##t - StaffSymbol \set #'line-count = #4 - StaffSymbol \set #'thickness = #0.6 + \override StaffSymbol #'line-count = #4 + \override StaffSymbol #'thickness = #0.6 % FIXME: unit on StaffSymbol's width should be \linewidth. - % StaffSymbol \set #'width = #60.0 + % \override StaffSymbol #'width = #60.0 % Choose vaticana do clef on 3rd line as default. clefGlyph = #"clefs-vaticana_do" - centralCPosition = #1 + middleCPosition = #1 clefPosition = #1 clefOctavation = #0 % Select vaticana style font. - KeySignature \set #'style = #'vaticana - Accidental \set #'style = #'vaticana - Custos \set #'style = #'vaticana - Custos \set #'neutral-position = #3 - Custos \set #'neutral-direction = #-1 - Custos \set #'adjust-if-on-staffline = ##t + \override KeySignature #'style = #'vaticana + \override Accidental #'style = #'vaticana + \override Custos #'style = #'vaticana + \override Custos #'neutral-position = #3 + \override Custos #'neutral-direction = #-1 % Score.timing = ##f % Score.barAlways = ##t } -\translator { - \VoiceContext +\context { + \Voice \name "GregorianTranscriptionVoice" \alias "Voice" @@ -756,24 +721,24 @@ EasyNotation = \translator { % other ligature engraver would cause a "Junking event: `LigatureEvent'" % warning for every "\[" and "\]". Therefore, we make the grob % transparent instead. - LigatureBracket \set #'transparent = ##t + \override LigatureBracket #'transparent = ##t % Put some space before and after divisiones. % FIXME: This does not seem to show any effect. - Script \set #'padding = #0.5 + \override Script #'padding = #0.5 % There are no beams in Gregorian Chant notation. autobeaming = ##f % Prepare TextSpanner for \episem{Initium|Finis} use. - TextSpanner \set #'style = #'line - TextSpanner \set #'edge-height = #'(0 . 0) - TextSpanner \set #'padding = #0.5 - TextSpanner \set #'enclose-bounds = #1 - TextSpanner \set #'edge-text = #'("" . "") + \override TextSpanner #'style = #'line + \override TextSpanner #'edge-height = #'(0 . 0) + \override TextSpanner #'padding = #0.5 + \override TextSpanner #'enclose-bounds = #1 + \override TextSpanner #'edge-text = #'("" . "") } - \translator { - \StaffContext + \context { + \Staff \name "GregorianTranscriptionStaff" \alias "Staff" \denies "Voice" @@ -782,5 +747,5 @@ EasyNotation = \translator { % We can not remove Bar_engraver; otherwise clefs and custodes will % not show up any more among other line breaking issues. % Instead, we make the grob transparent. - BarLine \set #'transparent = ##t + \override BarLine #'transparent = ##t }