]> git.donarmstrong.com Git - lilypond.git/blobdiff - ly/engraver-init.ly
* input/test/ambitus-mixed.ly (texidoc): new file.
[lilypond.git] / ly / engraver-init.ly
index 25e2ad92e5ba22f94e44e906f41dc0666fbfed94..be3dda204cc69df90ae726e82cc102a6e4861055 100644 (file)
@@ -1,5 +1,4 @@
-\version "1.7.18"
-
+\version "1.9.1"
 
 
 %
@@ -189,7 +188,6 @@ VoiceContext = \translator {
        \consists "Cluster_spanner_engraver"
        \consists "Slur_engraver"
        \consists "Tie_engraver"
-       \consists "New_tie_engraver"
        \consists "Tuplet_engraver"
        \consists "A2_engraver"
 
@@ -213,7 +211,6 @@ ThreadContext = \translator{
 
        % why here ? 
        \consists "Output_property_engraver"    
-
 }
 
 
@@ -338,7 +335,7 @@ LyricsContext = \translator {
        %% To get folded repeats right.
        \consists Vertical_align_engraver 
 
-       \consistsend "Hara_kiri_engraver"
+%      \consistsend "Hara_kiri_engraver"
        minimumVerticalExtent = ##f
        extraVerticalExtent = ##f
        verticalExtent = ##f 
@@ -350,7 +347,7 @@ LyricsContext = \translator {
 ChordNamesContext = \translator {
        \type "Engraver_group_engraver"
        \name ChordNames
-\description "    Typesets chord names."
+       \description "Typesets chord names."
        
        \consists "Rest_swallow_translator" 
        \consists "Output_property_engraver"    
@@ -358,6 +355,7 @@ ChordNamesContext = \translator {
        \consists "Chord_name_engraver"
        \consists "Skip_event_swallow_translator"
        \consistsend "Hara_kiri_engraver"
+       
        minimumVerticalExtent = #'(0 . 2.5)
        extraVerticalExtent = ##f
        verticalExtent = ##f 
@@ -368,14 +366,17 @@ RemoveEmptyStaffContext = \translator {
        \StaffContext
        \remove "Axis_group_engraver"
        \consistsend "Hara_kiri_engraver"
-       \consists "Instrument_name_engraver"
        \accepts "Voice"
 
        % hara kiri & auto knee don't work together.
        Beam \override #'auto-knee-gap = #'()
 }
 
-HaraKiriStaffContext = \translator { \RemoveEmptyStaffContext }
+RemoveEmptyStaffContext = \translator {
+       \RemoveEmptyStaffContext
+       \accepts "VaticanaVoice"
+       \accepts "GregorianTranscriptionVoice"
+}
 
 ScoreContext = \translator {
        \type Score_engraver
@@ -415,16 +416,18 @@ ScoreContext = \translator {
 
        \accepts "Staff"
        \accepts "TabStaff"
+       \accepts "VaticanaStaff"
+       \accepts "GregorianTranscriptionStaff"
        \accepts "StaffContainer"
        \accepts "StaffGroup"
-       \accepts "RhythmicStaff"        
+       \accepts "RhythmicStaff"
        \accepts "Lyrics"
        \accepts "ChordNames"
        \accepts "GrandStaff"
        \accepts "ChoirStaff"
        \accepts "PianoStaff"
        \accepts "NoteNames"
-       \accepts "FiguredBass"  
+       \accepts "FiguredBass"
 
        soloText = #"Solo"
        soloIIText = #"Solo II"
@@ -466,7 +469,7 @@ ScoreContext = \translator {
        pedalSostenutoStrings = #'("Sost. Ped." "*Sost. Ped." "*") 
        pedalSostenutoStyle = #'mixed
 
-       
+       fingeringOrientations = #'(up down)
        tupletNumberFormatFunction = #denominator-tuplet-formatter
        
        subdivideBeams = ##f
@@ -493,7 +496,7 @@ ScoreContext = \translator {
          custos
        )
        barCheckSynchronize = ##t
-
+       
        %% chord names:
        chordNameFunction = #ignatzek-chord-names
        majorSevenSymbol = #whiteTriangleMarkup
@@ -518,6 +521,37 @@ ScoreContext = \translator {
        bassFigureFormatFunction = #make-bass-figure-markup
        metronomeMarkFormatter = #make-metronome-markup
 
+
+       graceSettings = #`#(
+                (Voice Stem direction 1)
+
+                ;; TODO: should take from existing definition.
+                ;; c&p from define-grobs.scm
+                
+                (Voice Stem lengths ,(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0)))
+                (Voice Stem stem-shorten (0.4 0))
+                (Voice Stem font-relative-size -1)
+                (Voice NoteHead font-relative-size -1)
+                (Voice Dots font-relative-size -1)
+                (Voice Stem beamed-lengths  
+                 ,(map (lambda (x) (* 0.8 x)) '(3.26)))
+                (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  
+                 ,(map (lambda (x) (* 0.8 x)) '(1.83 1.5)))
+
+                (Voice Stem no-stem-extend #t)
+                (Voice Beam thickness 0.384)
+                (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-relative-size -2)
+                (Voice Slur direction -1)
+       )
+       
        \grobdescriptions #all-grob-descriptions
 }
 
@@ -589,4 +623,159 @@ TabStaffContext = \translator {
       clefGlyph = #"clefs-tab"
       clefPosition = #0
 }
-   
+
+% TODO: Gregorian Chant contexts should be moved to gregorian-init.ly,
+% 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
+% of gregorian-init.ly, then I get "error: parse error, unexpected
+% TRANSLATOR: \translator { \VaticanaStaffContext }" in
+% gregorian-init.ly. --jr
+
+VaticanaVoiceContext = \translator {
+  \VoiceContext
+  \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."
+
+  % We can not remove Slur_engraver, since \addlyrics depends on it.
+  % Instead, we make the grob transparent.
+  % Unfortunately, this gives us a lot of warnings ("Degenerate bow:
+  % infinite steepness reqd"), since in ligatures, all note heads are in
+  % the same paper column such that the (transparent) slurs eventually may
+  % start and end in the same column.
+  Slur \override #'transparent = ##t
+
+  % We can not remove Stem_engraver, since slurs depend on stems.  If
+  % we try anyway, lily will crash in slur.scm:16:6: "Wrong type argument
+  % in position 1 (expecting grob): ()".
+  % As a workaround, we make the grob transparent.
+  Stem \set #'transparent = ##t
+
+  % Since we do not remove stems, but only make it transparent, we have
+  % to set the length to 0.0.  Otherwise, articulation marks (such as
+  % ictus, circulus or accentus) may be vertically placed quite away from
+  % the note head.
+  Stem \set #'length = #'0.0
+
+  \remove "Ligature_bracket_engraver"
+  \consists "Vaticana_ligature_engraver"
+
+  % Set default head for notes outside of \[ \].
+  NoteHead \set #'style = #'vaticana_punctum
+
+  % Put some space before and after divisiones.
+  % FIXME: This does not seem to show any effect.
+  Script \set #'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 = ##t
+  TextSpanner \set #'edge-text = #'("" . "")
+}
+
+VaticanaStaffContext = \translator {
+  \StaffContext
+  \name "VaticanaStaff"
+  \alias "Staff"
+  \denies "Voice"
+  \accepts "VaticanaVoice"
+  \description "Same as @code{Staff} context, except that it is accommodated for tyepsetting Gregorian Chant in the notational style of Editio Vaticana."
+
+  \remove "Time_signature_engraver"
+  \consists "Custos_engraver"
+
+  % 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
+
+  StaffSymbol \set #'line-count = #4
+  StaffSymbol \set #'thickness = #0.6
+
+  % FIXME: unit on StaffSymbol's width should be \linewidth.
+  % StaffSymbol \set #'width = #60.0
+
+  % Choose vaticana do clef on 3rd line as default.
+  clefGlyph = #"clefs-vaticana_do"
+  centralCPosition = #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
+
+  % Score.timing = ##f
+  % Score.barAlways = ##t
+}
+
+GregorianTranscriptionVoiceContext = \translator {
+  \VoiceContext
+  \name "GregorianTranscriptionVoice"
+  \alias "Voice"
+
+  % Removing ligature bracket engraver without replacing it by some
+  % other ligature engraver would cause a "Junking event: `LigatureEvent'"
+  % warning for every "\[" and "\]".  Therefore, we make the grob
+  % transparent instead.
+  LigatureBracket \set #'transparent = ##t
+
+  % We can not remove Slur_engraver, since \addlyrics depends on it.
+  % Instead, we make the grob transparent.
+  % Unfortunately, this gives us a lot of warnings ("Degenerate bow:
+  % infinite steepness reqd"), since in ligatures, all note heads are in
+  % the same paper column such that the (transparent) slurs eventually may
+  % start and end in the same column.
+  Slur \override #'transparent = ##t
+
+  % We can not remove Stem_engraver, since slurs depend on stems.  If
+  % we try anyway, lily will crash in slur.scm:16:6: "Wrong type argument
+  % in position 1 (expecting grob): ()".
+  % As a workaround, we make the grob transparent.
+  Stem \set #'transparent = ##t
+
+  % Since we do not remove stems, but only make it transparent, we have
+  % to set the length to 0.0.  Otherwise, articulation marks (such as
+  % ictus, circulus or accentus) may be vertically placed quite away from
+  % the note head.
+  Stem \set #'length = #'0.0
+
+  % Put some space before and after divisiones.
+  % FIXME: This does not seem to show any effect.
+  Script \set #'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 = ##t
+  TextSpanner \set #'edge-text = #'("" . "")
+}
+
+GregorianTranscriptionStaffContext = \translator {
+  \StaffContext
+  \name "GregorianTranscriptionStaff"
+  \alias "Staff"
+  \denies "Voice"
+  \accepts "GregorianTranscriptionVoice"
+
+  % 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
+}