]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/learning/templates.itely
Merge branch 'master' into translation
[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.25"
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 Some templates, suitable for a range of choral music, are built into
36 LilyPond.  These may be used to create simple choral music, with or
37 without piano accompaniment, in two, four or eight staves.  Unlike
38 other templates, these templates are @q{built-in}, which means they do
39 not need to be copied and edited:  instead they are simply
40 @code{@bs{}include}'d in the input file.
41
42 @warning {Unlike most included files, these built-in templates must be
43 @code{@bs{}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 definitions must come before the
47 @code{@bs{}include}'d file.
48
49 @menu
50 * SATB template::
51 * SSAATTBB template::
52 @end menu
53
54 @node SATB template
55 @appendixsubsec SATB template
56
57 The music may be set out with one or two voices per staff by setting
58 @code{TwoVoicesPerStaff} to @code{##f} or @code{##t} respectively.
59
60 Here's the complete input file for producing a full four-part SATB
61 arrangement with individual lyrics and piano accompaniment:
62
63 @lilypond[verbatim, quote]
64   SopranoMusic = \relative { a'4\f a8 a a4 a }
65   SopranoLyrics = \lyricmode { Sop -- ra -- no ly -- rics }
66   AltoMusic = \relative { d'4\f d d d }
67   AltoLyrics = \lyricmode { Al -- to ly -- rics }
68   TenorMusic = \relative { a4\p a a a }
69   TenorLyrics = \lyricmode { Te -- nor ly -- rics }
70   BassMusic = \relative { c2\p c4 c }
71   BassLyrics = \lyricmode { Bass ly -- rics }
72   PianoRHMusic = \relative { c' e g c }
73   PianoDynamics = { s2\mp s4 s4 }
74   PianoLHMusic = \relative { c e g c }
75   \include "satb.ly"
76 @end lilypond
77
78 The same input can be used to produce a score with two voices
79 per staff just by setting @code{TwoVoicesPerStaff} to @code{##t}.
80 Again, each voice has individual lyrics.
81
82
83 @lilypond[verbatim, quote]
84   SopranoMusic = \relative { a'4\f a8 a a4 a }
85   SopranoLyrics = \lyricmode { Sop -- ra -- no ly -- rics }
86   AltoMusic = \relative { d'4\f d d d }
87   AltoLyrics = \lyricmode { Al -- to ly -- rics }
88   TenorMusic = \relative { a4\p a a a }
89   TenorLyrics = \lyricmode { Te -- nor ly -- rics }
90   BassMusic = \relative { c2\p c4 c }
91   BassLyrics = \lyricmode { Bass ly -- rics }
92   PianoRHMusic = \relative { c' e g c }
93   PianoDynamics = { s2\mp s4 s4 }
94   PianoLHMusic = \relative { c e g c }
95   TwoVoicesPerStaff = ##t
96   \include "satb.ly"
97 @end lilypond
98
99 When @code{TwoVoicesPerStaff} is set to false or allowed to default,
100 any of the music variables may be omitted to produce arrangements
101 with fewer voices.  Here, for example, is how the input file for a
102 Soprano/Bass duet might be written:
103
104 @lilypond[verbatim,quote]
105   SopranoMusic = \relative { c'' c c c }
106   SopranoLyrics = \lyricmode { High voice ly -- rics }
107   BassMusic = \relative { a a a a }
108   BassLyrics = \lyricmode { Low voice ly -- rics }
109   \include "satb.ly"
110 @end lilypond
111
112 A second verse or alternative lyrics may be added to each of the
113 parts:
114
115 @lilypond[verbatim, quote]
116   SopranoMusic = \relative { a'4 a a a }
117   SopranoLyricsOne = \lyricmode {
118     \set stanza = "1."
119     Words to verse one
120   }
121   SopranoLyricsTwo = \lyricmode {
122     \set stanza = "2."
123     Words to verse two
124   }
125   \include "satb.ly"
126 @end lilypond
127
128 When the lyrics and rhythms are the same for every part, the vocal
129 music is best arranged on two staves with two voices in each.  Up to
130 nine verses may be provided.  Here's an unaccompanied example with
131 just three verses.
132
133 @lilypond[verbatim, quote]
134   SopranoMusic = \relative { a' a a a }
135   AltoMusic = \relative { f' f f f }
136   VerseOne = \lyricmode {
137     \set stanza = "1."
138     Words to verse one
139   }
140   VerseTwo = \lyricmode {
141     \set stanza = "2."
142     Words to verse two
143   }
144   VerseThree = \lyricmode {
145     \set stanza = "3."
146     Words to verse three
147   }
148   TenorMusic = \relative { a a a a }
149   BassMusic = \relative { f f f f }
150   TwoVoicesPerStaff = ##t
151   \include "satb.ly"
152 @end lilypond
153
154 Other variables may be given values.  The key signature and
155 the time signature may be changed from the default:
156
157 @lilypond[verbatim, quote]
158   Key = \key a \major
159   Time = {
160     \time 5/4
161     \tempo "Allegro" 4 = 144
162   }
163   SopranoMusic = \relative { gis' gis gis gis gis }
164   AltoMusic = \relative { cis' cis cis cis cis }
165   VerseOne = \lyricmode { Words to this du -- et }
166   TwoVoicesPerStaff = ##t
167   \include "satb.ly"
168 @end lilypond
169
170 The instrument names and/or the short instrument names may be
171 changed:
172
173 @lilypond[verbatim,quote]
174   SopranoMusic = \relative { c'' c c c }
175   SopranoLyrics = \lyricmode { High voice ly -- rics }
176   SopranoInstrumentName = "Soprano 1"
177   SopranoShortInstrumentName = "S1"
178   AltoMusic = \relative { a' a a a }
179   AltoLyrics = \lyricmode { Low voice ly -- rics }
180   AltoInstrumentName = "Soprano 2"
181   AltoShortInstrumentName = "S2"
182   \include "satb.ly"
183 @end lilypond
184
185 although rather than do this it might be easier to use the
186 @code{ssaattbb.ly} template, see @ref{SSAATTBB template}.
187
188 A descant may be added by defining values for the variable
189 @code{DescantMusic} and descant lyrics may be provided by defining
190 values for @code{DescantLyrics}.  In a similar way a solo part may be
191 added above the grouped choir staves by defining values for
192 @code{SoloMusic} and @code{SoloLyrics}.
193
194 @code{\header} and @code{\paper} blocks may be added as normal.
195 A @code{\layout} block may be provided as usual at top level, and
196 the contents will be combined with (but will not override) the default
197 settings provided in the template.  Alternatively, all the default
198 settings provided by the template can be discarded by defining a
199 @code{Layout} variable containing @emph{all} the required settings:
200
201 @example
202 Layout = \layout @{ ... @}
203 @end example
204
205 The complete set of variables which may be changed can be seen by
206 examining the file @file{ly/satb.ly}, see
207 @ref{Other sources of information}.
208
209 @seealso
210 Learning Manual:
211 @ref{Organizing pieces with variables},
212 @ref{Vocal ensembles templates},
213 @ref{Extending the templates},
214 @ref{Other sources of information}.
215
216 @knownissues
217 The setting of the @code{TwoVoicesPerStaff} variable applies for the
218 entire duration of the score: it cannot be given different values at
219 different times.
220
221 More complex arrangements of SATB choral music are not possible with
222 this simple built-in template.
223
224
225 @node SSAATTBB template
226 @appendixsubsec SSAATTBB template
227
228 All the variables defined for the SATB template, with the exception of
229 the @code{VerseXxx} variables, are also available for the SSAATTBB
230 template, see @ref{SATB template}.  In addition, music and lyrics for
231 first and second voices in any or all of the four parts may be specified
232 by providing values for @code{SopranoOneMusic}, @code{SopranoTwoMusic},
233 etc, with lyrics in @code{SopranoOneLyrics} and @code{SopranoTwoLyrics},
234 etc.  Up to four additional stanzas may be defined for all the voice
235 parts by using the variables @code{SopranoOneLyricsOne}, with the others
236 defined in an analogous way.
237
238 Setting @code{TwoVoicesPerStaff} to @code{##t} will cause @emph{all}
239 voice parts to be placed on single staves as divisi voices.  If
240 @code{TwoVoicesPerStaff} is left to default or set to @code{##f} then
241 individual voice parts may be set on one or two staves according to
242 the setting of @code{SopranoTwoVoicesPerStaff},
243 @code{MenTwoVoicesPerStaff}, etc.
244
245 As an example, suppose we have a piece for soprano and alto which begins
246 with all voices in unison, progresses to a section with two parts,
247 soprano and alto, and ends with a four-part section.  This would be
248 coded like this:
249
250 @lilypond[verbatim,quote]
251 Time = { s1 \break s1 \break }
252 WomenMusic = \relative { a'4 a a a }
253 WomenLyrics = \lyricmode { Wo -- men ly -- rics }
254 SopranoMusic = \relative { s1 | c''4 c c c8 c }
255 SopranoLyrics = \lyricmode{ So -- pra -- no ly -- rics }
256 AltoMusic = \relative { s1 | g'4 g g g }
257 AltoLyrics = \lyricmode { Al -- to ly -- rics }
258 SopranoOneMusic = \relative { s1 | s1 |e''4 e e e }
259 SopranoOneLyrics = \lyricmode { Sop One ly -- rics }
260 SopranoTwoMusic = \relative { s1 | s1 | c''4 c c c }
261 SopranoTwoLyrics = \lyricmode { Sop Two ly -- rics }
262 AltoOneMusic = \relative { s1 | s1 | g'4 g g g8 g }
263 AltoOneLyrics = \lyricmode { Al -- to One ly -- rics }
264 AltoTwoMusic = \relative { s1 | s1 | e'4 e e e8 e }
265 AltoTwoLyrics = \lyricmode { Al -- to Two ly -- rics }
266 \layout { ragged-right = ##t }
267 \include "ssaattbb.ly"
268 @end lilypond
269
270 Male voices may be added in an analogous way.
271
272 To change the layout so that the divisi soprano voices use a shared
273 staff, we simply set @code{SopranoTwoVoicesPerStaff} to ##t, leaving
274 all other variables unchanged, like this:
275
276 @lilypond[verbatim,quote]
277 SopranoTwoVoicesPerStaff = ##t
278 Time = { s1 \break s1 \break }
279 WomenMusic = \relative { a'4 a a a }
280 WomenLyrics = \lyricmode { Wo -- men ly -- rics }
281 SopranoMusic = \relative { s1 | c''4 c c c8 c }
282 SopranoLyrics = \lyricmode{ So -- pra -- no ly -- rics }
283 AltoMusic = \relative { s1 | g'4 g g g }
284 AltoLyrics = \lyricmode { Al -- to ly -- rics }
285 SopranoOneMusic = \relative { s1 | s1 |e''4 e e e }
286 SopranoOneLyrics = \lyricmode { Sop One ly -- rics }
287 SopranoTwoMusic = \relative { s1 | s1 | c''4 c c c }
288 SopranoTwoLyrics = \lyricmode { Sop Two ly -- rics }
289 AltoOneMusic = \relative { s1 | s1 | g'4 g g g8 g }
290 AltoOneLyrics = \lyricmode { Al -- to One ly -- rics }
291 AltoTwoMusic = \relative { s1 | s1 | e'4 e e e8 e }
292 AltoTwoLyrics = \lyricmode { Al -- to Two ly -- rics }
293 \layout { ragged-right = ##t }
294 \include "ssaattbb.ly"
295 @end lilypond
296
297 or, to make all paired voices share a single staff, set
298 @code{TwoVoicesPerStaff} to ##t:
299
300 @lilypond[verbatim,quote]
301 TwoVoicesPerStaff = ##t
302 Time = { s1 \break s1 \break }
303 WomenMusic = \relative { a'4 a a a }
304 WomenLyrics = \lyricmode { Wo -- men ly -- rics }
305 SopranoMusic = \relative { s1 | c''4 c c c8 c }
306 SopranoLyrics = \lyricmode{ So -- pra -- no ly -- rics }
307 AltoMusic = \relative { s1 | g'4 g g g }
308 AltoLyrics = \lyricmode { Al -- to ly -- rics }
309 SopranoOneMusic = \relative { s1 | s1 |e''4 e e e }
310 SopranoOneLyrics = \lyricmode { Sop One ly -- rics }
311 SopranoTwoMusic = \relative { s1 | s1 | c''4 c c c }
312 SopranoTwoLyrics = \lyricmode { Sop Two ly -- rics }
313 AltoOneMusic = \relative { s1 | s1 | g'4 g g g8 g }
314 AltoOneLyrics = \lyricmode { Al -- to One ly -- rics }
315 AltoTwoMusic = \relative { s1 | s1 | e'4 e e e8 e }
316 AltoTwoLyrics = \lyricmode { Al -- to Two ly -- rics }
317 \layout { ragged-right = ##t }
318 \include "ssaattbb.ly"
319 @end lilypond
320
321 The complete set of variables which may be changed can be seen by
322 examining the file @file{ly/ssaattbb.ly}, see
323 @ref{Other sources of information}.
324
325 @seealso
326 Learning Manual:
327 @ref{Organizing pieces with variables},
328 @ref{Vocal ensembles templates},
329 @ref{Extending the templates},
330 @ref{Other sources of information}.
331
332 @knownissues
333 The setting of the various @code{...TwoVoicesPerStaff} variables apply
334 for the entire duration of the score: they cannot be given different
335 values at different times.
336
337 More complex arrangements of 8-part choral music are not possible with
338 this simple built-in template.
339
340
341 @node Single staff templates
342 @appendixsec Single staff templates
343
344 @menu
345 * Notes only::
346 * Notes and lyrics::
347 * Notes and chords::
348 * Notes lyrics and chords::
349 @end menu
350
351 @node Notes only
352 @appendixsubsec Notes only
353
354 @lilypondfile[verbatim,quote,ragged-right,texidoc]
355 {single-staff-template-with-only-notes.ly}
356
357 @node Notes and lyrics
358 @appendixsubsec Notes and lyrics
359
360 @lilypondfile[verbatim,quote,ragged-right,texidoc]
361 {single-staff-template-with-notes-and-lyrics.ly}
362
363 @node Notes and chords
364 @appendixsubsec Notes and chords
365
366 @lilypondfile[verbatim,quote,ragged-right,texidoc]
367 {single-staff-template-with-notes-and-chords.ly}
368
369 @node Notes lyrics and chords
370 @appendixsubsec Notes, lyrics, and chords
371
372 @lilypondfile[verbatim,quote,ragged-right,texidoc]
373 {single-staff-template-with-notes,-lyrics,-and-chords.ly}
374
375
376 @node Piano templates
377 @appendixsec Piano templates
378
379 @menu
380 * Solo piano::
381 * Piano and melody with lyrics::
382 * Piano centered lyrics::
383 @end menu
384
385 @node Solo piano
386 @appendixsubsec Solo piano
387
388 @lilypondfile[verbatim,quote,ragged-right,texidoc]
389 {piano-template-simple.ly}
390
391 @node Piano and melody with lyrics
392 @appendixsubsec Piano and melody with lyrics
393
394 @lilypondfile[verbatim,quote,ragged-right,texidoc]
395 {piano-template-with-melody-and-lyrics.ly}
396
397 @node Piano centered lyrics
398 @appendixsubsec Piano centered lyrics
399
400 @lilypondfile[verbatim,quote,ragged-right,texidoc]
401 {piano-template-with-centered-lyrics.ly}
402
403
404 @node String quartet templates
405 @appendixsec String quartet templates
406
407 @menu
408 * String quartet::
409 * String quartet parts::
410 @end menu
411
412 @node String quartet
413 @appendixsubsec String quartet
414
415 @lilypondfile[verbatim,quote,ragged-right,texidoc]
416 {string-quartet-template-simple.ly}
417
418 @node String quartet parts
419 @appendixsubsec String quartet parts
420
421 @lilypondfile[verbatim,quote,ragged-right,texidoc]
422 {string-quartet-template-with-separate-parts.ly}
423
424
425 @node Vocal ensembles templates
426 @appendixsec Vocal ensembles templates
427
428 The templates shown below should be copied into your score and edited
429 there.  If you have a relatively simple SATB layout you may prefer to
430 use the built-in templates, which can simply be @code{\include}'d, see
431 @ref{Built-in templates}.
432
433 @menu
434 * SATB vocal score::
435 * SATB vocal score and automatic piano reduction::
436 * SATB with aligned contexts::
437 * SATB on four staves::
438 * Solo verse and two-part refrain::
439 * Hymn tunes::
440 * Psalms::
441 @end menu
442
443 @node SATB vocal score
444 @appendixsubsec SATB vocal score
445
446 @lilypondfile[verbatim,quote,ragged-right,texidoc]
447 {vocal-ensemble-template.ly}
448
449 @node SATB vocal score and automatic piano reduction
450 @appendixsubsec SATB vocal score and automatic piano reduction
451
452 @lilypondfile[verbatim,quote,ragged-right,texidoc]
453 {vocal-ensemble-template-with-automatic-piano-reduction.ly}
454
455 @node SATB with aligned contexts
456 @appendixsubsec SATB with aligned contexts
457
458 @lilypondfile[verbatim,quote,ragged-right,texidoc]
459 {vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.ly}
460
461 @node SATB on four staves
462 @appendixsubsec SATB on four staves
463
464 @lilypondfile[verbatim,quote,ragged-right,texidoc]
465 {satb-choir-template---four-staves.ly}
466
467 @node Solo verse and two-part refrain
468 @appendixsubsec Solo verse and two-part refrain
469
470 @lilypondfile[verbatim,quote,ragged-right,texidoc]
471 {vocal-ensemble-template-with-verse-and-refrain.ly}
472
473 @node Hymn tunes
474 @appendixsubsec Hymn tunes
475
476 @lilypondfile[verbatim,quote,ragged-right,texidoc]
477 {hymn-template.ly}
478
479 @node Psalms
480 @appendixsubsec Psalms
481
482 @lilypondfile[verbatim,quote,ragged-right,texidoc]
483 {anglican-psalm-template.ly}
484
485
486 @node Orchestral templates
487 @appendixsec Orchestral templates
488
489 @menu
490 * Orchestra choir and piano::
491 @end menu
492
493 @node Orchestra choir and piano
494 @appendixsubsec Orchestra, choir and piano
495
496 @lilypondfile[verbatim,quote,ragged-right,texidoc]
497 {orchestra,-choir-and-piano-template.ly}
498
499
500 @node Ancient notation templates
501 @appendixsec Ancient notation templates
502
503 @menu
504 * Transcription of mensural music::
505 * Gregorian transcription template::
506 @end menu
507
508 @node Transcription of mensural music
509 @appendixsubsec Transcription of mensural music
510
511 @lilypondfile[verbatim,quote,ragged-right,texidoc]
512 {incipit.ly}
513
514 @node Gregorian transcription template
515 @appendixsubsec Gregorian transcription template
516
517 @lilypondfile[verbatim,quote,ragged-right,texidoc]
518 {ancient-notation-template----modern-transcription-of-gregorian-music.ly}
519
520
521 @node Other templates
522 @appendixsec Other templates
523
524 @menu
525 * Jazz combo::
526 @end menu
527
528 @node Jazz combo
529 @appendixsubsec Jazz combo
530
531 @lilypondfile[verbatim,quote,ragged-right,texidoc]
532 {jazz-combo-template.ly}
533
534
535
536
537 @ignore
538 This isn't very useful, and only duplicates material in
539 "global issues".  And if this info changes, this section often
540 gets forgotten.
541
542 @no de Other templates
543 @se ction Other templates
544 @su bsection All headers
545
546 This template displays all available headers.  Some of them are only
547 used in the Mutopia project; they don't affect the printed output at
548 all.  They are used if you want the piece to be listed with different
549 information in the Mutopia database than you wish to have printed on the
550 music.  For example, Mutopia lists the composer of the famous D major
551 violin concerto as TchaikovskyPI, whereas perhaps you wish to print
552 "Petr Tchaikowski" on your music.
553
554 @ The `line-width' is for \header.
555 @li lypond[quote,verbatim,ragged-right,line-width]
556 \version "2.19.25"
557 \header {
558   dedication = "dedication"
559   title = "Title"
560   subtitle = "Subtitle"
561   subsubtitle = "Subsubtitle"
562   composer = "Composer (xxxx-yyyy)"
563   opus = "Opus 0"
564   piece = "Piece I"
565   meter = "meter"
566   instrument = "Instrument"
567   arranger = "Arranger"
568   poet = "Poet"
569   texttranslator = "Translator"
570   copyright = "public domain"
571
572   % These are headers used by the Mutopia Project
573   % http://www.mutopiaproject.org/
574   mutopiatitle = ""
575   mutopiacomposer = ""
576   mutopiapoet = ""
577   mutopiainstrument = ""
578   date = "composer's dates"
579   source = "urtext "
580   maintainer = "your name here"
581   maintainerEmail = "your email here"
582   maintainerWeb = "your home page"
583   lastupdated = "2004/Aug/26"
584 }
585
586 \score {
587   { c'4 }
588   \header {
589     piece = "piece1"
590     opus = "opus1"
591   }
592 }
593
594 \score {
595   { c'4 }
596   \header {
597     piece = "piece2"
598     opus = "opus2"
599   }
600 }
601 @end lilypond
602 @end ignore
603
604
605