]> git.donarmstrong.com Git - lilypond.git/blob - ly/ssaattbb.ly
Web-ja: update introduction
[lilypond.git] / ly / ssaattbb.ly
1
2 \version "2.19.25"
3
4
5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 %%                                                %%
7 %%          Accompanied Divided Choir             %%
8 %%                                                %%
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11 %{
12   This file may be \include'd in a score to provide the
13   context structure for a score arrangement consisting
14   of the following staves, although normally only a subset
15   of these staves would be used in any one score.
16
17   Solo Staff (outside Choir grouping)
18   Descant Staff (within Choir grouping)
19   Women Staff (single voice on one staff)
20   First and Second Soprano (optionally on two Staves or one Staff)
21   Soprano and Alto (optionally on two Staves or one Staff)
22   First and Second Alto (optionally on two Staves or one Staff)
23   First and Second Tenor (optionally on two Staves or one Staff)
24   Tenor and Bass (optionally on two Staves or one Staff)
25   First and Second Bass (optionally on two Staves or one Staff)
26   Men Staff (single voice on one staff)
27   Piano Staff
28
29   It is intended primarily to hide the complexity of the context
30   structure from newcomers to LilyPond, but is also useful as a
31   shorthand for seasoned users.  It is intended to facilitate the
32   setting of pieces in which different groupings of voices appear
33   at different times.  All that is necessary is to populate the
34   appropriate variables with music for the relevant sections and
35   with rests elsewhere, with sections separated by line breaks.
36
37   Usage:
38
39   ssaattbb.ly should be included at the *end* of the input file. Before
40   it are placed the required music and lyrics by redefining specific
41   variables, like this:
42
43   \paper { ... }
44   \header { ... }
45   Key = { ... }
46   Time = { ... }
47   SopranoOneMusic = \relative { ... }
48   SopranoOneLyrics = \lyricmode { ... }
49   SopranoTwoMusic = \relative { ... }
50   SopranoTwoLyrics = \lyricmode { ... }
51   AltoOneMusic = \relative { ... }
52   AltoOneLyrics = \lyricmode { ... }
53   AltoTwoMusic = \relative { ... }
54   AltoTwoLyrics = \lyricmode { ... }
55   TenorOneMusic = \relative { ... }
56   TenorOneLyrics = \lyricmode { ... }
57   TenorTwoMusic = \relative { ... }
58   TenorTwoLyrics = \lyricmode { ... }
59   BassOneMusic = \relative { ... }
60   BassOneLyrics = \lyricmode { ... }
61   BassTwoMusic = \relative { ... }
62   BassTwoLyrics = \lyricmode { ... }
63   PianoRHMusic = \relative { ... }
64   PianoDynamics = { ... }
65   PianoLHMusic = \relative { ... }
66   TwoVoicesPerStaff = ##f (applies to all staves)
67   \include "ssaattbb.ly"
68
69   In addition, if there are sections in which two or more parts
70   are in unison, the following variables may also be defined:
71
72   WomenMusic = \relative { ... }
73   WomenLyrics = \lyricmode { ... }
74   SopranoMusic = \relative { ... }
75   SopranoLyrics = \lyricmode { ... }
76   AltoMusic = \relative { ... }
77   AltoLyrics = \lyricmode { ... }
78   TenorMusic = \relative { ... }
79   TenorLyrics = \lyricmode { ... }
80   BassMusic = \relative { ... }
81   BassLyrics = \lyricmode { ... }
82   MenMusic = \relative { ... }
83   MenLyrics = \lyricmode { ... }
84
85   All of the definitions are optional. Staves with no music will be
86   omitted from the output.
87
88   If TwoVoicesPerStaff is #f, music of the various voices may be
89   placed individually on one or two staves according to the
90   following variables, all of which default to #f:
91
92   WomenTwoVoicesPerStaff
93   SopranoTwoVoicesPerStaff
94   AltoTwoVoicesPerStaff
95   TenorTwoVoicesPerStaff
96   BassTwoVoicesPerStaff
97   MenTwoVoicesPerStaff
98
99   Other variables, such as the instrumentName, shortInstrumentName
100   and MidiInstrument can also be changed by defining variables like
101   AltoInstrumentName, BassMidiInstrument, etc.  The prefixes for staves
102   containing two divided voices are WomenDivided and MenDivided, etc
103   hence the corresponding variables would be WomenDividedInstrumentName,
104   etc.
105
106   The key is defined in the variable Key, and the structure of time
107   and repeats in the variable Time, using spacer rests.
108
109   A \layout block may be defined in the variable Layout.  There is
110   no default \header block and no default \paper block.
111
112   Music may be tagged with #'print or #'play to be included only in
113   the printed score or in the MIDI file respectively.
114
115 %}
116
117 \include "vocal-tkit.ly"
118 \include "piano-tkit.ly"
119
120 #(define ssaattbb-voice-prefixes
121    ;; These define the permitted prefixes to various names.
122    ;; They are combined with a fixed set of postfixes to form
123    ;; names such as AltoMusic, BassInstrumentName, etc.
124    ;; These names may be redefined.
125    '("Alto"
126      "AltoOne"
127      "AltoTwo"
128      "AltoDivided"
129      "Bass"
130      "BassOne"
131      "BassTwo"
132      "BassDivided"
133      "Descant"
134      "Men"
135      "MenDivided"
136      "Piano"
137      "PianoLH"
138      "PianoRH"
139      "Solo"
140      "Soprano"
141      "SopranoOne"
142      "SopranoTwo"
143      "SopranoDivided"
144      "Tenor"
145      "TenorOne"
146      "TenorTwo"
147      "TenorDivided"
148      "Women"
149      "WomenDivided"))
150
151 #(define ssaattbb-lyrics-postfixes
152    ;; These define the permitted postfixes to the names of lyrics.
153    ;; They are combined with the prefixes to form names like
154    ;; AltoLyrics, etc.
155    ;; These names may be redefined or extended.
156   '("Lyrics"
157     "LyricsOne"
158     "LyricsTwo"
159     "LyricsThree"
160     "LyricsFour"))
161
162 #(define ssaattbb-lyrics-variable-names
163    ;; These define the names which may be used to specify stanzas
164    ;; which go between the two two-voice staves when TwoVoicesPerStaff
165    ;; is set to #t.  They may be redefined or extended.
166   '("VerseOne"
167     "VerseTwo"
168     "VerseThree"
169     "VerseFour"
170     "VerseFive"
171     "VerseSix"
172     "VerseSeven"
173     "VerseEight"
174     "VerseNine"))
175
176 %% make the above definitions available
177 #(set-music-definitions!
178   ssaattbb-voice-prefixes
179   ssaattbb-lyrics-postfixes
180   ssaattbb-lyrics-variable-names)
181
182 #(define ssaattbb-variable-names
183 ; Define names which are in addition to the base variable names
184 ; of Time, Layout, Key, PianoDynamics and TwoVoicesPerStaff
185    '("AltoTwoVoicesPerStaff"
186      "BassTwoVoicesPerStaff"
187      "MenTwoVoicesPerStaff"
188      "SopranoTwoVoicesPerStaff"
189      "TenorTwoVoicesPerStaff"
190      "WomenTwoVoicesPerStaff"))
191
192 %% and make them available
193 #(define-missing-variables! ssaattbb-variable-names)
194
195 #(if TwoVoicesPerStaff
196  ; Set all staves to contain two voices
197      (begin
198       (set! AltoTwoVoicesPerStaff #t)
199       (set! BassTwoVoicesPerStaff #t)
200       (set! MenTwoVoicesPerStaff #t)
201       (set! SopranoTwoVoicesPerStaff #t)
202       (set! TenorTwoVoicesPerStaff #t)
203       (set! WomenTwoVoicesPerStaff #t)))
204
205 #(define (set-default-instr-names! voice)
206 ; If the several instrument names and short instrument
207 ; names have not been defined by the user, set them to
208 ; the defaults "Soprano 1" and "S 1" etc with the same names
209 ; in a column for the divided staves"
210    (define (make-sym str1 str2)
211      (string->symbol (string-append str1 str2)))
212
213    (if (not (make-id voice "OneInstrumentName"))
214        (ly:parser-define!
215          (make-sym voice "OneInstrumentName")
216           (string-append voice " 1")))
217    (if (not (make-id voice "TwoInstrumentName"))
218        (ly:parser-define!
219          (make-sym voice "TwoInstrumentName")
220           (string-append voice " 2")))
221    (if (not (make-id voice "DividedInstrumentName"))
222        (ly:parser-define!
223          (make-sym voice "DividedInstrumentName")
224          #{ \markup \right-column \smallCaps {
225            #(if (make-id voice "OneMusic")
226                   (make-id voice "OneInstrumentName") "")
227            #(if (make-id voice "TwoMusic")
228                 (make-id voice "TwoInstrumentName") "") } #} ))
229    (if (not (make-id voice "OneShortInstrumentName"))
230        (ly:parser-define!
231          (make-sym voice "OneShortInstrumentName")
232          (string-append (substring voice 0 1) " 1")))
233    (if (not (make-id voice "TwoShortInstrumentName"))
234        (ly:parser-define!
235          (make-sym voice "TwoShortInstrumentName")
236          (string-append (substring voice 0 1) " 2")))
237    (if (not (make-id voice "DividedShortInstrumentName"))
238        (ly:parser-define!
239          (make-sym voice "DividedShortInstrumentName")
240          #{ \markup \right-column \smallCaps {
241            #(if (make-id voice "OneMusic")
242                 (make-id voice "OneShortInstrumentName") "")
243            #(if (make-id voice "TwoMusic")
244                 (make-id voice "TwoShortInstrumentName") "") } #} )))
245
246 #(set-default-instr-names! "Soprano")
247 #(set-default-instr-names! "Alto")
248 #(set-default-instr-names! "Tenor")
249 #(set-default-instr-names! "Bass")
250
251 SSAATTBB =
252 <<
253   \make-one-voice-vocal-staff "Solo" "treble"
254   \new ChoirStaff
255   <<
256     \make-one-voice-vocal-staff "Descant" "treble"
257     \make-one-voice-vocal-staff "Women" "treble"
258     #(if SopranoTwoVoicesPerStaff
259          #{ \make-two-voice-vocal-staff "SopranoDivided" "treble" "SopranoOne" "SopranoTwo" #}
260          #{ << \make-one-voice-vocal-staff "SopranoOne" "treble"
261                \make-one-voice-vocal-staff "SopranoTwo" "treble" >> #} )
262     #(if WomenTwoVoicesPerStaff
263          #{ \make-two-voice-vocal-staff "WomenDivided" "treble" "Soprano" "Alto" #}
264          #{ << \make-one-voice-vocal-staff "Soprano" "treble"
265                \make-one-voice-vocal-staff "Alto" "treble" >> #} )
266     #(if AltoTwoVoicesPerStaff
267          #{ \make-two-voice-vocal-staff "AltoDivided" "treble" "AltoOne" "AltoTwo" #}
268          #{ << \make-one-voice-vocal-staff "AltoOne" "treble"
269                \make-one-voice-vocal-staff "AltoTwo" "treble" >> #} )
270     #(if TenorTwoVoicesPerStaff
271          #{ \make-two-voice-vocal-staff "TenorDivided" "treble_8" "TenorOne" "TenorTwo" #}
272          #{ << \make-one-voice-vocal-staff "TenorOne" "treble_8"
273                \make-one-voice-vocal-staff "TenorTwo" "treble_8" >> #} )
274     #(if MenTwoVoicesPerStaff
275          #{ \make-two-voice-vocal-staff "MenDivided" "bass" "Tenor" "Bass" #}
276          #{ << \make-one-voice-vocal-staff "Tenor" "treble_8"
277                \make-one-voice-vocal-staff "Bass" "bass" >> #} )
278     #(if BassTwoVoicesPerStaff
279          #{ \make-two-voice-vocal-staff "BassDivided" "bass" "BassOne" "BassTwo" #}
280          #{ << \make-one-voice-vocal-staff "BassOne" "bass"
281                \make-one-voice-vocal-staff "BassTwo" "bass" >> #} )
282     \make-one-voice-vocal-staff "Men" "bass"
283   >>
284 >>
285
286 Piano = \make-pianostaff
287
288 \tagGroup #'(print play)
289
290 \layout {
291   \context {
292     \Staff
293     \override VerticalAxisGroup.remove-empty = ##t
294     \override VerticalAxisGroup.remove-first = ##t
295   }
296 }
297
298 \score {
299   \keepWithTag #'print
300   #(if have-music
301        #{ << \SSAATTBB \Piano >> #}
302        #{ { } #} )
303   \layout { $(if Layout Layout) }
304 }
305
306
307 \score {
308   \keepWithTag #'play
309   #(if have-music
310        #{ << \SSAATTBB \Piano >> #}
311        #{ { } #} )
312   \midi {
313     \context {
314       \Score
315       midiChannelMapping = #'instrument
316     }
317   }
318 }