At 21:13 on 19 Aug 2016, David Kastrup wrote:
>Mark Knoop <[email protected]> writes:
>> Hi Mats,
>>
>> How does the attached look to you? Note I have moved the
>> Keep_alive_together_engraver to the GrandStaff level so that the vln
>> I and vln II groups can work independently. The problem now is
>> making the system start braces cooperate.  
>
>I think we should likely have some context with only
>Keep_alive_engraver in it and accepting all sorts of Staff contexts.
>That would likely be more natural than juggling manually with
>Keep_alive_engraver.

I've just submitted an additional patch which I think addresses the
uses raised by Mats, Kieren and Abraham. See attached ly and pdf files. 

Comments, particularly on usability, appreciated.

-- 
Mark Knoop
\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
  >>
}

Attachment: divisiproblem.pdf
Description: Adobe PDF document

\version "2.19.40"

viI = \relative c'' {
   \repeat unfold 8 { c4 d e d | }
   \tag #'viIsolo { \repeat unfold 4 { c16 d e f g f e d } }
   \tag #'viItutti { \repeat unfold 2 { c1 } }
   \repeat unfold 24 { c4 d e d | }
}

viII = \relative c' {
   \repeat unfold 16 { g4 c a b | }
   \tag #'viIIsolo { \repeat unfold 4 { g16 c e c g c e c } }
   \tag #'viIItutti { \repeat unfold 2 { g1 } }
   \repeat unfold 16 { g4 c a b | }
}

\paper {
   left-margin = 25\mm
}

\score {
  <<
    \new GrandStaff <<
      \new Staff = "vlnisolo" \with {
        instrumentName = #"Violin I solo"
        shortInstrumentName = "Vi I solo"
        \override VerticalAxisGroup.remove-empty = ##t
        \override VerticalAxisGroup.remove-first = ##t
        \override VerticalAxisGroup.remove-layer = 1
        \override VerticalAxisGroup.keep-alive-group = #'vlni
      }
      \pushToTag #'viIsolo \unset Staff.keepAliveInterfaces
      \appendToTag #'viIsolo \set Staff.keepAliveInterfaces = #'()
      \keepWithTag #'viIsolo { \set Staff.keepAliveInterfaces = #'() \viI }
      \new Staff = "vlniisolo" \with {
        instrumentName = #"Violin II solo"
        shortInstrumentName = "Vi II solo"
        \override VerticalAxisGroup.remove-empty = ##t
        \override VerticalAxisGroup.remove-first = ##t
        \override VerticalAxisGroup.remove-layer = 1
        \override VerticalAxisGroup.keep-alive-group = #'vlnii
      }
      \pushToTag #'viIIsolo \unset Staff.keepAliveInterfaces
      \appendToTag #'viIIsolo \set Staff.keepAliveInterfaces = #'()
      \keepWithTag #'viIIsolo { \set Staff.keepAliveInterfaces = #'() \viII }
    >>
    \new GrandStaff <<
      \new Staff = "vlni" \with {
        instrumentName = #"Violin I"
        shortInstrumentName = "Vi I"
        \override VerticalAxisGroup.remove-empty = ##t
        \override VerticalAxisGroup.remove-first = ##t
        \override VerticalAxisGroup.remove-layer = 1
        \override VerticalAxisGroup.keep-alive-group = #'vlni
      }
      \pushToTag #'viItutti \unset Staff.keepAliveInterfaces
      \appendToTag #'viItutti \set Staff.keepAliveInterfaces = #'()
      \keepWithTag #'viItutti { \set Staff.keepAliveInterfaces = #'() \viI }
      \new Staff = "vlnitutti" \with {
        instrumentName = #"Violin I tutti"
        shortInstrumentName = "Vi I tutti"
        \override VerticalAxisGroup.remove-layer = 2
        \override VerticalAxisGroup.keep-alive-group = #'vlni
      }
      \pushToTag #'viItutti \unset Staff.keepAliveInterfaces
      \appendToTag #'viItutti \set Staff.keepAliveInterfaces = #'()
      \keepWithTag #'viItutti { \set Staff.keepAliveInterfaces = #'() \viI }
      \new Staff = "vlnii" \with {
        instrumentName = #"Violin II"
        shortInstrumentName = "Vi II"
        \override VerticalAxisGroup.remove-empty = ##t
        \override VerticalAxisGroup.remove-first = ##t
        \override VerticalAxisGroup.remove-layer = 1
        \override VerticalAxisGroup.keep-alive-group = #'vlnii
      }
      \pushToTag #'viIItutti \unset Staff.keepAliveInterfaces
      \appendToTag #'viIItutti \set Staff.keepAliveInterfaces = #'()
      \keepWithTag #'viIItutti { \set Staff.keepAliveInterfaces = #'() \viII }
      \new Staff = "vlniitutti" \with {
        instrumentName = #"Violin II tutti"
        shortInstrumentName = "Vi II tutti"
        \override VerticalAxisGroup.remove-layer = 2
        \override VerticalAxisGroup.keep-alive-group = #'vlnii
      }
      \pushToTag #'viIItutti \unset Staff.keepAliveInterfaces
      \appendToTag #'viIItutti \set Staff.keepAliveInterfaces = #'()
      \keepWithTag #'viIItutti { \set Staff.keepAliveInterfaces = #'() \viII }
    >>
  >>
  \layout {
    \context {
      \Score
      \consists Keep_alive_together_engraver
    }
  }
}

Attachment: matsbengtsson.pdf
Description: Adobe PDF document

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to