Hello list,

https://lilypond.org/doc/v2.25/Documentation/notation/hiding-staves

Is there a way I can get more control over the workings of
the Keep_alive_together_engraver for the purpose of engraving divisi staves?

Please consider the following, based on the linked example in the
documentation:

\version "2.25.9"
>
> \layout {
>     short-indent = #20
>     indent = #30
>     \context {
>         \Staff
>         keepAliveInterfaces = #'()
>     }
> }
>
> violinI = {
>     \key c \minor
>     \repeat unfold 30 { d'4 }
>     \unset Staff.keepAliveInterfaces
>     <d' bes'>2
>     \repeat unfold 48 { d'4 }
> }
>
> violinII = {
>     \key c \minor
>     \repeat unfold 30 { g4 }
>     <g d'>2
>     \repeat unfold 28 { g4 }
>     <> ^\markup \center-column { "unwanted" "violin div. " }
>     \repeat unfold 20 { g4 }
> }
>
> celloI = {
>     \clef "bass"
>     \key c \minor
>     \repeat unfold 60 { bes,4 }
>     \once \unset Staff.keepAliveInterfaces
>     <d bes>2
>     \repeat unfold 18 { bes,4 }
> }
>
> celloII = {
>     \clef "bass"
>     \key c \minor
>     \repeat unfold 28 { g,4 }
>     <> ^\markup \center-column { "unwanted" "cello div. " }
>     \repeat unfold 32 { g,4 }
>     <g, d>2
>     \repeat unfold 18 { g,4 }
> }
>
> \new StaffGroup \with { \consists Keep_alive_together_engraver } <<
>     \new Staff \with {
>         instrumentName = "Violins"
>         shortInstrumentName = "Vn I & II"
>         \override VerticalAxisGroup.remove-layer = 2
>     } { \transpose c c \partCombine \violinI \violinII }
>     \new StaffGroup \with {
>         systemStartDelimiter = #'SystemStartSquare
>     }
>     <<
>         \new Staff \with {
>             instrumentName = "Violin I"
>             shortInstrumentName = "Vn I"
>             \RemoveAllEmptyStaves
>             \override VerticalAxisGroup.remove-layer = 1
>         } { \transpose c c \violinI }
>         \new Staff \with {
>             instrumentName = "Violin II"
>             shortInstrumentName = "Vn II"
>             \RemoveAllEmptyStaves
>             \override VerticalAxisGroup.remove-layer = 1
>         } { \transpose c c \violinII }
>     >>
>     \new Staff \with {
>         instrumentName = "Violoncellos"
>         shortInstrumentName = "Vc I & II"
>         \override VerticalAxisGroup.remove-layer = 2
>     } { \partCombine \celloI \celloII }
>     \new StaffGroup \with {
>         systemStartDelimiter = #'SystemStartSquare
>     }
>     <<
>         \new Staff \with {
>             instrumentName = "Violoncello I"
>             shortInstrumentName = "Vc I"
>             \RemoveAllEmptyStaves
>             \override VerticalAxisGroup.remove-layer = 1
>         } { \celloI }
>         \new Staff \with {
>             instrumentName = "Violoncello II"
>             shortInstrumentName = "Vc II"
>             \RemoveAllEmptyStaves
>             \override VerticalAxisGroup.remove-layer = 1
>         } { \celloII }
>     >>
> >>
>

Is there a way I can divisi selected staves rather than the entire
StaffGroup?

Thank you.

Reply via email to