]> git.donarmstrong.com Git - lilypond.git/commitdiff
CueClefs: Use middleCClefPosition in the key engraver
authorReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 12 Apr 2011 12:00:00 +0000 (14:00 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 21 Jun 2011 10:21:36 +0000 (12:21 +0200)
Otherwise the key signature would use the clef of the cue part, which is not what we want

input/regression/cue-clef-keysignature.ly [new file with mode: 0644]
lily/key-engraver.cc

diff --git a/input/regression/cue-clef-keysignature.ly b/input/regression/cue-clef-keysignature.ly
new file mode 100644 (file)
index 0000000..915d772
--- /dev/null
@@ -0,0 +1,17 @@
+\version "2.15.3"
+
+\header {
+  texidoc = "Clefs for cue notes should not influence the printed key signature."
+}
+
+vI = \relative c'' { \clef "treble" \repeat unfold 40 g4 }
+\addQuote vIQuote { \vI }
+\score {
+  \new Staff {
+    \clef "bass" \key g \major
+    \cueDuringWithClef #"vIQuote" #DOWN #"treble" { R1 } |
+    c1 |
+    \cueDuringWithClef #"vIQuote" #DOWN #"soprano" { R1 \break R1 }
+    c1 |
+  }
+}
index db223e66061c8fc3dcf75e2bf0d8414cbe21ac78..2264e27876a4e5473cda92b2328ac0ebaedccb55 100644 (file)
@@ -72,8 +72,12 @@ Key_engraver::create_key (bool is_default)
       item_ = make_item ("KeySignature",
                         key_event_ ? key_event_->self_scm () : SCM_EOL);
 
+      /* Use middleCClefPosition rather than middleCPosition, because cue
+       * notes with a different clef will modify middleCPosition. The 
+       * Key signature, however, should still be printed at the original
+       * position. */
       item_->set_property ("c0-position",
-                          get_property ("middleCPosition"));
+                          get_property ("middleCClefPosition"));
 
       SCM last = get_property ("lastKeySignature");
       SCM key = get_property ("keySignature");
@@ -230,7 +234,8 @@ ADD_TRANSLATOR (Key_engraver,
                "keyAlterationOrder "
                "keySignature "
                "lastKeySignature "
-               "printKeyCancellation ",
+               "printKeyCancellation "
+               "middleCClefPosition ",
                
                /* write */
                "keySignature "