Mostrar un sistema GrandStaff completo si sigue con vida uno solo de sus pentagramas

A veces, en las partituras orquestales se dejan en silencio instrumentos individuales o grupos de ellos durante un período de tiempo, y sus pentagramas correspondientes se pueden suprimir durante ese tiempo (con \removeEmptyStaves).

Cuando vuelven a sonar, con frecuencia se prefiere mostrar todos los instrumentos del grupo. Esto se puede hacer añadiendo el grabador Keep_alive_together_engraver en el contexto agrupador (p.ej.: un GrandStaff o un StaffGroup)

En este ejemplo, los violines están en silencio durante los sistemas segundo y tercero. Solo el violín primero suena en el último compás, pero se muestra también el pentagrama del violín segundo.

\score {
  <<
    \new StaffGroup = "StaffGroup_woodwinds"
    <<
      \new Staff = "Staff_flute" \with {
        instrumentName = "Flute"
        shortInstrumentName = "Fl"
      }
      \relative c' {
        \repeat unfold 3 { c'4 c c c | c c c c | c c c c | \break }
      }
    >>
    \new StaffGroup = "StaffGroup_Strings"
    <<
      \new GrandStaff = "GrandStaff_violins"
      <<
        \new Staff = "StaffViolinI" \with {
          instrumentName = "Violin I"
          shortInstrumentName = "Vi I"
        }
        \relative c'' {
          a1 \repeat unfold 7 { s1 } \repeat unfold 12 a16  a4
        }
        \new Staff = "StaffViolinII" \with {
          instrumentName = "Violin II"
          shortInstrumentName = "Vi II"
        }
        \relative c' { e1 \repeat unfold 8 { s1 } }
      >>
      \new Staff = "Staff_cello" \with {
        instrumentName = "Cello"
        shortInstrumentName = "Ce"
      }
      \relative c { \clef bass \repeat unfold 9 { c1 }}
    >>
  >>
}

\paper { tagline = ##f }

\layout {
  indent = 3.0\cm
  short-indent = 1.5\cm
  \context {
    \GrandStaff
    \consists Keep_alive_together_engraver
  }
  \context {
    \Staff
    \RemoveEmptyStaves
  }
}

[image of music]


LilyPond snippets v2.25.15 (rama de desarrollo).