Le 11 nov. 2009 à 16:07, Reinhold Kainhofer a écrit :

Now, this is a problem, if the whole score consists of several different parts.
For example, I have a choral score with fugues and a soprano solo.
during the fugues, none of the staves should be removed (if e.g. the Alto sets in 9 measures later, I still need the empty staff for them them), but during
the soprano solo, the alto, tenor and bass should be removed.

By adding the rest-interface to Score.keepAliveInterface, you prevent
a staff from being removed when there are rests.

startUnremovableSection = \set Staff.keepAliveInterfaces =
    #'(rhythmic-grob-interface
    rest-interface
    lyric-interface
    percent-repeat-item-interface
    percent-repeat-interface
    stanza-number-interface)

endUnremovableSection = \unset Staff.keepAliveInterfaces

\score {
  <<
    \new Staff {
      \startUnremovableSection
      c'1 R R c'
      \endUnremovableSection
      e'1 R R e'
    }
    \new Staff {
      \clef "bass" \repeat unfold 8 { c1 \break }
    }
  >>
  \layout {
    \context { \RemoveEmptyStaffContext }
  }
}



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

Reply via email to