]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/learning/templates.itely
9b82f46862c9d9d619730d6ac05fd4f7a515a8ab
[lilypond.git] / Documentation / learning / templates.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2
3 @ignore
4     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5
6     When revising a translation, copy the HEAD committish of the
7     version that you are working on.  For details, see the Contributors'
8     Guide, node Updating translation committishes..
9 @end ignore
10
11 @c \version "2.19.2"
12
13 @node Templates
14 @appendix Templates
15
16 This section of the manual contains templates with the LilyPond score
17 already set up for you.  Just add notes, run LilyPond, and enjoy
18 beautiful printed scores!
19
20 @menu
21 * Built-in templates::
22 * Single staff templates::
23 * Piano templates::
24 * String quartet templates::
25 * Vocal ensembles templates::
26 * Orchestral templates::
27 * Ancient notation templates::
28 * Other templates::
29 @end menu
30
31
32 @node Built-in templates
33 @appendixsec Built-in templates
34
35 A template, suitable for a range of choral music, is built into
36 LilyPond.  This may be used to create simple choral music, with or
37 without piano accompaniment, in two or four staves.  Unlike other
38 templates, this template is @q{built-in}, which means it does not
39 need to be copied and edited:  instead it is simply 
40 @code{\include}'d in the input file.
41
42 @warning {Unlike most included files, this built-in template must be
43 @code{\include}'d at the @emph{end} of the input file.}
44
45 The required music expressions are entered by defining values for
46 specific variables.  These definition must come before the
47 @code{\include}'d file.
48
49 The music may be set out with one or two voices per staff by setting
50 @code{TwoVoicesPerStaff} to @code{##f} or @code{##t} respectively.
51
52 Here's the complete input file for producing a full four-part SATB
53 arrangement with individual lyrics and piano accompaniment:
54
55 @lilypond[verbatim, quote]
56   SopranoMusic = \relative { a'4\f a8 a a4 a }
57   SopranoLyrics = \lyricmode { Sop -- ra -- no ly -- rics }
58   AltoMusic = \relative { d'4\f d d d }
59   AltoLyrics = \lyricmode { Al -- to ly -- rics }
60   TenorMusic = \relative { a4\p a a a }
61   TenorLyrics = \lyricmode { Te -- nor ly -- rics }
62   BassMusic = \relative { c2\p c4 c }
63   BassLyrics = \lyricmode { Bass ly -- rics }
64   PianoRHMusic = \relative { c' e g c }
65   PianoDynamics = { s2\mp s4 s4 }
66   PianoLHMusic = \relative { c e g c }
67   \include "satb.ly"
68 @end lilypond
69
70 The same input can be used to produce a score with two voices
71 per staff just by setting @code{TwoVoicesPerStaff} to @code{##t}.
72 Again, each voice has individual lyrics.
73
74
75 @lilypond[verbatim, quote]
76   SopranoMusic = \relative { a'4\f a8 a a4 a }
77   SopranoLyrics = \lyricmode { Sop -- ra -- no ly -- rics }
78   AltoMusic = \relative { d'4\f d d d }
79   AltoLyrics = \lyricmode { Al -- to ly -- rics }
80   TenorMusic = \relative { a4\p a a a }
81   TenorLyrics = \lyricmode { Te -- nor ly -- rics }
82   BassMusic = \relative { c2\p c4 c }
83   BassLyrics = \lyricmode { Bass ly -- rics }
84   PianoRHMusic = \relative { c' e g c }
85   PianoDynamics = { s2\mp s4 s4 }
86   PianoLHMusic = \relative { c e g c }
87   TwoVoicesPerStaff = ##t
88   \include "satb.ly"
89 @end lilypond
90
91 When @code{TwoVoicesPerStaff} is set to false or allowed to default,
92 any of the music variables may be omitted to produce arrangements
93 with fewer voices.  Here, for example, is how the input file for a
94 Soprano/Bass duet might be written:
95
96 @lilypond[verbatim,quote]
97   SopranoMusic = \relative { c'' c c c }
98   SopranoLyrics = \lyricmode { High voice ly -- rics }
99   BassMusic = \relative { a a a a }
100   BassLyrics = \lyricmode { Low voice ly -- rics }
101   \include "satb.ly"
102 @end lilypond
103
104 A second verse or alternative lyrics may be added to each of the
105 parts:
106
107 @lilypond[verbatim, quote]
108   SopranoMusic = \relative { a'4 a a a }
109   SopranoLyricsOne = \lyricmode {
110     \set stanza = "1."
111     Words to verse one
112   }
113   SopranoLyricsTwo = \lyricmode {
114     \set stanza = "2."
115     Words to verse two
116   }
117   \include "satb.ly"
118 @end lilypond
119
120 When the lyrics and rhythms are the same for every part, the vocal
121 music is best arranged on two staves with two voices in each.  Up to
122 nine verses may be provided.  Here's an unaccompanied example with
123 just three verses.
124
125 @lilypond[verbatim, quote]
126   SopranoMusic = \relative { a' a a a }
127   AltoMusic = \relative { f' f f f }
128   VerseOne = \lyricmode {
129     \set stanza = "1."
130     Words to verse one
131   }
132   VerseTwo = \lyricmode {
133     \set stanza = "2."
134     Words to verse two
135   }
136   VerseThree = \lyricmode {
137     \set stanza = "3."
138     Words to verse three
139   }
140   TenorMusic = \relative { a a a a }
141   BassMusic = \relative { f f f f }
142   TwoVoicesPerStaff = ##t
143   \include "satb.ly"
144 @end lilypond
145
146 Other variables may be given values.  The key signature and
147 the time signature may be changed from the default:
148
149 @lilypond[verbatim, quote]
150   Key = \key a \major
151   Time = {
152     \time 5/4
153     \tempo "Allegro" 4 = 144
154   }
155   SopranoMusic = \relative { gis' gis gis gis gis }
156   AltoMusic = \relative { cis' cis cis cis cis }
157   VerseOne = \lyricmode { Words to this du -- et }
158   TwoVoicesPerStaff = ##t
159   \include "satb.ly"
160 @end lilypond
161
162 The instrument names and/or the short instrument names may be
163 changed:
164
165 @lilypond[verbatim,quote]
166   SopranoMusic = \relative { c'' c c c }
167   SopranoLyrics = \lyricmode { High voice ly -- rics }
168   SopranoInstrumentName = "Soprano 1"
169   SopranoShortInstrumentName = "S1"
170   AltoMusic = \relative { a' a a a }
171   AltoLyrics = \lyricmode { Low voice ly -- rics }
172   AltoInstrumentName = "Soprano 2"
173   AltoShortInstrumentName = "S2"
174   \include "satb.ly"
175 @end lilypond
176
177 A descant may be added by defining values for the variable
178 @code{DescantMusic} and descant lyrics may be provided by
179 defining values for @code{DescantLyrics}.
180
181 @code{\header} and @code{\paper} blocks may be added as normal.
182 A @code{\layout} block may be provided as the value of the
183 @code{Layout} variable:
184
185 @example
186 Layout = \layout @{ ... @}
187 @end example
188
189 The complete set of variables which may be changed can be seen by
190 examining the file @file{ly/satb.ly}.
191
192 @seealso
193 Learning Manual:
194 @ref{Organizing pieces with variables},
195 @ref{Vocal ensembles templates},
196 @ref{Extending the templates}.
197
198 @knownissues
199 More complex arrangements of SATB choral music are not possible with
200 these simple built-in templates.
201
202
203 @node Single staff templates
204 @appendixsec Single staff templates
205
206 @menu
207 * Notes only::
208 * Notes and lyrics::
209 * Notes and chords::
210 * Notes lyrics and chords::
211 @end menu
212
213 @node Notes only
214 @appendixsubsec Notes only
215
216 @lilypondfile[verbatim,quote,ragged-right,texidoc,addversion]
217 {single-staff-template-with-only-notes.ly}
218
219 @node Notes and lyrics
220 @appendixsubsec Notes and lyrics
221
222 @lilypondfile[verbatim,quote,ragged-right,texidoc,addversion]
223 {single-staff-template-with-notes-and-lyrics.ly}
224
225 @node Notes and chords
226 @appendixsubsec Notes and chords
227
228 @lilypondfile[verbatim,quote,ragged-right,texidoc]
229 {single-staff-template-with-notes-and-chords.ly}
230
231 @node Notes lyrics and chords
232 @appendixsubsec Notes, lyrics, and chords
233
234 @lilypondfile[verbatim,quote,ragged-right,texidoc]
235 {single-staff-template-with-notes,-lyrics,-and-chords.ly}
236
237
238 @node Piano templates
239 @appendixsec Piano templates
240
241 @menu
242 * Solo piano::
243 * Piano and melody with lyrics::
244 * Piano centered lyrics::
245 @end menu
246
247 @node Solo piano
248 @appendixsubsec Solo piano
249
250 @lilypondfile[verbatim,quote,ragged-right,texidoc]
251 {piano-template-simple.ly}
252
253 @node Piano and melody with lyrics
254 @appendixsubsec Piano and melody with lyrics
255
256 @lilypondfile[verbatim,quote,ragged-right,texidoc]
257 {piano-template-with-melody-and-lyrics.ly}
258
259 @node Piano centered lyrics
260 @appendixsubsec Piano centered lyrics
261
262 @lilypondfile[verbatim,quote,ragged-right,texidoc]
263 {piano-template-with-centered-lyrics.ly}
264
265
266 @node String quartet templates
267 @appendixsec String quartet templates
268
269 @menu
270 * String quartet::
271 * String quartet parts::
272 @end menu
273
274 @node String quartet
275 @appendixsubsec String quartet
276
277 @lilypondfile[verbatim,quote,ragged-right,texidoc]
278 {string-quartet-template-simple.ly}
279
280 @node String quartet parts
281 @appendixsubsec String quartet parts
282
283 @lilypondfile[verbatim,quote,ragged-right,texidoc]
284 {string-quartet-template-with-separate-parts.ly}
285
286
287 @node Vocal ensembles templates
288 @appendixsec Vocal ensembles templates
289
290 The templates shown below should be copied into your score and edited
291 there.  If you have a relatively simple SATB layout you may prefer to
292 use the built-in templates, which can simply be @code{\include}'d, see
293 @ref{Built-in templates}.
294
295 @menu
296 * SATB vocal score::
297 * SATB vocal score and automatic piano reduction::
298 * SATB with aligned contexts::
299 * SATB on four staves::
300 * Solo verse and two-part refrain::
301 * Hymn tunes::
302 * Psalms::
303 @end menu
304
305 @node SATB vocal score
306 @appendixsubsec SATB vocal score
307
308 @lilypondfile[verbatim,quote,ragged-right,texidoc]
309 {vocal-ensemble-template.ly}
310
311 @node SATB vocal score and automatic piano reduction
312 @appendixsubsec SATB vocal score and automatic piano reduction
313
314 @lilypondfile[verbatim,quote,ragged-right,texidoc]
315 {vocal-ensemble-template-with-automatic-piano-reduction.ly}
316
317 @node SATB with aligned contexts
318 @appendixsubsec SATB with aligned contexts
319
320 @lilypondfile[verbatim,quote,ragged-right,texidoc]
321 {vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.ly}
322
323 @node SATB on four staves
324 @appendixsubsec SATB on four staves
325
326 @lilypondfile[verbatim,quote,ragged-right,texidoc]
327 {satb-choir-template---four-staves.ly}
328
329 @node Solo verse and two-part refrain
330 @appendixsubsec Solo verse and two-part refrain
331
332 @lilypondfile[verbatim,quote,ragged-right,texidoc]
333 {vocal-ensemble-template-with-verse-and-refrain.ly}
334
335 @node Hymn tunes
336 @appendixsubsec Hymn tunes
337
338 @lilypondfile[verbatim,quote,ragged-right,texidoc]
339 {hymn-template.ly}
340
341 @node Psalms
342 @appendixsubsec Psalms
343
344 @lilypondfile[verbatim,quote,ragged-right,texidoc]
345 {anglican-psalm-template.ly}
346
347
348 @node Orchestral templates
349 @appendixsec Orchestral templates
350
351 @menu
352 * Orchestra choir and piano::
353 @end menu
354
355 @node Orchestra choir and piano
356 @appendixsubsec Orchestra, choir and piano
357
358 @lilypondfile[verbatim,quote,ragged-right,texidoc]
359 {orchestra,-choir-and-piano-template.ly}
360
361
362 @node Ancient notation templates
363 @appendixsec Ancient notation templates
364
365 @menu
366 * Transcription of mensural music::
367 * Gregorian transcription template::
368 @end menu
369
370 @node Transcription of mensural music
371 @appendixsubsec Transcription of mensural music
372
373 @lilypondfile[verbatim,quote,ragged-right,texidoc]
374 {incipit.ly}
375
376 @node Gregorian transcription template
377 @appendixsubsec Gregorian transcription template
378
379 @lilypondfile[verbatim,quote,ragged-right,texidoc]
380 {ancient-notation-template----modern-transcription-of-gregorian-music.ly}
381
382
383 @node Other templates
384 @appendixsec Other templates
385
386 @menu
387 * Jazz combo::
388 @end menu
389
390 @node Jazz combo
391 @appendixsubsec Jazz combo
392
393 @lilypondfile[verbatim,quote,ragged-right,texidoc]
394 {jazz-combo-template.ly}
395
396
397
398
399 @ignore
400 This isn't very useful, and only duplicates material in
401 "global issues".  And if this info changes, this section often
402 gets forgotten.
403
404 @no de Other templates
405 @se ction Other templates
406 @su bsection All headers
407
408 This template displays all available headers.  Some of them are only
409 used in the Mutopia project; they don't affect the printed output at
410 all.  They are used if you want the piece to be listed with different
411 information in the Mutopia database than you wish to have printed on the
412 music.  For example, Mutopia lists the composer of the famous D major
413 violin concerto as TchaikovskyPI, whereas perhaps you wish to print
414 "Petr Tchaikowski" on your music.
415
416 @ The `line-width' is for \header.
417 @li lypond[quote,verbatim,ragged-right,line-width]
418 \version "2.19.2"
419 \header {
420   dedication = "dedication"
421   title = "Title"
422   subtitle = "Subtitle"
423   subsubtitle = "Subsubtitle"
424   composer = "Composer (xxxx-yyyy)"
425   opus = "Opus 0"
426   piece = "Piece I"
427   meter = "meter"
428   instrument = "Instrument"
429   arranger = "Arranger"
430   poet = "Poet"
431   texttranslator = "Translator"
432   copyright = "public domain"
433
434   % These are headers used by the Mutopia Project
435   % http://www.mutopiaproject.org/
436   mutopiatitle = ""
437   mutopiacomposer = ""
438   mutopiapoet = ""
439   mutopiainstrument = ""
440   date = "composer's dates"
441   source = "urtext "
442   maintainer = "your name here"
443   maintainerEmail = "your email here"
444   maintainerWeb = "your home page"
445   lastupdated = "2004/Aug/26"
446 }
447
448 \score {
449   { c'4 }
450   \header {
451     piece = "piece1"
452     opus = "opus1"
453   }
454 }
455
456 \score {
457   { c'4 }
458   \header {
459     piece = "piece2"
460     opus = "opus2"
461   }
462 }
463 @end lilypond
464 @end ignore
465
466
467