]> git.donarmstrong.com Git - lilypond.git/commitdiff
Doc: Issue 4323: Ensure all contexts in satb.ly template stay alive
authorTrevor Daniels <t.daniels@treda.co.uk>
Sun, 15 Mar 2015 14:04:52 +0000 (14:04 +0000)
committerTrevor Daniels <t.daniels@treda.co.uk>
Sun, 22 Mar 2015 19:48:35 +0000 (19:48 +0000)
  Following the fix to Issue 2010, some contexts in deeply nested
  parallel constructs may be terminated prematurely, at least this
  is the likely explanation for the failure of the satb.ly template
  in Release 2.19.16, although blaming Issue 2010 is conjecture.

  As an alternative fix to Issue 2010 seems far away, this is a hackish
  workaround enable the satb.ly template to work in releases after
  2.19.15 by ensuring all contexts remain alive for the duration of the
  longest of them.  It corrects all the examples in the LM.

ly/satb.ly

index eed79d1cbbf2066b5e713f51202610ba14c54fbd..a8ae1347acdb6706b54ab9997ebf677da057a5a6 100644 (file)
@@ -106,6 +106,7 @@ PartInstrumentName or its default."
        #(satb-defaulting Key)
        \clef #,clef
        \new Voice = #,name <<
+         \satb-spacers
          #(satb-defaulting Time)
          \dynamicUp
          #(satb-defaulting ,(satb-sym name "Music"))
@@ -133,12 +134,14 @@ PartInstrumentName or its default."
       #(satb-defaulting Key)
       \clef #,clef
       \new Voice = #,v1name <<
+        \satb-spacers
         #(satb-defaulting Time)
         \voiceOne
         \dynamicUp
         #(satb-defaulting ,(satb-sym v1name "Music"))
       >>
       \new Voice = #,v2name <<
+        \satb-spacers
         #(satb-defaulting Time)
         \voiceTwo
         #(satb-defaulting ,(satb-sym v2name "Music"))
@@ -154,6 +157,33 @@ PartInstrumentName or its default."
     #(satb-lyrics-if-defined ,(satb-sym v2name "LyricsThree") ,v2name)
   >> #})
 
+satb-define-if-unused =
+#(define-void-function (parser location syms) (symbol-list?)
+   (for-each
+      (lambda (sym)
+        (if (null? (ly:parser-lookup parser sym))
+            (ly:parser-define! parser sym *unspecified*)))
+      syms))
+
+\satb-define-if-unused
+  #'(
+    DescantMusic
+    SopranoMusic
+    AltoMusic
+    TenorMusic
+    BassMusic
+  )
+
+satb-AllChoirMusic = <<
+  \DescantMusic
+  \SopranoMusic
+  \AltoMusic
+  \TenorMusic
+  \BassMusic
+>>
+
+#(define satb-spacers (skip-of-length satb-AllChoirMusic))
+
 SATB = <<
   \new ChoirStaff
   \with {
@@ -197,6 +227,7 @@ SATB = <<
       \clef "treble"
       #(satb-defaulting Key)
       \new Voice <<
+        \satb-spacers
         #(satb-defaulting Time)
         #(satb-defaulting PianoRHMusic)
       >>
@@ -208,6 +239,7 @@ SATB = <<
       \clef "bass"
       #(satb-defaulting Key)
       \new Voice <<
+        \satb-spacers
         #(satb-defaulting Time)
         #(satb-defaulting PianoLHMusic)
       >>