bug-lilypond
[Top][All Lists]
Advanced

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

Re: revitalizing a whole GrandStaff if only one Staff is alive


From: Phil Holmes
Subject: Re: revitalizing a whole GrandStaff if only one Staff is alive
Date: Wed, 10 Oct 2012 09:59:09 +0100

"Eluze" <address@hidden> wrote in message news:address@hidden
I suggest to add

after NR: /Hiding staves/ a section should be added to explain how to keep
alive a full GrandStaff even if only one of its staves is alive

*Showing the full GrandStaff if only one Staff is playing*

if one instrument of a GrandStaff is playing, sometimes it is better to
display /all/ the instruments (staves) of the GrandStaff

with \removeEmptyStaves in the Staff context and \consists
Keep_alive_together_engraver in the GrandStaff context the whole GrandStaff
(and not only a single, non-empty Staff) is displayed

-- snippet
% (the shortInstrumentName is added to easily spot where which staff is
alive)

\score{
 \relative c' <<
   \new StaffGroup = "StaffGroup_woodwinds" <<
\new Staff = "Staff_flute" \with { shortInstrumentName = "Fl"} \repeat
unfold 20 { c'4 c c c }
\new Staff = "Staff_oboe" \with { shortInstrumentName = "Ob"} \repeat
unfold 20 { b4 b b b }
   >>
   \new StaffGroup = "StaffGroup_Strings" <<
     \new GrandStaff = "GrandStaff_violins" \with { shortInstrumentName =
"Vi"} <<
       \new Staff = "Staff_violinI" { \repeat unfold 19 { s1 } a -"this
note to revive the staff" }
       \new Staff = "Staff_violinII" { \repeat unfold 20 { s1 } }
     >>
\new Staff = "Staff_viola" \with { shortInstrumentName = "Va"} \repeat
unfold 20 { \clef alto e4 e e e }
\new Staff = "Staff_cello" \with { shortInstrumentName = "Ce"} \repeat
unfold 20 { \clef bass c,1 }
   >>
 >>
}
\layout {
 \context {
   \GrandStaff
   \consists Keep_alive_together_engraver
 }
 \context {
   \Staff
   \RemoveEmptyStaves
 }
}

-- endsnippet

thanks to Alex Voice for his example and for your comments!
Eluze


Why don't you add this as a snippet to the LSR, and tag is with "docs". That way it will automatically appear in the snippets documentation, and you can request a doc change to add the snippet.

--
Phil Holmes
Bug Squad




reply via email to

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