lilypond-user
[Top][All Lists]
Advanced

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

Concerto Grosso scores? Was: Question about condensed score


From: Mats Bengtsson
Subject: Concerto Grosso scores? Was: Question about condensed score
Date: Tue, 15 Aug 2023 11:25:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0


On 2023-08-14 19:46, David Kastrup wrote:
Sounds somewhat like


exa.ly

%%%
\version "2.24.1"

global = {
   s1\break
   s1\break
   s1
}

flOne = \relative c' {
   e1
   r1
   e1
}

flTwo = \relative c' {
   c1
   r1
   c1
}

\new StaffGroup \with { \consists "Keep_alive_together_engraver" }

<<
   \new Staff \with {
     \RemoveAllEmptyStaves
     \override VerticalAxisGroup.remove-layer = 1
     instrumentName = "Flute 1"
     shortInstrumentName = "Fl. 1"
   } <<\global \flOne>>
   \new Staff \with {
     \RemoveAllEmptyStaves
     \override VerticalAxisGroup.remove-layer = 1
     instrumentName = "Flute 2"
     shortInstrumentName = "Fl. 2"
   } <<\global \flTwo>>
   \new Staff \with {
     instrumentName = "Flutes"
     shortInstrumentName = "Fl. 1-2"
     \override VerticalAxisGroup.remove-layer = 2
   } \partCombine \flOne \flTwo

I've been trying for a while to extend this approach to handle a typical Concerto Grosso score with multiple solo parts, where I want to keep the solo parts in a separate GrandStaff and the tutti parts in another GrandStaff below. The following example is very close to what I would like, and doesn't even need the Keep_alive_together_engraver, it's enough to play around with the keepAliveInterfaces:

\version "2.24.0"

\layout{
  short-indent = 2\cm
  indent = 3\cm
  \context{
    \Staff
    \RemoveAllEmptyStaves
  }
}

viI = \fixed c'{
  \repeat unfold 10 {c2 e | }
  \tag #'viIsolo {
       \unset Staff.keepAliveInterfaces
       \repeat unfold 10 {c'4 d' e' f' }
       \set Staff.keepAliveInterfaces = #'()
     }
  \tag #'viItutti {\repeat unfold 10 {e1 }}
  \repeat unfold 10 {c2 e | }
}

viII = \fixed c'{
  \repeat unfold 10 {c2 c | }
  \tag #'viIIsolo {
    \unset Staff.keepAliveInterfaces
    \repeat unfold 5 {e4 g e c }
        \set Staff.keepAliveInterfaces = #'()
       }
  \tag #'viIItutti {\repeat unfold 5 {c1 }}
  \repeat unfold 15 {c2 c | }
}

\score{
  <<
    \new GrandStaff <<
      \new Staff \with {instrumentName = "Violin I Solo" shortInstrumentName = "Vi I Solo" }         { \set Staff.keepAliveInterfaces = #'() \keepWithTag #'viIsolo \viI }       \new Staff \with {instrumentName = "Violin II Solo" shortInstrumentName = "Vi II Solo" }         { \set Staff.keepAliveInterfaces = #'() \keepWithTag #'viIIsolo \viII }
    >>
    \new GrandStaff <<
      \new Staff \with {instrumentName = "Violin I" shortInstrumentName = "Vi I "}
        \keepWithTag #'viItutti \viI
      \new Staff \with {instrumentName = "Violin II" shortInstrumentName = "Vi II" }
        \keepWithTag #'viIItutti \viII
    >>
  >>
  \layout{}
}

I can even automate it a bit, using pushToTag and appendToTag:

\version "2.24.0"

\layout{
  short-indent = 2\cm
  indent = 3\cm
  \context{
    \Staff
    \RemoveAllEmptyStaves
  }
}

viI = \fixed c'{
  \repeat unfold 10 {c2 e | }
  \tag #'viIsolo { \repeat unfold 10 {c'4 d' e' f' } }
  \tag #'viItutti {\repeat unfold 10 {e1 }}
  \repeat unfold 10 {c2 e | }
}

viII = \fixed c'{
  \repeat unfold 10 {c2 c | }
  \tag #'viIIsolo { \repeat unfold 5 {e4 g e c } }
  \tag #'viIItutti {\repeat unfold 5 {c1 }}
  \repeat unfold 15 {c2 c | }
}

\score{
  <<
    \new GrandStaff <<
      \new Staff \with {instrumentName = "Violin I Solo" shortInstrumentName = "Vi I Solo" }
        { \set Staff.keepAliveInterfaces = #'()
      \pushToTag #'viIsolo { \unset Staff.keepAliveInterfaces }
      \appendToTag #'viIsolo { \set Staff.keepAliveInterfaces = #'()}
      \keepWithTag #'viIsolo \viI }
      \new Staff \with {instrumentName = "Violin II Solo" shortInstrumentName = "Vi II Solo" }
        { \set Staff.keepAliveInterfaces = #'()
      \pushToTag #'viIIsolo { \unset Staff.keepAliveInterfaces }
      \appendToTag #'viIIsolo { \set Staff.keepAliveInterfaces = #'()}
      \keepWithTag #'viIIsolo \viII }
    >>
    \new GrandStaff <<
      \new Staff \with {instrumentName = "Violin I" shortInstrumentName = "Vi I "}
        \keepWithTag #'viItutti \viI
      \new Staff \with {instrumentName = "Violin II" shortInstrumentName = "Vi II" }
        \keepWithTag #'viIItutti \viII
    >>
  >>
  \layout{}
}

The only remaining problem is if I want to to have different shortInstrumentNames in the lower GrandStaff; "Vi tutti" if the solo part is playing in parallel and "Vi unis." if the solo and tutti play in unison. As long as there's a single solo part, I can obtain it using the trick described in David's example above with Keep_alive_together_engraver (at the Score level) and different remove-layer values, but that doesn't extend to the case of multiple solo instruments, since the action of the Keep_alive_together_engraver should be done separately for the group of "Vi I Solo", "Vi I tutti" and "Vi I unis", and for the group of "Vi II Solo", "Vi II tutti" and "Vi II unis". Since this logical grouping of staves is orthogonal to the way they are split in GrandStaffs in the score, I cannot see any way to implement that.

An almost working alternative, would be to change the value of shortInstrumentName on the fly, but if a solo part only spans part of a staff line, the shortInstrumentName will change back again before the correct version is typeset, so it will only work if line breaks happen to end up at the right place.

Any clever ideas, or have I hit a hard limitation?

    /Mats




reply via email to

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