At 13:08 on 28 Jul 2016, tisimst wrote:
>Forgive me if this is the wrong place to ask this question, but can
>the new code handle nested situations?
>
>For example, let's say we have four horns. These may appear on their
>own staff, they may appear on a combined staff (e.g., "Horns 1 & 2"),
>and they may appear on a single staff together. The divisi-staves
>example works wonderfully for a single parent-child situation, but
>using the 'keepAliveInterfaces as the trigger doesn't seem to allow
>you to have more nested levels. Here's a complete compiling example. I
>tried to extend the divisi-staves code to allow for this multi-level
>nesting, but all permutations failed for me. Here's one example:

I don't think you need nesting for this, but you need to find a way to
specify the boring/tricky nature of the material at each remove-layer.
Attached is I think what you want.

Ideally we wouldn't be moving pitches to the violIandIItrickyness
and violIIIandIVtrickyness variables, you could try setting
keepAliveInterfaces to something else to trigger "interest" instead.

-- 
Mark Knoop
\version "2.19.13"

\header {
  texidoc = "The @code{VerticalAxisGroup.remove-layer}
property can be used for typesetting temporary divisi staves where
the switch to split staves is done only at line breaks such that all
complex passages are rendered in separate staves."
}

boring = \set Staff.keepAliveInterfaces = #'()
tricky = \unset Staff.keepAliveInterfaces

violI=\relative c'' {
  \boring \repeat unfold 50 c4
  \tricky <c g'>2
  \boring \repeat unfold 48 c4
  \boring <c g'>2
  \boring \repeat unfold 98 c4
  \bar "|."
}

violII=\relative g' {
  \boring \repeat unfold 100 g4
  \boring s2
  \boring \repeat unfold 98 g4
  \bar "|."
}

violIII=\relative e' {
  \boring \repeat unfold 100 e4
  \boring <e b'>2
  \boring \repeat unfold 48 e4
  \tricky <e b'>2
  \boring \repeat unfold 48 e4
  \bar "|."
}

violIV=\relative c' {
  \boring \repeat unfold 100 c4
  \boring s2
  \boring \repeat unfold 98 c4
  \bar "|."
}

violIandIItrickyness = \relative g' {
  \boring s4*50 s2 s4*48
  \tricky <g d'>2
  \boring s4*98
}

violIIIandIVtrickyness = \relative c' {
  \boring s4*50 s2 s4*48
  \tricky <c g'>2
  \boring s4*98
}

\score {
    \new StaffGroup \with {
      \consists "Keep_alive_together_engraver"
    } <<
      \new Staff \with {
        instrumentName = "Violin I"
        shortInstrumentName = "V I"
        \override VerticalAxisGroup.remove-empty = ##t
        \override VerticalAxisGroup.remove-first = ##t
        \override VerticalAxisGroup.remove-layer = 1
      } \violI
      \new Staff \with {
        instrumentName = "Violin II"
        shortInstrumentName = "V II"
        \override VerticalAxisGroup.remove-empty = ##t
        \override VerticalAxisGroup.remove-first = ##t
        \override VerticalAxisGroup.remove-layer = 1
      } \violII
      \new Staff \with {
        instrumentName = "Violin III"
        shortInstrumentName = "V III"
        \override VerticalAxisGroup.remove-empty = ##t
        \override VerticalAxisGroup.remove-first = ##t
        \override VerticalAxisGroup.remove-layer = 1
      } \violIII
      \new Staff \with {
        instrumentName = "Violin IV"
        shortInstrumentName = "V IV"
        \override VerticalAxisGroup.remove-empty = ##t
        \override VerticalAxisGroup.remove-first = ##t
        \override VerticalAxisGroup.remove-layer = 1
      } \violIV
      \new Staff \with {
        instrumentName = "Violins I&II"
        shortInstrumentName = "V I&II"
        \override VerticalAxisGroup.remove-layer = 2
        \override VerticalAxisGroup.remove-empty = ##t
        \override VerticalAxisGroup.remove-first = ##t
      } << \violI \\ \violII \violIandIItrickyness >>
      \new Staff \with {
        instrumentName = "Violins III&IV"
        shortInstrumentName = "V III&IV"
        \override VerticalAxisGroup.remove-layer = 2
        \override VerticalAxisGroup.remove-empty = ##t
        \override VerticalAxisGroup.remove-first = ##t
      } << \violIII \\ \violIV \violIIIandIVtrickyness >>
      \new Staff \with {
        instrumentName = "Violins"
        shortInstrumentName = "V I-IV"
        \override VerticalAxisGroup.remove-layer = 3
      } << \violI \\ \violII \\ \violIII \\ \violIV >>
    >>
    \layout {
      short-indent = 2\cm
      indent = 3\cm
    }
}
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to