\version "2.19.45" targetstaff = #(define-scheme-function (ctx) (string?) #{ \set Staff.keepAliveInterfaces = #'() \context Staff = #ctx { \unset Staff.keepAliveInterfaces } #}) sopnotes = \relative c'' { \targetstaff #"tutti" c1 1 1 1 \break \targetstaff #"sopalt" c4-- d e f g f e d c1 R1 \break \targetstaff #"sop" \repeat unfold 8 { c8 e g e } \break \targetstaff #"sopalt" c4 d e f g f e d c1 \break c4 d e f g f e d c1 R1 \bar "|." } altnotes = \relative g' { \targetstaff #"tutti" g1 1 1 1 \targetstaff #"sopalt" c4 d e f g f e d c1 R1 \targetstaff #"alt" \repeat unfold 8 { c,8 e g e } \targetstaff #"sopalt" c4 d e f g f e d c1 c4 d e f g f e d c1 R1 } tennotes = \relative e' { \targetstaff #"tutti" e1 1 1 1 \targetstaff #"tenbas" c4 d e f g f e d c1 R1 \targetstaff #"ten" \repeat unfold 28 { c8 e } \targetstaff #"tutti" R1*4 } basnotes = \relative c' { \targetstaff #"tutti" c1 1 1 1 \targetstaff #"tenbas" c4 d e f g f e d c1 R1 \targetstaff #"bas" \repeat unfold 28 { e,8 g } \targetstaff #"tutti" R1*4 } \layout { short-indent = 8 \context { \StaffGroup \consists Keep_alive_together_engraver } \context { \Staff \override VerticalAxisGroup.remove-first = ##t \override VerticalAxisGroup.remove-empty = ##t } } \score { \new StaffGroup << \new Staff = "tutti" \with { instrumentName = "SATB" shortInstrumentName = "SATB" \override VerticalAxisGroup.remove-first = ##f \override VerticalAxisGroup.remove-empty = ##f \override VerticalAxisGroup.remove-layer = 3 } << \new Voice { \voiceOne \partcombine \sopnotes \altnotes } \new Voice { \voiceTwo \partcombine \tennotes \basnotes } >> \new Staff = "sopalt" \with { instrumentName = "SA" shortInstrumentName = "SA" \override VerticalAxisGroup.remove-layer = 2 \override VerticalAxisGroup.keep-alive-group = #'sopalt \override VerticalAxisGroup.keep-alive-group-layer = 2 } \partcombine \sopnotes \altnotes \new Staff = "sop" \with { instrumentName = "S" shortInstrumentName = "S" \override VerticalAxisGroup.remove-layer = 1 \override VerticalAxisGroup.keep-alive-group = #'sopalt \override VerticalAxisGroup.keep-alive-group-layer = 2 } \sopnotes \new Staff = "alt" \with { instrumentName = "A" shortInstrumentName = "A" \override VerticalAxisGroup.remove-layer = 1 \override VerticalAxisGroup.keep-alive-group = #'sopalt \override VerticalAxisGroup.keep-alive-group-layer = 2 } \altnotes \new Staff = "tenbas" \with { instrumentName = "TB" shortInstrumentName = "TB" \override VerticalAxisGroup.remove-layer = 2 \override VerticalAxisGroup.keep-alive-group = #'tenbas \override VerticalAxisGroup.keep-alive-group-layer = 2 } \partcombine \tennotes \basnotes \new Staff = "ten" \with { instrumentName = "T" shortInstrumentName = "T" \override VerticalAxisGroup.remove-layer = 1 \override VerticalAxisGroup.keep-alive-group = #'tenbas \override VerticalAxisGroup.keep-alive-group-layer = 2 } \tennotes \new Staff = "bas" \with { instrumentName = "B" shortInstrumentName = "B" \override VerticalAxisGroup.remove-layer = 1 \override VerticalAxisGroup.keep-alive-group = #'tenbas \override VerticalAxisGroup.keep-alive-group-layer = 2 } \basnotes >> }