lilypond-user
[Top][All Lists]
Advanced

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

Selectively remove some staves consisting only of rests


From: Andrew Bernard
Subject: Selectively remove some staves consisting only of rests
Date: Mon, 4 Feb 2019 20:17:35 +1100

I want to remove some staves containing only rests and yet retain others in my quartet score. [When there is a long solo I want the other parts suppressed, but when just one instrument is at rest I want the empty staff to show in the set of four].

The keepAliveInterface must have something to do with it but my attempts lead nowhere. Here's an MWE where if somebody could show how to suppress one staff with rests but show the other this would set me on the path to enlightenment.

Andrew

%====
\version "2.19.82"

violinOne = {
  \override Staff.VerticalAxisGroup.remove-first = ##t
  \set Staff.keepAliveInterfaces = #'()
  \repeat unfold 8 { c''4 }
  \break
  \unset Staff.keepAliveInterfaces

  \repeat unfold 8 { r4 }
  \break
  \repeat unfold 8 { c''4 }
  \break
  % how can I show this line of rests?
  \repeat unfold 8 { s4 }
  \bar "."
}

violinTwo = {
  \repeat unfold 8 { c'4 }
  \break
  \repeat unfold 8 { c'4 }
  \break
  \repeat unfold 8 { c'4 }
  \break
  \repeat unfold 8 { c'4 }
}

\score {
  <<
    \new Staff {
      \violinOne
    }
    \new Staff {
      \violinTwo
    }
  >>
  \layout {
    \context {
      \Staff
      \RemoveEmptyStaves
    }
  }
}

%====


reply via email to

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