On 2016-12-06 22:45, Alexander Kobel wrote:
Dear all,
I'd like to lift the thread "\accidentalStyle for common choir notation"
from June-July out of the grave. Unfortunately, I don't have it in my
inbox anymore, so I need to refer to the horribly url'ed archive
http://lilypond.1069038.n5.nabble.com/accidentalStyle-for-common-choir-notation-td191797.html#a192980
In particular, I'd like to gain new insight why Abraham's idea did not
work out (also, not for me over here).
Summary: I want to use the piano accidental style in a ChoirStaff, but
it doesn't work.
[...]
Hi everybody,
I found both the culprit and the workaround.
The problem compared to GrandStaff is that ChoirStaff does not keep
track of the list of accidentals that occured within the last bars. More
precisely, localKeySignature (or, from v.19.8, localAlterations) is not
a known context property therein.
Fortunately, the fix is simple: add an initialization to an empty list as in
\layout { \context { \ChoirStaff localAlterations = #'() } }
and it will be populated and used automagically. After that, Abraham's
conversion of the piano and piano-cautionary or a definition as follows
(slightly different for tracking of different voices on the same staff)
works like a charm, without modifications of any Lily internals:
accidental-styles.choral =
#`(#f
(Voice ,(make-accidental-rule 'same-octave 0)
Staff ,(make-accidental-rule 'same-octave 1)
,(make-accidental-rule 'any-octave 0)
ChoirStaff ,(make-accidental-rule 'any-octave 0)
,(make-accidental-rule 'same-octave 1))
()
ChoirStaff)
accidental-styles.choral-cautionary =
#`(#f
(Voice ,(make-accidental-rule 'same-octave 0)
Staff ,(make-accidental-rule 'same-octave 1))
(Staff ,(make-accidental-rule 'any-octave 0)
ChoirStaff ,(make-accidental-rule 'any-octave 0)
,(make-accidental-rule 'same-octave 1))
ChoirStaff)
... \new ChoirStaff << \accidentalStyle choral ... >>>
I could see no other (negative) side effect of adding localAlterations
to ChoirStaff. I will try to do a regtest with that change over the
weekend; if it does no harm, I will propose a one-line patch to include
it per default, so that hopefully ChoirStaff accidental styles will not
need this additional workaround in the future.
Best,
Alexander
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user