]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/orchestra,-choir-and-piano-template.ly
Snippets: Replace \set Staff.instrumentName
[lilypond.git] / Documentation / snippets / new / orchestra,-choir-and-piano-template.ly
1 \version "2.19.56"
2
3 \header {
4   lsrtags = "pitches, staff-notation, template, vocal-music"
5
6   texidoc = "
7 This template demonstrates the use of nested @code{StaffGroup} and
8 @code{GrandStaff} contexts to sub-group instruments of the same type
9 together, and a way to use @code{\\transpose} so that variables hold
10 music for transposing instruments at concert pitch.
11
12 "
13   doctitle = "Orchestra choir and piano template"
14 } % begin verbatim
15
16 #(set-global-staff-size 17)
17 \paper {
18   indent = 3.0\cm  % add space for instrumentName
19   short-indent = 1.5\cm  % add less space for shortInstrumentName
20 }
21
22 fluteMusic = \relative c' { \key g \major g'1 b }
23
24 % Pitches as written on a manuscript for Clarinet in A
25 % are transposed to concert pitch.
26
27 clarinetMusic = \transpose c' a
28   \relative c'' { \key bes \major bes1 d }
29
30 trumpetMusic = \relative c { \key g \major g''1 b }
31
32 % Key signature is often omitted for horns
33
34 hornMusic = \transpose c' f
35   \relative c { d'1 fis }
36
37 percussionMusic = \relative c { \key g \major g1 b }
38
39 sopranoMusic = \relative c'' { \key g \major g'1 b }
40
41 sopranoLyrics = \lyricmode { Lyr -- ics }
42
43 altoIMusic = \relative c' { \key g \major g'1 b }
44
45 altoIIMusic = \relative c' { \key g \major g'1 b }
46
47 altoILyrics =  \sopranoLyrics
48
49 altoIILyrics = \lyricmode { Ah -- ah }
50
51 tenorMusic = \relative c' { \clef "treble_8" \key g \major g1 b }
52
53 tenorLyrics = \sopranoLyrics
54
55 pianoRHMusic = \relative c { \key g \major g''1 b }
56
57 pianoLHMusic = \relative c { \clef bass \key g \major g1 b }
58
59 violinIMusic = \relative c' { \key g \major g'1 b }
60
61 violinIIMusic = \relative c' { \key g \major g'1 b }
62
63 violaMusic = \relative c { \clef alto \key g \major g'1 b }
64
65 celloMusic = \relative c { \clef bass \key g \major g1 b }
66
67 bassMusic = \relative c { \clef "bass_8" \key g \major g,1 b }
68
69 \score {
70   <<
71     \new StaffGroup = "StaffGroup_woodwinds" <<
72       \new Staff = "Staff_flute" \with { instrumentName = #"Flute" }
73       \fluteMusic
74
75       \new Staff = "Staff_clarinet" \with {
76         instrumentName = \markup { \concat { "Clarinet in B" \flat } }
77       }
78
79       % Declare that written Middle C in the music
80       % to follow sounds a concert B flat, for
81       % output using sounded pitches such as MIDI.
82       %\transposition bes
83
84       % Print music for a B-flat clarinet
85       \transpose bes c' \clarinetMusic
86     >>
87
88     \new StaffGroup = "StaffGroup_brass" <<
89       \new Staff = "Staff_hornI" \with { instrumentName = #"Horn in F" }
90        % \transposition f
91         \transpose f c' \hornMusic
92
93       \new Staff = "Staff_trumpet" \with { instrumentName = #"Trumpet in  C" }
94       \trumpetMusic
95
96     >>
97     \new RhythmicStaff = "RhythmicStaff_percussion"
98     \with { instrumentName = #"Percussion" }
99     <<
100       \percussionMusic
101     >>
102     \new PianoStaff \with { instrumentName = #"Piano" }
103     <<
104       \new Staff { \pianoRHMusic }
105       \new Staff { \pianoLHMusic }
106     >>
107     \new ChoirStaff = "ChoirStaff_choir" <<
108       \new Staff = "Staff_soprano" \with { instrumentName = #"Soprano" }
109       \new Voice = "soprano"
110       \sopranoMusic
111
112       \new Lyrics \lyricsto "soprano" { \sopranoLyrics }
113       \new GrandStaff = "GrandStaff_altos"
114       \with { \accepts Lyrics } <<
115         \new Staff = "Staff_altoI"  \with { instrumentName = #"Alto I" }
116         \new Voice = "altoI"
117         \altoIMusic
118
119         \new Lyrics \lyricsto "altoI" { \altoILyrics }
120         \new Staff = "Staff_altoII" \with { instrumentName = #"Alto II" }
121         \new Voice = "altoII"
122         \altoIIMusic
123
124         \new Lyrics \lyricsto "altoII" { \altoIILyrics }
125       >>
126
127       \new Staff = "Staff_tenor" \with { instrumentName = #"Tenor" }
128         \new Voice = "tenor"
129         \tenorMusic
130
131       \new Lyrics \lyricsto "tenor" { \tenorLyrics }
132     >>
133     \new StaffGroup = "StaffGroup_strings" <<
134       \new GrandStaff = "GrandStaff_violins" <<
135         \new Staff = "Staff_violinI" \with { instrumentName = #"Violin I" }
136         \violinIMusic
137
138         \new Staff = "Staff_violinII" \with { instrumentName = #"Violin II" }
139         \violinIIMusic
140       >>
141
142       \new Staff = "Staff_viola" \with { instrumentName = #"Viola" }
143       \violaMusic
144
145       \new Staff = "Staff_cello" \with { instrumentName = #"Cello" }
146       \celloMusic
147
148       \new Staff = "Staff_bass" \with { instrumentName = #"Double Bass" }
149       \bassMusic
150     >>
151   >>
152   \layout { }
153 }