3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 %% Accompanied Choir with Multiple Verses %%
7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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:
15 Soprano and Alto (optionally on two Staves or one Staff)
16 Multiple verses (up to 9)
17 Tenor and Bass (optionally on two Staves or one Staff)
20 It is intended primarily to hide the complexity of the context
21 structure from newcomers to LilyPond, but is also useful as a
22 shorthand for seasoned users.
26 satb.ly should be included at the *end* of the input file. Before
27 it are placed the required music and lyrics by redefining specific
32 TwoVoicesPerStaff = ##f or ##t
35 Layout = \layout { ... }
36 DescantMusic = \relative { ... }
37 DescantLyrics = \lyricmode { ... }
38 SopranoMusic = \relative { ... }
39 SopranoLyrics = \lyricmode { ... }
40 AltoMusic = \relative { ... }
41 AltoLyrics = \lyricmode { ... }
42 VerseOne = \lyricmode { ... }
43 VerseTwo = \lyricmode { ... }
45 VerseNine = \lyricmode { ... }
46 TenorMusic = \relative { ... }
47 TenorLyrics = \lyricmode { ... }
48 BassMusic = \relative { ... }
49 BassLyrics = \lyricmode { ... }
50 PianoRHMusic = \relative { ... }
51 PianoDynamics = { ... }
52 PianoLHMusic = \relative { ... }
55 All of the definitions are optional. Staves with no music will be
56 omitted from the output.
58 Other variables, such as the instrumentName, can also be changed by
59 defining variables like AltoInstrumentName. The key is defined in
60 the variable Key, and the structure of time and repeats in the
61 variable Time, using spacer rests. A \layout block may be defined in
62 the variable Layout. There is no default \header block and no default
65 Music may be tagged with #'print or #'play to be included only in
66 the printed score or in the MIDI file respectively.
70 #(defmacro satb-defaulting (name . default)
71 (if (defined? name) name (if (pair? default) (car default) *unspecified*)))
73 #(define (satb-sym . strings) (string->symbol (apply string-append strings)))
75 #(defmacro satb-short-name (part)
76 "Use PartShortInstrumentName, or the first letter of
77 PartInstrumentName or its default."
78 (if (defined? (satb-sym part "Music"))
79 (let ((sname (satb-sym part "ShortInstrumentName")))
82 `(substring (satb-defaulting ,(satb-sym part "InstrumentName") ,part)
86 #(defmacro satb-lyrics-if-defined (name voice . optionals)
87 (let ((above (and (pair? optionals) (car optionals))))
89 `(make-music 'ContextSpeccedMusic
92 'property-operations ',(if above `((assign alignAboveContext ,above)) '())
93 'element (make-music 'LyricCombineMusic
94 'associated-context ,voice
98 #(defmacro satb-one-voice-staff (name clef)
100 \new Staff = #,name \with {
101 instrumentName = \markup \smallCaps
102 #(satb-defaulting ,(satb-sym name "InstrumentName") ,name)
103 shortInstrumentName = \markup \smallCaps #(satb-short-name ,name)
104 midiInstrument = "clarinet"
106 #(satb-defaulting Key)
108 \new Voice = #,name <<
110 #(satb-defaulting Time)
112 #(satb-defaulting ,(satb-sym name "Music"))
115 #(satb-lyrics-if-defined ,(satb-sym name "Lyrics") ,name)
116 #(satb-lyrics-if-defined ,(satb-sym name "LyricsOne") ,name)
117 #(satb-lyrics-if-defined ,(satb-sym name "LyricsTwo") ,name)
118 #(satb-lyrics-if-defined ,(satb-sym name "LyricsThree") ,name)
121 #(defmacro satb-two-voice-staff (name clef v1name v2name)
123 \new Staff = #,name \with {
124 instrumentName = \markup \right-column \smallCaps {
125 #(satb-defaulting ,(satb-sym v1name "InstrumentName") ,v1name)
126 #(satb-defaulting ,(satb-sym v2name "InstrumentName") ,v2name)
128 shortInstrumentName = \markup \right-column \smallCaps {
129 #(satb-short-name ,v1name)
130 #(satb-short-name ,v2name)
132 midiInstrument = "clarinet"
134 #(satb-defaulting Key)
136 \new Voice = #,v1name <<
138 #(satb-defaulting Time)
141 #(satb-defaulting ,(satb-sym v1name "Music"))
143 \new Voice = #,v2name <<
145 #(satb-defaulting Time)
147 #(satb-defaulting ,(satb-sym v2name "Music"))
150 #(satb-lyrics-if-defined ,(satb-sym v1name "Lyrics") ,v1name ,name)
151 #(satb-lyrics-if-defined ,(satb-sym v1name "LyricsOne") ,v1name ,name)
152 #(satb-lyrics-if-defined ,(satb-sym v1name "LyricsTwo") ,v1name ,name)
153 #(satb-lyrics-if-defined ,(satb-sym v1name "LyricsThree") ,v1name ,name)
154 #(satb-lyrics-if-defined ,(satb-sym v2name "Lyrics") ,v2name)
155 #(satb-lyrics-if-defined ,(satb-sym v2name "LyricsOne") ,v2name)
156 #(satb-lyrics-if-defined ,(satb-sym v2name "LyricsTwo") ,v2name)
157 #(satb-lyrics-if-defined ,(satb-sym v2name "LyricsThree") ,v2name)
160 satb-define-if-unused =
161 #(define-void-function (parser location syms) (symbol-list?)
164 (if (null? (ly:parser-lookup parser sym))
165 (ly:parser-define! parser sym *unspecified*)))
168 \satb-define-if-unused
177 satb-AllChoirMusic = <<
185 #(define satb-spacers (skip-of-length satb-AllChoirMusic))
190 \override VerticalAxisGroup.remove-empty = ##t
191 \override VerticalAxisGroup.remove-first = ##t
194 #(satb-one-voice-staff "Descant" "treble")
196 #(if (satb-defaulting TwoVoicesPerStaff #f)
197 (satb-two-voice-staff "Women" "treble" "Soprano" "Alto")
198 (make-simultaneous-music (list (satb-one-voice-staff "Soprano" "treble")
199 (satb-one-voice-staff "Alto" "treble"))))
201 #(satb-lyrics-if-defined VerseOne "Soprano")
202 #(satb-lyrics-if-defined VerseTwo "Soprano")
203 #(satb-lyrics-if-defined VerseThree "Soprano")
204 #(satb-lyrics-if-defined VerseFour "Soprano")
205 #(satb-lyrics-if-defined VerseFive "Soprano")
206 #(satb-lyrics-if-defined VerseSix "Soprano")
207 #(satb-lyrics-if-defined VerseSeven "Soprano")
208 #(satb-lyrics-if-defined VerseEight "Soprano")
209 #(satb-lyrics-if-defined VerseNine "Soprano")
211 #(if (satb-defaulting TwoVoicesPerStaff #f)
212 (satb-two-voice-staff "Men" "bass" "Tenor" "Bass")
213 (make-simultaneous-music (list (satb-one-voice-staff "Tenor" "treble_8")
214 (satb-one-voice-staff "Bass" "bass"))))
219 instrumentName = \markup \smallCaps
220 #(satb-defaulting PianoInstrumentName "Piano" )
221 shortInstrumentName = \markup \smallCaps #(satb-short-name "Piano" )
222 \override VerticalAxisGroup.remove-empty = ##t
223 \override VerticalAxisGroup.remove-first = ##t
228 #(satb-defaulting Key)
231 #(satb-defaulting Time)
232 #(satb-defaulting PianoRHMusic)
236 #(satb-defaulting PianoDynamics)
240 #(satb-defaulting Key)
243 #(satb-defaulting Time)
244 #(satb-defaulting PianoLHMusic)
250 \tagGroup #'(print play)
253 \keepWithTag #'print \SATB
254 \layout { $(satb-defaulting Layout) }
258 \keepWithTag #'play \SATB