lilypond-devel
[Top][All Lists]
Advanced

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

Re: Group contexts in the Keep_alive_together_engraver (issue 310230043


From: mark . opus11
Subject: Re: Group contexts in the Keep_alive_together_engraver (issue 310230043 by address@hidden)
Date: Fri, 16 Sep 2016 11:25:17 -0700

% example usage
\version "2.19.49"
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
}
soplyrics = \lyricmode {
  \repeat unfold 4 la
  \repeat unfold 9 la
  \repeat unfold 32 la
  \repeat unfold 18 la
}
altlyrics = \lyricmode {
  \repeat unfold 4 la
  \repeat unfold 9 la
  \repeat unfold 32 hi
  \repeat unfold 18 la
}
tenlyrics = \lyricmode {
  \repeat unfold 4 la
  \repeat unfold 9 di
  \repeat unfold 56 do
}
baslyrics = \lyricmode {
  \repeat unfold 4 la
  \repeat unfold 9 di
  \repeat unfold 56 dum
}

\layout {
  short-indent = 8
  \context {
    \StaffGroup
    \consists Keep_alive_together_engraver
  }
  \context {
    \Staff
    \override VerticalAxisGroup.remove-first = ##t
    \override VerticalAxisGroup.remove-empty = ##t
  }
  \context {
    \Lyrics
    \override VerticalAxisGroup.remove-layer = #'above
    keepAliveInterfaces = #'()
  }
}

\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 { \partcombine \sopnotes \altnotes }
      \new Voice { \partcombine \tennotes \basnotes }
    >>
    \addlyrics \soplyrics

    \new Staff = "sopalt" \with {
      instrumentName = "SA"
      shortInstrumentName = "SA"
      \override VerticalAxisGroup.remove-layer = 2
      \override VerticalAxisGroup.keep-alive-group = #'sopalt
    } <<
      \partcombine \sopnotes \altnotes
      \new NullVoice = "saalign" \sopnotes
    >>
    \new Lyrics \lyricsto "saalign" \soplyrics

    \new Staff = "sop" \with {
      instrumentName = "S"
      shortInstrumentName = "S"
      \override VerticalAxisGroup.remove-layer = 1
      \override VerticalAxisGroup.keep-alive-group = #'sopalt
    } \sopnotes
    \addlyrics \soplyrics

    \new Staff = "alt" \with {
      instrumentName = "A"
      shortInstrumentName = "A"
      \override VerticalAxisGroup.remove-layer = 1
      \override VerticalAxisGroup.keep-alive-group = #'sopalt
    } \altnotes
    \addlyrics \altlyrics

    \new Staff = "tenbas" \with {
      instrumentName = "TB"
      shortInstrumentName = "TB"
      \override VerticalAxisGroup.remove-layer = 2
      \override VerticalAxisGroup.keep-alive-group = #'tenbas
    } <<
      \partcombine \tennotes \basnotes
      \new NullVoice = "tbalign" \tennotes
    >>
    \new Lyrics \lyricsto "tbalign" \tenlyrics

    \new Staff = "ten" \with {
      instrumentName = "T"
      shortInstrumentName = "T"
      \override VerticalAxisGroup.remove-layer = 1
      \override VerticalAxisGroup.keep-alive-group = #'tenbas
    } \tennotes
    \addlyrics \tenlyrics

    \new Staff = "bas" \with {
      instrumentName = "B"
      shortInstrumentName = "B"
      \override VerticalAxisGroup.remove-layer = 1
      \override VerticalAxisGroup.keep-alive-group = #'tenbas
    } \basnotes
    \addlyrics \baslyrics
  >>
}

https://codereview.appspot.com/310230043/



reply via email to

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