Re: RemoveEmptyStaves not working with Dynamics

Timothy Lanfear via bug-lilypond <[email protected]> Sat, 21 Mar 2026 16:48:50 +0000
Newsgroups gmane.comp.gnu.lilypond.bugs
Message-ID <[email protected]>
On 20/03/2026 21:12, Ruud van Silfhout wrote:
> Hi,
>
> I was typesetting a piece in which an organ only played only a few notes
> near the end of the piece, So, to fit more music on a page I turned to
> Remove(All)EmptyStaves. That failed to work. It turned out that it was
> because a Dynamics context is used. Below is a small lilypond snippet to
> show the culprit. Once the \new Dynamics line is removed or commented out,
> the behaviour is as expected.

If you apply RemoveAllEmptyStaves to the PianoStaff context, you will 
get the desired behaviour.

\layout {
   \context {
     \PianoStaff
     \RemoveAllEmptyStaves
   }
}

I think not many people pay attention to the bugs list; you are more 
likely to get some help by writing to the user list.

-- 
Timothy Lanfear, Bristol, UK.