In LilyPond (ver. 2.18.2), I'm notating some Ligeti (as a challenge, mostly). When writing out a snippet of his Étude En Suspens, mm. 18-21, there's a passage with different keys between the bottom and top staff (bottom in C major at bar 18, top in D♭ major). Three measures later, they swap keys (bottom in D♭, top in C).
Question: How can I get LilyPond to keep both staves' key signatures aligned?
Screenshot of PDF created by LilyPond:
LilyPond Code
\version "2.18.2"
\include "english.ly"
\include "articulate.ly"
\pointAndClickOff
#(set-global-staff-size 20)
\header
{
title = "Étude En Suspens"
composer = "György Ligeti (1923-2006)"
tagline = ##f
}
\score
{
<<
\new PianoStaff
{
<<
\new Staff = "upper-staff"
{
\override Staff.TimeSignature #'stencil = ##f
\set Score.tempoHideNote = ##t
\relative c''
{
\clef treble
\time 6/4
\key df \major
f4^>_\pp( ef df bf2)
<<
{
s4 |
s4*4 f'4^>(\< ef | \stemDown
<df af'>4 <f gf> <af, bf'>4\p <bf af'>2.)_\pp \stemNeutral
}
\\
{
<f' gf>4^>( |
ef4 df bf af gf2) |
s4*6
}
>>
\key c \major
<b' c>4^>( a g e2) <g d'>4^>
}
}
\new Staff = "lower-staff"
{
\override Staff.TimeSignature #'stencil = ##f
\relative c''
{
\clef treble
\time 6/4
\key c \major
e4.^>_\pp( d4. c4. b4. |
a2.)
\shape #'( (0 . -2) (0 . 1) (0 . 0) (0 . -1)) Slur
<b c>4.(\< <g a'>4.\p |
d'2.\> <a e'>2.)\pp |
\key df \major
<gf af>4.->( gf4. f4. ef4.)
}
}
>>
}
>>
\layout
{
\context
{
\Score
}
}
}