};
/*
- localKeySignature is changed at runtime, which means that references
+ localAlterations is changed at runtime, which means that references
in grobs should always store ly_deep_copy ()s of those.
*/
{
last_keysig_ = new_sig;
set_context_property_on_children (context (),
- ly_symbol2scm ("localKeySignature"),
+ ly_symbol2scm ("localAlterations"),
new_sig);
Context *trans = context ()->get_parent_context ();
*/
SCM val;
- while (trans && trans->where_defined (ly_symbol2scm ("localKeySignature"), &val) == trans)
+ while (trans && trans->where_defined (ly_symbol2scm ("localAlterations"), &val) == trans)
{
- trans->set_property ("localKeySignature", ly_deep_copy (last_keysig_));
+ trans->set_property ("localAlterations", ly_deep_copy (last_keysig_));
trans = trans->get_parent_context ();
}
}
SCM localsig = SCM_EOL;
while (origin
- && origin->where_defined (ly_symbol2scm ("localKeySignature"), &localsig))
+ && origin->where_defined (ly_symbol2scm ("localAlterations"), &localsig))
{
bool change = false;
if (accidentals_[i].tied_
}
if (change)
- origin->set_property ("localKeySignature", localsig);
+ origin->set_property ("localAlterations", localsig);
origin = origin->get_parent_context ();
}
void
Accidental_engraver::process_music ()
{
- SCM sig = get_property ("keySignature");
+ SCM sig = get_property ("keyAlterations");
if (last_keysig_ != sig)
update_local_key_signature (sig);
}
"extraNatural "
"harmonicAccidentals "
"accidentalGrouping "
- "keySignature "
- "localKeySignature ",
+ "keyAlterations "
+ "localAlterations ",
/* write */
- "localKeySignature "
+ "localAlterations "
);
int offset = robust_scm2int (get_property ("middleCOffset"), 0);
start_c0_ = clef_pos + offset;
- start_key_sig_ = get_property ("keySignature");
+ start_key_sig_ = get_property ("keyAlterations");
is_typeset_ = true;
}
"AmbitusNoteHead ",
/* read */
- "keySignature "
+ "keyAlterations "
"middleCClefPosition "
"middleCOffset ",
item_->set_property ("c0-position",
get_property ("middleCClefPosition"));
- SCM last = get_property ("lastKeySignature");
- SCM key = get_property ("keySignature");
+ SCM last = get_property ("lastKeyAlterations");
+ SCM key = get_property ("keyAlterations");
if ((to_boolean (get_property ("printKeyCancellation"))
|| key == SCM_EOL)
void
Key_engraver::acknowledge_bar_line (Grob_info /* info */)
{
- if (scm_is_pair (get_property ("keySignature")))
+ if (scm_is_pair (get_property ("keyAlterations")))
create_key (true);
}
Key_engraver::process_music ()
{
if (key_event_
- || get_property ("lastKeySignature") != get_property ("keySignature"))
+ || get_property ("lastKeyAlterations") != get_property ("keyAlterations"))
create_key (false);
}
Key_engraver::stop_translation_timestep ()
{
item_ = 0;
- context ()->set_property ("lastKeySignature", get_property ("keySignature"));
+ context ()->set_property ("lastKeyAlterations", get_property ("keyAlterations"));
cancellation_ = 0;
key_event_ = 0;
}
r->origin ()->warning (_ ("Incomplete keyAlterationOrder for key signature"));
}
- context ()->set_property ("keySignature", scm_reverse_x (accs, SCM_EOL));
+ context ()->set_property ("keyAlterations", scm_reverse_x (accs, SCM_EOL));
context ()->set_property ("tonic",
r->get_property ("tonic"));
}
void
Key_engraver::initialize ()
{
- context ()->set_property ("keySignature", SCM_EOL);
- context ()->set_property ("lastKeySignature", SCM_EOL);
+ context ()->set_property ("keyAlterations", SCM_EOL);
+ context ()->set_property ("lastKeyAlterations", SCM_EOL);
Pitch p (0, 0, 0);
context ()->set_property ("tonic", p.smobbed_copy ());
"explicitKeySignatureVisibility "
"extraNatural "
"keyAlterationOrder "
- "keySignature "
- "lastKeySignature "
+ "keyAlterations "
+ "lastKeyAlterations "
"printKeyCancellation "
"middleCClefPosition ",
/* write */
- "keySignature "
- "lastKeySignature "
+ "keyAlterations "
+ "lastKeyAlterations "
"tonic "
);
SCM scm_pitch = ev->get_property ("pitch");
Pitch *p = unsmob_pitch (scm_pitch);
- SCM keysig = get_property ("localKeySignature");
+ SCM keysig = get_property ("localAlterations");
SCM key = scm_cons (scm_from_int (p->get_octave ()),
scm_from_int (p->get_notename ()));
\consists "Cue_clef_engraver"
\consists "Fingering_column_engraver"
- localKeySignature = #'()
+ localAlterations = #'()
createSpacing = ##t
ignoreFiguredBassRest = ##f
\context{
\type "Engraver_group"
- localKeySignature = #'()
+ localAlterations = #'()
createSpacing = ##t
squashedPosition = #0
\context{
\type "Engraver_group"
\name GrandStaff
- localKeySignature = #'()
+ localAlterations = #'()
\description "A group of staves, with a brace on the left
side, grouping the staves together. The bar lines of the
str = re.sub (r'\\lyricmode\s*(\\lyricsto\b)', r"\1", str)
return str
+@rule ((2, 19, 7), "keySignature -> keyAlterations")
+def conv(str):
+ str = re.sub (r'\bkeySignature\b', 'keyAlterations', str)
+ str = re.sub (r'\blastKeySignature\b', 'lastKeyAlterations', str)
+ str = re.sub (r'\blocalKeySignature\b', 'localAlterations', str)
+ 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,
elif self.non_standard_alterations:
alterations = [self.format_non_standard_alteration (a) for
a in self.non_standard_alterations]
- return "\\set Staff.keySignature = #`(%s)" % string.join (alterations, " ")
+ return "\\set Staff.keyAlterations = #`(%s)" % string.join (alterations, " ")
else:
return ''
@code{(@var{step} . @var{alter})},
where @var{step} is a number from 0 to@tie{}6 and
@var{alter} from -2 (sharp) to 2 (flat).")
- (keySignature ,list? "The current key signature. This is an alist
+ (keyAlterations ,list? "The current key signature. This is an alist
containing @code{(@var{step} . @var{alter})} or
@code{((@var{octave} . @var{step}) . @var{alter})}, where @var{step}
is a number in the range 0 to@tie{}6 and @var{alter} a fraction,
denoting alteration. For alterations, use symbols, e.g.
-@code{keySignature = #`((6 . ,FLAT))}.")
+@code{keyAlterations = #`((6 . ,FLAT))}.")
(lyricMelismaAlignment ,number? "Alignment to use for a melisma syllable.")
(lastChord ,markup? "Last chord, used for detecting chord changes.")
- (lastKeySignature ,list? "Last key signature before a key
+ (lastKeyAlterations ,list? "Last key signature before a key
signature change.")
- (localKeySignature ,list? "The key signature at this point in the
-measure. The format is the same as for @code{keySignature}, but can
+ (localAlterations ,list? "The key signature at this point in the
+measure. The format is the same as for @code{keyAlterations}, but can
also contain @code{((@var{octave} . @var{name}) . (@var{alter}
@var{barnumber} . @var{measureposition}))} pairs.")
(define (check-pitch-against-signature context pitch barnum laziness octaveness all-naturals)
"Checks the need for an accidental and a @q{restore} accidental against
-@code{localKeySignature}. The @var{laziness} is the number of measures
+@code{localAlterations} and @code{keyAlterations}.
+The @var{laziness} is the number of measures
for which reminder accidentals are used (i.e., if @var{laziness} is zero,
only cancel accidentals in the same measure; if @var{laziness} is three,
we cancel accidentals up to three measures after they first appear.
@var{octaveness} is either @code{'same-octave} or @code{'any-octave} and
specifies whether accidentals should be canceled in different octaves.
-If @var{all-naturals} is ##t, notes that do not occur in @code{keySignature}
+If @var{all-naturals} is ##t, notes that do not occur in @code{keyAlterations}
also get an accidental."
(let* ((ignore-octave (cond ((equal? octaveness 'any-octave) #t)
((equal? octaveness 'same-octave) #f)
(ly:warning (_ "Unknown octaveness type: ~S ") octaveness)
(ly:warning (_ "Defaulting to 'any-octave."))
#t)))
- (key-sig (ly:context-property context 'keySignature))
- (local-key-sig (ly:context-property context 'localKeySignature))
+ (key (ly:context-property context 'keyAlterations))
+ (local (ly:context-property context 'localAlterations))
(notename (ly:pitch-notename pitch))
(octave (ly:pitch-octave pitch))
(pitch-handle (cons octave notename))
(need-accidental #f)
(previous-alteration #f)
(from-other-octaves #f)
- (from-same-octave (assoc-get pitch-handle local-key-sig))
- (from-key-sig (or (assoc-get notename local-key-sig)
+ (from-same-octave (assoc-get pitch-handle local))
+ (from-key-sig (or (assoc-get notename local)
- ;; If no key signature match is found from localKeySignature, we may have a custom
+ ;; If no notename match is found from localAlterations, we may have a custom
;; type with octave-specific entries of the form ((octave . pitch) alteration)
;; instead of (pitch . alteration). Since this type cannot coexist with entries in
- ;; localKeySignature, try extracting from keySignature instead.
- (assoc-get pitch-handle key-sig))))
+ ;; localAlterations, try extracting from keyAlterations instead.
+ (assoc-get pitch-handle key))))
- ;; loop through localKeySignature to search for a notename match from other octaves
- (let loop ((l local-key-sig))
+ ;; loop through localAlterations to search for a notename match from other octaves
+ (let loop ((l local))
(if (pair? l)
(let ((entry (car l)))
(if (and (pair? (car entry))
(check-pitch-against-signature context pitch barnum laziness octaveness #t))
(define (key-entry-notename entry)
- "Return the pitch of an @var{entry} in @code{localKeySignature}.
+ "Return the pitch of an @var{entry} in @code{localAlterations}.
The @samp{car} of the entry is either of the form @code{notename} or
of the form @code{(octave . notename)}. The latter form is used for special
key signatures or to indicate an explicit accidental.
(car entry)))
(define (key-entry-octave entry)
- "Return the octave of an entry in @code{localKeySignature}
+ "Return the octave of an entry in @code{localAlterations}
or @code{#f} if the entry does not have an octave.
See @code{key-entry-notename} for details."
(and (pair? (car entry)) (caar entry)))
(define (key-entry-bar-number entry)
- "Return the bar number of an entry in @code{localKeySignature}
+ "Return the bar number of an entry in @code{localAlterations}
or @code {#f} if the entry does not have a bar number.
See @code{key-entry-notename} for details."
(and (pair? (cdr entry)) (caddr entry)))
(define (key-entry-measure-position entry)
- "Return the measure position of an entry in @code{localKeySignature}
+ "Return the measure position of an entry in @code{localAlterations}
or @code {#f} if the entry does not have a measure position.
See @code{key-entry-notename} for details."
(and (pair? (cdr entry)) (cdddr entry)))
(define (key-entry-alteration entry)
- "Return the alteration of an entry in localKeySignature.
+ "Return the alteration of an entry in localAlterations
For convenience, returns @code{0} if entry is @code{#f}."
(if entry
key signature @emph{and} does not directly follow a note on the same
staff line. This rule should not be used alone because it does neither
look at bar lines nor different accidentals at the same note name."
- (let* ((keysig (ly:context-property context 'localKeySignature))
+ (let* ((keysig (ly:context-property context 'localAlterations))
(entry (find-pitch-entry keysig pitch #t #t)))
(if (not entry)
(cons #f #f)
"An accidental rule that typesets a cautionary accidental if it is
included in the key signature @emph{and} does not directly follow a note
on the same staff line."
- (let* ((keysig (ly:context-property context 'localKeySignature))
+ (let* ((keysig (ly:context-property context 'localAlterations))
(entry (find-pitch-entry keysig pitch #t #t)))
(if (not entry)
(cons #f #f)
,teaching-accidental-rule)
context))
- ;; do not set localKeySignature when a note alterated differently from
- ;; localKeySignature is found.
+ ;; do not set localAlterations when a note alterated differently from
+ ;; localAlterations is found.
;; Causes accidentals to be printed at every note instead of
;; remembered for the duration of a measure.
;; accidentals not being remembered, causing accidentals always to
(define-public (invalidate-alterations context)
"Invalidate alterations in @var{context}.
-Elements of @code{'localKeySignature} corresponding to local
+Elements of @code{'localAlterations} corresponding to local
alterations of the key signature have the form
@code{'((octave . notename) . (alter barnum . measurepos))}.
Replace them with a version where @code{alter} is set to @code{'clef}
to force a repetition of accidentals.
Entries that conform with the current key signature are not invalidated."
- (let* ((keysig (ly:context-property context 'keySignature)))
- (set! (ly:context-property context 'localKeySignature)
+ (let* ((keysig (ly:context-property context 'keyAlterations)))
+ (set! (ly:context-property context 'localAlterations)
(map-in-order
(lambda (entry)
(let* ((localalt (key-entry-alteration entry)))
#t #t))))
entry
(cons (car entry) (cons 'clef (cddr entry))))))
- (ly:context-property context 'localKeySignature)))))
+ (ly:context-property context 'localAlterations)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;