lilypond-user
[Top][All Lists]
Advanced

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

Re:Keep alive together - call for use cases


From: Mats Bengtsson
Subject: Re:Keep alive together - call for use cases
Date: Fri, 19 Aug 2016 18:02:07 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

I've been working on some patches to enable more flexible uses for the
Keep_alive_together_engraver. Whilst I've achieved my particular use
case, David K is (rightly) keen that any changes might also address (or
at least not rule out) other potential improvements.

(If you're interested in the code, look here:
https://codereview.appspot.com/308910043/)

So if I could ask users for any situations where they can imagine this
engraver helping, that currently don't work, or don't work easily. I'll
start by describing my case, which came up on the list recently.
I recently typeset a concerto grosso from the baroque period, where the solo and tutti parts are identical during long sections and then they differ for some bars, every here and there. When entering the parts, I used tags to handle the differences so producing the separate parts works without problem. However, in the conductors score, I would prefer to only use a single stave per instrument when the solo and tutti play in unison, but individual staves when they differ. I managed to handle this using remove-layer as long as there's only a single instrument group that contains and occasional solo part, but if for example both violin 1 and violin 2 have a solo plus a tutti, then I didn't manage to get it to work correctly. The following example shows my current attempt. As can be seen, the split between solo and tutti parts happens both for violin 1 and 2 as soon as one of them is split. For example, in the second score line, I would like to see Vi I solo, Vi I tutti but only one stave with Vi II.

\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 StaffGroup <<
    \new GrandStaff <<
      \new Staff \with {instrumentName = #"Violin I solo"
            shortInstrumentName = "Vi I solo"
            \override VerticalAxisGroup.remove-empty = ##t
            \override VerticalAxisGroup.remove-first = ##t
\override VerticalAxisGroup.remove-layer = 1 } \pushToTag #'viIsolo \unset Staff.keepAliveInterfaces \appendToTag #'viIsolo \set Staff.keepAliveInterfaces = #'() \keepWithTag #'viIsolo {\set Staff.keepAliveInterfaces = #'() \viI }
      \new Staff \with {instrumentName = #"Violin II solo"
            shortInstrumentName = "Vi II solo"
            \override VerticalAxisGroup.remove-empty = ##t
            \override VerticalAxisGroup.remove-first = ##t
\override VerticalAxisGroup.remove-layer = 1 } \pushToTag #'viIIsolo \unset Staff.keepAliveInterfaces \appendToTag #'viIIsolo \set Staff.keepAliveInterfaces = #'() \keepWithTag #'viIIsolo {\set Staff.keepAliveInterfaces = #'() \viII }
    >>
    \new GrandStaff <<
      \new Staff \with {instrumentName = #"Violin I tutti"
            shortInstrumentName = "Vi I tutti"
            \override VerticalAxisGroup.remove-empty = ##t
            \override VerticalAxisGroup.remove-first = ##t
\override VerticalAxisGroup.remove-layer = 1 } \pushToTag #'viItutti \unset Staff.keepAliveInterfaces \appendToTag #'viItutti \set Staff.keepAliveInterfaces = #'() \keepWithTag #'viItutti {\set Staff.keepAliveInterfaces = #'() \viI }
      \new Staff \with {instrumentName = #"Violin I"
            shortInstrumentName = "Vi I"
\override VerticalAxisGroup.remove-layer = 2 } \pushToTag #'viIsolo \unset Staff.keepAliveInterfaces \appendToTag #'viIsolo \set Staff.keepAliveInterfaces = #'() \keepWithTag #'viIsolo {\set Staff.keepAliveInterfaces = #'() \viI }
      \new Staff \with {instrumentName = #"Violin II tutti"
            shortInstrumentName = "Vi II tutti"
            \override VerticalAxisGroup.remove-empty = ##t
            \override VerticalAxisGroup.remove-first = ##t
\override VerticalAxisGroup.remove-layer = 1 } \pushToTag #'viIItutti \unset Staff.keepAliveInterfaces \appendToTag #'viIItutti \set Staff.keepAliveInterfaces = #'() \keepWithTag #'viIItutti {\set Staff.keepAliveInterfaces = #'() \viII }
      \new Staff \with {instrumentName = #"Violin II"
            shortInstrumentName = "Vi II"
\override VerticalAxisGroup.remove-layer = 2 } \pushToTag #'viIIsolo \unset Staff.keepAliveInterfaces \appendToTag #'viIIsolo \set Staff.keepAliveInterfaces = #'() \keepWithTag #'viIIsolo {\set Staff.keepAliveInterfaces = #'() \viII }
    >>
  >>
  \layout{
    \context{
      \Score
      \consists "Keep_alive_together_engraver"
    }
  }
}


I have to admit that I don't fully understand the Keep_alive_together_engraver so it may certainly be that use case already can be handled. Also, the input could obviously look less messy by introducing some macros, but it's my first quic attempt.

    /Mats



reply via email to

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