On 30 Oct 2023, at 02:04, Evan Driscoll <evaned@gmail.com> wrote:
IIUC what you're looking for is use of \RemoveAllEmptyStaveswithout using "\consists Keep_alive_together_engraver", as you appear to want the Cello I staff to disappear when it contains rests only (rather than making it disappear only when Cello I and Cello II share a section of rests-only music.
Keep_alive_together_engraver is meant to keep an entire set of staffs (despite the \RemoveAllEmptyStaves) as long as at least one of them is not rests only.
\score { \new StaffGroup \with { \consists Keep_alive_together_engraver } << \new Staff \with { instrumentName = "Cello I" \RemoveAllEmptyStaves %\override VerticalAxisGroup.remove-layer = 1 } \celloI \new Staff \with { instrumentName = "Cello II" \RemoveAllEmptyStaves %\override VerticalAxisGroup.remove-layer = 1 } \celloII >>
Ensures that either both Cello staves are on display or both are hidden as the are part of a staffgroup with the keep alive together engraver
\score { \new StaffGroup << \new Staff \with { instrumentName = "Cello I" \RemoveAllEmptyStaves %\override VerticalAxisGroup.remove-layer = 1 } \celloI \new Staff \with { instrumentName = "Cello II" \RemoveAllEmptyStaves %\override VerticalAxisGroup.remove-layer = 1 } \celloII >>
Should hide Cello I when it has rests only on a staff-line, leaving only Cello II |