lilypond-user
[Top][All Lists]
Advanced

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

\stemUp etc can inhibit key signature change


From: Richard Sabey
Subject: \stemUp etc can inhibit key signature change
Date: Fri, 18 Sep 2009 17:02:02 +0000

I'm laying out a piece of piano music which is monophonic, but with the notes passing frequently from hand to hand. For the performer's convenience I notate it on two staves. For my own convenience, I'm coding it as if there is only one strand of music, and I use \change Staff as necessary. I use the stem-direction commands \stemDown, \stemUp and \stemNeutral on occasion, to distinguish left-hand from right-hand notes when they are on the same stave.

However, changes of key signature do not always affect both staves. It seems that using stem-direction commands causes this buggy behaviour, and not using them causes changes of key signature to affect both staves just as they should.

I am using Lilypond 2.12.2.

%% begin example lilypond file
\include "english.ly"

global =
{
    \key a \major
    s1
    \key c \major
    s1
}

pianoMusic =
{
    \relative a, { \change Staff = "lh" \stemDown a4 \stemUp e' \change Staff = "rh" cs' e }
    \relative c { \change Staff = "lh" \stemNeutral c g' \change Staff = "rh" e' c' }
}

pianoMusicLH =
{
    \clef bass
}

\score
{
    <<
    % Note that \pianoMusic works only if it is put in "lh" (which is the staff in which the piano music starts).
    \new PianoStaff
    <<
        \new Staff = "rh" << \global >>
        \new Staff = "lh" << \global \pianoMusic \pianoMusicLH >>
    >>
    >>

    \layout { }
} % score
%% end example lilypond file



View your Twitter and Flickr updates from one place – Learn more!

reply via email to

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