Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3106)

Issue 310230043: Group contexts in the Keep_alive_together_engraver

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 7 months ago by mark_opus11.net
Modified:
7 years, 7 months ago
Reviewers:
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Group contexts in the Keep_alive_together_engraver This introduces a `VerticalAxisGroup.keep-alive-group' property which can be set to a symbol to associate a subset of contexts under the control of the same Keep_alive_together_engraver. This group operates only up to the highest `remove-layer` level of its members.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -0 lines) Patch
M lily/hara-kiri-group-spanner.cc View 1 chunk +1 line, -0 lines 0 comments Download
M lily/keep-alive-together-engraver.cc View 3 chunks +35 lines, -0 lines 0 comments Download
M scm/define-grob-properties.scm View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 2
mark_opus11.net
This patch allows independent sub-groups to operate in the Keep_alive_together_engraver. For example, it may be ...
7 years, 7 months ago (2016-09-16 18:23:13 UTC) #1
mark_opus11.net
7 years, 7 months ago (2016-09-16 18:25:18 UTC) #2
% 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
  >>
}
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b