The keySignature property list of the KeySignature so far was using
reversed order (e.g. the rightmost accidental came first). This was
quite confusing when manually setting non-standard key signatures like
\set Staff.keySignature = #`(((0 . 3) . ,SHARP)
((0 . 5) . ,FLAT)
((0 . 6) . ,FLAT))
In this example, you got bes, as, fis in that reversed order rather than
in the order in which you list the alterations. Now, you'll get fis, as,
bes in that (expected) order.
Also update the snippets and add convert-ly check to warn users about the
reversion (the keySignature property was hardly ever used, though).
\include "makam.ly"
\relative c' {
\include "makam.ly"
\relative c' {
- \set Staff.keySignature = #`((3 . ,BAKIYE) (6 . ,(- KOMA)))
+ \set Staff.keySignature = #`((6 . ,(- KOMA)) (3 . ,BAKIYE))
c4 cc db fk
gbm4 gfc gfb efk
fk4 db cc c
c4 cc db fk
gbm4 gfc gfb efk
fk4 db cc c
@code{octave} specifies the octave (0 being the octave from middle C to
the B above), @code{step} specifies the note within the octave (0 means
C and 6 means B), and @code{alter} is @code{,SHARP ,FLAT ,DOUBLE-SHARP}
@code{octave} specifies the octave (0 being the octave from middle C to
the B above), @code{step} specifies the note within the octave (0 means
C and 6 means B), and @code{alter} is @code{,SHARP ,FLAT ,DOUBLE-SHARP}
-etc. (Note the leading comma.) The accidentals in the key signature
-will appear in the reverse order to that in which they are specified.
+etc. (Note the leading comma.)
Alternatively, for each item in the list, using the more concise format
Alternatively, for each item in the list, using the more concise format
} % begin verbatim
\relative c' {
} % begin verbatim
\relative c' {
- \set Staff.keySignature = #`(((0 . 3) . ,SHARP)
+ \set Staff.keySignature = #`(((0 . 6) . ,FLAT)
"
} % begin verbatim
\relative c' {
"
} % begin verbatim
\relative c' {
- \set Staff.keySignature = #`(((0 . 3) . ,SHARP)
+ \set Staff.keySignature = #`(((0 . 6) . ,FLAT)
{
\override Staff.KeySignature #'padding-pairs
= #'((("accidentals.flat" . "accidentals.sharp.slashslash.stemstemstem") . 0.5))
{
\override Staff.KeySignature #'padding-pairs
= #'((("accidentals.flat" . "accidentals.sharp.slashslash.stemstemstem") . 0.5))
- \set Staff.keySignature = #`((2 . ,SEMI-FLAT) (6 . ,THREE-Q-SHARP) (4 . ,FLAT))
+ \set Staff.keySignature = #`((4 . ,FLAT) (6 . ,THREE-Q-SHARP) (2 . ,SEMI-FLAT))
}
\relative c'
\new Staff {
}
\relative c'
\new Staff {
- \set Staff.keySignature = #`(((1 . 2) . ,SHARP) ((0 . 3) . ,FLAT))
+ \set Staff.keySignature = #`(((0 . 3) . ,FLAT) ((1 . 2) . ,SHARP))
- \set Staff.keySignature = #`(((1 . 2) . ,FLAT) ((0 . 4) . ,DOUBLE-SHARP))
+ \set Staff.keySignature = #`(((0 . 4) . ,DOUBLE-SHARP) ((1 . 2) . ,FLAT))
\break
\key bes \major % \major
c2 \clef alto c2 \key d \major \clef treble c2
\break
\key bes \major % \major
c2 \clef alto c2 \key d \major \clef treble c2
- \set Staff.keySignature = #`((2 . ,SEMI-FLAT) (6 . ,THREE-Q-SHARP) (4 . ,FLAT))
+ \set Staff.keySignature = #`((4 . ,FLAT) (6 . ,THREE-Q-SHARP) (2 . ,SEMI-FLAT))
key_event_
? key_event_->self_scm () : SCM_EOL);
key_event_
? key_event_->self_scm () : SCM_EOL);
- cancellation_->set_property ("alteration-alist", restore);
+ cancellation_->set_property ("alteration-alist", scm_reverse (restore));
cancellation_->set_property ("c0-position",
get_property ("middleCPosition"));
}
}
cancellation_->set_property ("c0-position",
get_property ("middleCPosition"));
}
}
- item_->set_property ("alteration-alist", key);
+ item_->set_property ("alteration-alist", scm_reverse (key));
r->origin ()->warning ("No ordering for key signature alterations");
}
r->origin ()->warning ("No ordering for key signature alterations");
}
- context ()->set_property ("keySignature", accs);
+ context ()->set_property ("keySignature", scm_reverse (accs));
context ()->set_property ("tonic",
r->get_property ("tonic"));
}
context ()->set_property ("tonic",
r->get_property ("tonic"));
}
raise FatalConversionError ()
return str
raise FatalConversionError ()
return str
+@rule ((2, 13, 0), _ ("keySignature property not reversed any more"))
+def conv(str):
+ if re.search(r'\set Staff.keySignature', str):
+ stderr_write ("\n")
+ stderr_write (NOT_SMART % _("The alist for Staff.keySignature is no \
+longer in reversed order.\n"))
+ return str
+
# Guidelines to write rules (please keep this at the end of this file)
#
# - keep at most one rule per version; if several conversions should be done,
# Guidelines to write rules (please keep this at the end of this file)
#
# - keep at most one rule per version; if several conversions should be done,
elif self.non_standard_alterations:
alterations = [self.format_non_standard_alteration (a) for
a in self.non_standard_alterations]
elif self.non_standard_alterations:
alterations = [self.format_non_standard_alteration (a) for
a in self.non_standard_alterations]
- # TODO: Check if the alterations should really be given in reverse
- # order of if that's just a bug in Lilypond. If it's a bug,
- # fix it and remove the following call, otherwise add a
- # proper comment here!
- alterations.reverse ()
return "\\set Staff.keySignature = #`(%s)" % string.join (alterations, " ")
else:
return ''
return "\\set Staff.keySignature = #`(%s)" % string.join (alterations, " ")
else:
return ''