2009/10/24 Frédéric Bron <frederic.b...@m4x.org>:

> 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


_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to