[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: automatic accidental style voice: too many written accidentals
From: |
Neil Puttock |
Subject: |
Re: automatic accidental style voice: too many written accidentals |
Date: |
Sun, 25 Oct 2009 15:32:09 +0000 |
2009/10/24 Frédéric Bron <address@hidden>:
> 2. can somebody give me some clue to help me fix the bug, if I can...
> For example, I suspect that the following line returns the wrong key
> signature but how can I print what is in local-key-sig?
> (local-key-sig (ly:context-property context 'localKeySignature))
(display local-key-sig) will output the current value if you don't
want to debug using guile-debugger.ly.
Here's the output from your last snippet with a few comments:
((6 . -1/2))
The key signature from keySignature (i.e., 6 = B, -1/2 = FLAT).
(((0 . 6) -1/2 1 . #<Mom 1>) (6 . -1/2))
A B flat in the first bar, plus the key signature.
()
The second voice appears, but localKeySignature returns an empty list.
The reason for this is that this voice doesn't exist when the key
signature is set, so can't cache its value. Here's the relevant code
in accidental-engraver.cc (update_local_key_signature ()):
set_context_property_on_children (context (),
ly_symbol2scm ("localKeySignature"),
new_sig);
You can't set a context property on a child context that doesn't exist
(i.e., the newly instantiated voice), so a workaround would be to
explicitly instantiate all the voices at the point the key signature
is set.
\relative c'' {
#(set-accidental-style 'voice)
\key f \major
<<
{ \voiceOne bes1 d }
\new Voice { \voiceTwo s1 bes }
>>
}
Regards,
Neil
- Re: automatic accidental style voice: too many written accidentals, (continued)
- Re: automatic accidental style voice: too many written accidentals, Graham Percival, 2009/10/26
- Re: automatic accidental style voice: too many written accidentals, Valentin Villenave, 2009/10/26
- Re: automatic accidental style voice: too many written accidentals, Frédéric Bron, 2009/10/25
- Re: automatic accidental style voice: too many written accidentals, Trevor Daniels, 2009/10/25
- Re: [spam probable] Re: automatic accidental style voice: too many written accidentals, Frédéric Bron, 2009/10/26
- Re: automatic accidental style voice: too many written accidentals, Trevor Daniels, 2009/10/26
- Re: automatic accidental style voice: too many written accidentals, Mats Bengtsson, 2009/10/26
- Re: automatic accidental style voice: too many written accidentals, Frédéric Bron, 2009/10/29
- Re: automatic accidental style voice: too many written accidentals, David Kastrup, 2009/10/29
- Re: automatic accidental style voice: too many written accidentals, Frédéric Bron, 2009/10/29
- Re: automatic accidental style voice: too many written accidentals,
Neil Puttock <=
- Re: automatic accidental style voice: too many written accidentals, Frédéric Bron, 2009/10/26