]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/displaying-a-whole-grandstaff-system-if-only-one-of-its-staves-is-alive.ly
Imported Upstream version 2.19.45
[lilypond.git] / Documentation / snippets / displaying-a-whole-grandstaff-system-if-only-one-of-its-staves-is-alive.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.di.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.18.0"
8
9 \header {
10   lsrtags = "contexts-and-engravers"
11
12   texidoc = "
13 In orchestral scores sometimes single or groups of instruments are
14 silent for a while and their staves can be removed for that time (with
15 @code{\\removeEmptyStaves}).
16
17
18 When they play again it is often preferred to show the staves of all
19 instruments of such a group. this can be done adding the
20 @code{Keep_alive_together_engraver} in the grouper (e.g. a GrandStaff
21 or a StaffGroup)
22
23
24 In the example the violins are silent in the 2nd system and in the 3rd
25 system. Only the first violin plays the last measure but the staff of
26 the second violin is also displayed.
27
28 "
29   doctitle = "Displaying a whole GrandStaff system if only one of its staves is alive"
30 } % begin verbatim
31
32 \score {
33   <<
34     \new StaffGroup = "StaffGroup_woodwinds"
35     <<
36       \new Staff = "Staff_flute" \with {
37         instrumentName = "Flute"
38         shortInstrumentName = "Fl"
39       }
40       \relative c' {
41         \repeat unfold 3 { c'4 c c c | c c c c | c c c c | \break }
42       }
43     >>
44     \new StaffGroup = "StaffGroup_Strings"
45     <<
46       \new GrandStaff = "GrandStaff_violins"
47       <<
48         \new Staff = "StaffViolinI" \with {
49           instrumentName = "Violin I"
50           shortInstrumentName = "Vi I"
51         }
52         \relative c'' {
53           a1 \repeat unfold 7 { s1 } \repeat unfold 12 a16  a4
54         }
55         \new Staff = "StaffViolinII" \with {
56           instrumentName = "Violin II"
57           shortInstrumentName = "Vi II"
58         }
59         \relative c' { e1 \repeat unfold 8 { s1 } }
60       >>
61       \new Staff = "Staff_cello" \with {
62         instrumentName = "Cello"
63         shortInstrumentName = "Ce"
64       }
65       \relative c { \clef bass \repeat unfold 9 { c1 }}
66     >>
67   >>
68 }
69 \layout {
70   indent = 3.0\cm
71   short-indent = 1.5\cm
72   \context {
73     \GrandStaff
74     \consists Keep_alive_together_engraver
75   }
76   \context {
77     \Staff
78     \RemoveEmptyStaves
79   }
80 }