Hi everyone!

Please consider the following problem: a work for a soloist and
accompaniment in which there is an «alternative» part. For instance, a work
for flute and guitar which the composer allows to be played on violin. The
solo parts are almost identical, and differ only in isolated places.
Following the example, I'd like to generate a flute part, a violin part and
a score in which the flute is printed in full and the violin part is only
shown in the form of ossias. This MWE shows the idea:

version "2.24.1"

music = \relative {
  c'4 d e f |
  \tag #'vl {g a b c}
  \tag #'fl {g f d c} |
  g' g g g |
}

musicoss = \relative {
  \stopStaff s1 |
  \startStaff g'4 a b c |
  \stopStaff s1 |
}

\markup{flute part}
\score { \new Staff \keepWithTag #'fl \music }
\markup{violin part}
\score { \new Staff \keepWithTag #'vl \music }
\markup{score}
\score {
  \new StaffGroup
  <<
   \new Staff \with {
      \remove Time_signature_engraver
      \hide Clef
      \magnifyStaff #2/3
      \RemoveAllEmptyStaves
    } \musicoss
   \new Staff \keepWithTag #'fl \music
 >>
}

Is there a way of automatically generate \musicoss from \music? For if it
is, everything can be made from only one musical source.
Hope someone has an idea. I looked for it in LSR and in the lilypond-user
archives to no avail. But perhaps the answer is obvious.

Thank you in advance!

F.

Reply via email to