lilypond-user
[Top][All Lists]
Advanced

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

How to force NoteNames to be printed before key change


From: Jay Vara
Subject: How to force NoteNames to be printed before key change
Date: Sat, 1 Nov 2014 00:25:32 +0000

I have a program which is roughly as below:

\score {
   \new staff
     { 
        \key c \major
        <<
            \new voice
               {
                  musicA
               }
            \context NoteNames
               {
                 \override NoteName.stencil = #myNoteNames
                 musicA

               }

       }
      \layout{}
}

\score {
   \new staff
     { 
        \key g \major
        <<
            \new voice
               {
                  musicB
               }
            \context NoteNames
               {
                 \override NoteName.stencil = #myNoteNames
                 musicB

               }

       }
      \layout{}
}

Two rougly identical blocks, the only difference being the key and music.

It appears to me that by the time the NoteNames of musicA prints, the key signature has already changed to G major. I introduced another copy of \key c \major inside the NoteNames context - but still I can see that in #myNoteNames function that the key signature has changed.

Is there a way to force NoteNames to print using the key signature defined in its context?

The workaround I have is to have each score in a separate .ly file. Not such a good solution since I have many scores in the file.

reply via email to

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