lilypond-user
[Top][All Lists]
Advanced

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

Hiding one empty staff of three-staff piano score but not two


From: Michael Rivers
Subject: Hiding one empty staff of three-staff piano score but not two
Date: Mon, 25 Mar 2013 16:09:44 -0700 (PDT)

I'm typesetting a piano score that is mostly in two staves, but occasionally
in three. I have filled the third staff with spacers rests when it's not
needed and used \RemoveEmptyStaves and "Keep_alive_together_engraver" to
hide it when its empty.

The problem is that the first line of the score uses only one staff but
*does* display the empty second staff, which Lilypond is hiding along with
the third staff because it's empty. Is there a way to force the second staff
to be displayed only on the first system?

\version "2.16.1"

right = \relative c'' {
  c1 | c | c | c | \break % First line
  c | c | c | c | \break % Second line
  c | c | c | c | 
}

left = \relative c' {
  s1*4 | %First line that I would like to be displayed even though it's
empty
  c1 | c | c | c | 
  c | c | c | c | 
}

leftTwo = \relative c {
  s1*8 | %First two lines
  c1 | c | c | c |
}

\score {
  \new PianoStaff 
  <<
    \new Staff = "right" \right
    \new Staff = "left" { \clef bass \left }
    \new Staff = "leftTwo" {\clef bass \leftTwo}
  >>
  \layout {
    \context {
        \Staff \RemoveEmptyStaves 
        \override VerticalAxisGroup #'remove-first = ##t
      }
      \context {
        \PianoStaff 
        \remove "Keep_alive_together_engraver"
      }
  }     

}



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Hiding-one-empty-staff-of-three-staff-piano-score-but-not-two-tp143427.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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