lilypond-user
[Top][All Lists]
Advanced

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

Re: Suppress one of two staves


From: David Kastrup
Subject: Re: Suppress one of two staves
Date: Wed, 09 Sep 2015 21:33:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

"Helge Kruse" <address@hidden> writes:

> Hello,
> I have a harp score where there are a lot of lines that require only the 
> upper staff.
> How can I suppress the lower staff in lines where it is empty. The following 
> example
> illustrates this:
> \version "2.18"
> \new PianoStaff <<
> \new Staff \relative c' {
> \repeat unfold 5 { c4 e g c }
> \repeat unfold 12 { c2 a }
> \repeat unfold 20 { R1 }
> \repeat unfold 10 { c2 a }
> \repeat unfold 8 { c,4 e g c }
> }
> \new Staff \relative c {
> \clef bass
> \repeat unfold 5 { c4 e g c }
> \repeat unfold 42 s1
> \repeat unfold 8 { c,4 e g c }
> }
>>>
> \layout {
> \context {
> % \Staff \RemoveEmptyStaves
> }
> }
> Measure 18-48 should have no lower staff. RemoveEmptyStaves unfortunately
> doesn't work since the rests shall be printed in at least one staff.

\RemoveEmptyStaves does not work primarily because \PianoStaff has the
Keep_alive_together_engraver.  You should remove that one (or not use
\PianoStaff) and then invoke only the second Staff as

\new Staff \with { \RemoveEmptyStaves } { ... }

If you don't want to retain the upper Staff with rests only when the
lower Staff has notes, things are a bit more tricky.  Basically, you'll
arrange to have your whole PianoStaff removed on demand, give it a
remove-layer of #0 but put _another_ copy of the first Staff (better
though a rest-only variant of it) in parallel with the PianoStaff,
giving it a remove-layer of #1.  That way it will only survive into the
final score when both staves in the PianoStaff will die.

-- 
David Kastrup



reply via email to

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