lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Solved] Re: \accidentalStyle for common choir notation


From: Alexander Kobel
Subject: [Solved] Re: \accidentalStyle for common choir notation
Date: Thu, 8 Dec 2016 15:14:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]