\version "2.10.25" \header { title="Hiding choir staves with rests only" } \markup { \fill-line { \justify-string #"If you have a choir score where some voices are quit for a long time, you might want to hide staves with rests only. By default, lilypond will show all staves, even if they only contain rests. To change this, simply add the RemoveEmptyStaffContext to your layout. The first system would still show all staves for all voices. To force this setting to also apply to the first system of a score, set remove-first of VerticalAxisGroup to true. If only one staff is displayed, the choir bracket would also be hidden, so you will probably need to set collapse-height of SystemStartBracket to 1 (or anything smaller than 5, which is the usual number of lines in a staff)." } } sop = \relative c'' { R1*8 | c4 c c c | R1*16 | c4 c c c \bar"|." } alt = \relative c'' { g4 g g g | R1*7 | g4 g g g | R1*8 | g4 g g g | R1*8 \bar"|." } \layout { \context { % add the RemoveEmptyStaffContext that erases rest-only staves \RemoveEmptyStaffContext } \context { \Score % Remove all-rest staves also in the first system \override VerticalAxisGroup #'remove-first = ##t % Larger horizontal spacing so the rest-only measures take up enough space in this example \override SeparationItem #'padding = #8.0 } \context { \ChoirStaff % If only one non-empty staff in a system exists, still print the backet \override SystemStartBracket #'collapse-height = #1 } } \score{ \context ChoirStaff << \context Staff=soprano << \sop \set Staff.shortInstrumentName = "S" >> \context Staff=alto << \alt \set Staff.shortInstrumentName = "A" >> >> }