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