]> git.donarmstrong.com Git - lilypond.git/blob - ly/satb.ly
Issue 4424: Add Solo voice to built-in satb.ly template
[lilypond.git] / ly / satb.ly
1 %\version "2.19.19"
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %%                                                %%
5 %%     Accompanied Choir with Multiple Verses     %%
6 %%                                                %%
7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8
9 %{
10   This file may be \include'd in a score to provide the
11   context structure for a score arrangement consisting
12   of the following staves:
13
14   Solo Staff (outside Choir grouping)
15   Descant Staff (within Choir grouping)
16   Women Staff (single voice on one staff)
17   Soprano and Alto (optionally on two Staves or one Staff each)
18   Multiple verses (up to 9)
19   Tenor and Bass (optionally on two Staves or one Staff each)
20   Men Staff (single voice on one staff)
21   Piano Staff
22
23   It is intended primarily to hide the complexity of the context
24   structure from newcomers to LilyPond, but is also useful as a
25   shorthand for seasoned users.
26
27   Usage:
28
29   satb.ly should be included at the *end* of the input file. Before
30   it are placed the required music and lyrics by redefining specific
31   variables, like this:
32
33   \paper { ... }
34   \header { ... }
35   Key = { ... }
36   Time = { ... }
37   SoloMusic = \relative { ... }
38   DescantMusic = \relative { ... }
39   DescantLyrics = \lyricmode { ... }
40   WomenMusic = \relative { ... }
41   WomenLyrics = \lyricmode { ... }
42   SopranoMusic = \relative { ... }
43   SopranoLyrics = \lyricmode { ... }
44   AltoMusic = \relative { ... }
45   AltoLyrics = \lyricmode { ... }
46   VerseOne = \lyricmode { ... }
47   VerseTwo = \lyricmode { ... }
48   ...
49   VerseNine = \lyricmode { ... }
50   TenorMusic = \relative { ... }
51   TenorLyrics = \lyricmode { ... }
52   BassMusic = \relative { ... }
53   BassLyrics = \lyricmode { ... }
54   MenMusic = \relative { ... }
55   MenLyrics = \lyricmode { ... }
56   PianoRHMusic = \relative { ... }
57   PianoDynamics = { ... }
58   PianoLHMusic = \relative { ... }
59   TwoVoicesPerStaff = ##f
60   \include "satb.ly"
61
62   All of the definitions are optional. Staves with no music will be
63   omitted from the output.
64
65   Other variables, such as the instrumentName, shortInstrumentName
66   and MidiInstrument can also be changed by defining variables like
67   AltoInstrumentName, BassMidiInstrument, etc.  The prefixes for staves
68   containing two divided voices are WomenDivided and MenDivided, hence
69   the corresponding variables would be WomenDividedInstrumentName, etc.
70   The key is defined in the variable Key, and the structure of time
71   and repeats in the variable Time, using spacer rests.
72
73   A \layout block may be defined in the variable Layout.  There is
74   no default \header block and no default \paper block.
75
76   Music may be tagged with #'print or #'play to be included only in
77   the printed score or in the MIDI file respectively.
78
79 %}
80
81 \include "vocal-tkit.ly"
82 \include "piano-tkit.ly"
83
84 #(define satb-voice-prefixes
85    ;; These define the permitted prefixes to various names.
86    ;; They are combined with a fixed set of postfixes to form
87    ;; names such as AltoMusic, BassInstrumentName, etc.
88    ;; These names may be redefined.
89    '("Alto"
90      "Bass"
91      "Descant"
92      "Men"
93      "MenDivided"
94      "Piano"
95      "PianoLH"
96      "PianoRH"
97      "Solo"
98      "Soprano"
99      "Tenor"
100      "Women"
101      "WomenDivided"))
102
103 #(define satb-lyrics-postfixes
104    ;; These define the permitted postfixes to the names of lyrics.
105    ;; They are combined with the prefixes to form names like
106    ;; AltoLyrics, etc.
107    ;; These names may be redefined or extended.
108   '("Lyrics"
109     "LyricsOne"
110     "LyricsTwo"
111     "LyricsThree"
112     "LyricsFour"))
113
114 #(define satb-lyrics-variable-names
115    ;; These define the names which may be used to specify stanzas
116    ;; which go between the two two-voice staves when TwoVoicesPerStaff
117    ;; is set to #t.  They may be redefined or extended.
118   '("VerseOne"
119     "VerseTwo"
120     "VerseThree"
121     "VerseFour"
122     "VerseFive"
123     "VerseSix"
124     "VerseSeven"
125     "VerseEight"
126     "VerseNine"))
127
128 %% make the above definitions available
129 #(set-music-definitions!
130   satb-voice-prefixes
131   satb-lyrics-postfixes
132   satb-lyrics-variable-names)
133
134 %% override the usual default value
135 #(if (not SoloShortInstrumentName)
136        (set! SoloShortInstrumentName ""))
137
138 SATB =
139 <<
140   \make-one-voice-vocal-staff "Solo" "treble"
141   \new ChoirStaff
142   \with {
143     \override VerticalAxisGroup.remove-empty = ##t
144     \override VerticalAxisGroup.remove-first = ##t
145   }
146   <<
147     \make-one-voice-vocal-staff "Descant" "treble"
148     \make-one-voice-vocal-staff "Women" "treble"
149     #(if TwoVoicesPerStaff
150       #{
151         \make-two-vocal-staves-with-stanzas
152           "WomenDivided" "treble" "MenDivided" "bass"
153           "Soprano" "Alto" "Tenor" "Bass"
154           #satb-lyrics-variable-names
155       #}
156       #{
157         <<
158           \make-one-voice-vocal-staff "Soprano" "treble"
159           \make-one-voice-vocal-staff "Alto" "treble"
160           \make-one-voice-vocal-staff "Tenor" "treble_8"
161           \make-one-voice-vocal-staff "Bass" "bass"
162         >>
163       #} )
164     \make-one-voice-vocal-staff "Men" "bass"
165   >>
166 >>
167
168 Piano = \make-pianostaff
169
170 \tagGroup #'(print play)
171
172 \score {
173   \keepWithTag #'print
174   #(if have-music
175        #{ << \SATB \Piano >> #}
176        #{ { } #} )
177   \layout { $(if Layout #{ \Layout #} ) }
178 }
179
180
181 \score {
182   \keepWithTag #'play
183   #(if have-music
184        #{ << \SATB \Piano >> #}
185        #{ { } #} )
186   \midi {
187     \context {
188       \Score
189       midiChannelMapping = #'instrument
190     }
191   }
192 }