Hi,

Am 29.06.20 um 14:41 schrieb Aberforth D - Instrumentals:
It works although it doesn't seem to work when applied to the first bar on the staff, but I guess it's good enough.

Do you mean that the staff is not removed in the first system? That's just the difference between \RemoveEmptyStaves und \RemoveAllEmptyStaves.

I would still be grateful if somebody could answer my second question because it might be useful in specific circumstances. Namely, how to hide a redundant staff when it doubles another staff without having to replace the notes by rests, as described in my original message.

The keepAliveInterfaces list defines which types of "event" prevent a staff from being removed. So:

%%%%
\version "2.20.0"
\language "english"

\layout {
  \context {
    \Staff
    \RemoveAllEmptyStaves
  }
}

killMeAtAllCosts = \set Staff.keepAliveInterfaces = #'()
resurrectMe = \undo \killMeAtAllCosts

fillBar = \relative c' { g'8[ g g g g g] | }
fillLine = { \fillBar \fillBar \fillBar \fillBar }

partA = {
  \key d \major \time 6/8 \clef "G"
  \fillLine \break
  \killMeAtAllCosts \fillLine \break \resurrectMe
  \fillLine
}

partB = {
  \key d \major \time 6/8 \clef "G"
  \fillLine
  \fillLine
  \fillLine
}

\score {
  <<
    \new Staff \with { shortInstrumentName = "Pt A" } \partA
    \new Staff \with { shortInstrumentName = "Pt B" } \partB
  >>
}

%%%%

Lukas


Reply via email to