]> git.donarmstrong.com Git - lilypond.git/commitdiff
known issue in NR: extra cautionnary accidentals in \alternative block
authorFrederic Bron <frederic.bron@m4x.org>
Tue, 17 Nov 2009 21:09:12 +0000 (22:09 +0100)
committerCarl Sorensen <c_sorensen@byu.edu>
Thu, 19 Nov 2009 14:03:55 +0000 (07:03 -0700)
also added a workaround

Documentation/notation/pitches.itely

index 3ffa5289d11195932777d4002dd94b5928c51ab4..3cf931333b15a05065449dfb88f4aca5eb162666 100644 (file)
@@ -2386,6 +2386,51 @@ manually inserting@tie{}@code{!} and@tie{}@code{?} for the
 problematic notes.
 
 
+Cautionary cancellation of accidentals is done by looking at previous measure.
+However, in the @code{\alternative} block following a @code{\repeat volta N}
+section, one would expect the cancellation being calculated using the previous
+@emph{played} measure, not previous @emph{printed} measure.
+In the following example, the natural @code{c} in the second alternative does
+not need a natural sign:
+
+@lilypond[quote]
+{
+  #(set-accidental-style 'modern)
+  \time 2/4
+  \repeat volta 2 {
+    c'2
+  }
+  \alternative {
+     cis'
+     c'
+  }
+  \bar "|."
+}
+@end lilypond
+
+The following work-around can be used: define a function that locally changes
+the accidental style to @code{forget}:
+
+@lilypond[verbatim,quote]
+forget = #(define-music-function (parser location music) (ly:music?) #{
+  #(set-accidental-style 'forget)
+  $music
+  #(set-accidental-style 'modern)
+#})
+{
+  #(set-accidental-style 'modern)
+  \time 2/4
+  \repeat volta 2 {
+    c'2
+  }
+  \alternative {
+     cis'
+     \forget c'
+  }
+  \bar "|."
+}
+@end lilypond
+
 @node Ambitus
 @unnumberedsubsubsec Ambitus