At 18:24 on 16 Sep 2016, Urs Liska wrote:
>Hi all,
>
>thanks so far for the links. When that recent thread went by I didn't
>realize that it might be relevant to me so soon ...

As mentioned, this mostly works at the moment. The additional part I'm
currently working on (well, trying to find time to work on) is allowing
different groups of instruments to combine and separate independently.
See attachments for how this works. NB this code is not yet merged, or
even ready for review. 

>Am 16.09.2016 um 17:29 schrieb Urs Liska:
>>
>> Hi all,
>>
>> I have a question regarding complicated orchestral material. Note
>> that I don't need a solution right now, only a plausible estimate if
>> that's possible to implement at all.
>>
>> Consider the situation of a staff with two partcombined voices (say,
>> flutes). If there are spots (measures or ranges of measures) where
>> the voices are so individualized or complex that the part combination
>> becomes unreadable I would like to split this range (measure) to two
>> individual staves.
>>
>> The attached image shows the (manually constructed) intended result.
>> Let's assume I would consider m. 7 too complex to be combined and
>> therefore want the whole "current" system to be split in two staves.
>>
>> The ideal way would be to have an automatic function that I can call
>> within such a measure (tagging it as "non-combinable") that would:
>>
>>   * Determine in which system I'm currently in and from where to
>> where it spans (i.e. previous and next line break)
>>   * Create a temporary staff for exactly that range
>>   * Copy the music of the second voice to that staff
>>   * remove the second voice from the current staff
>>   * (suppress partcombine texts)
>>
>> In the potential score at hand the music will be maintained in a
>> measure based grid. That means if I could get just the first of these
>> (i.e.. determining the current and previous line breaks) I *might* be
>> able to achieve something. But it would be a great feature (and a
>> "selling point" for LilyPond) if we could integrate it. I got this
>> request from a professional engraver who says it's a problem he's
>> dealing with all the time: manually handling the combination and
>> temporary splitting of voices in a staff - and especially fixing
>> things if the line breaking happens to change. He said it would be a
>> dramatic advantage if LilyPond could do that automatically.
>>
>> Any suggestions welcome.
>>
>> Urs
-- 
Mark Knoop
\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
  >>
}

Attachment: divisiproblem.pdf
Description: Adobe PDF document

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to