]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/learning/templates.itely
Merge remote-tracking branch 'origin/translation' into staging
[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 = \lyricsto "Soprano" {
110     \set stanza = "1."
111     Words to verse one
112   }
113   SopranoLyricsTwo = \lyricsto "Soprano" {
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 @c Line-width below is because of Issue 766.  If that's fixed, it can be removed.
374 @lilypondfile[verbatim,quote,ragged-right,texidoc,line-width=140]
375 {ancient-notation-template----modern-transcription-of-mensural-music.ly}
376
377 @node Gregorian transcription template
378 @appendixsubsec Gregorian transcription template
379
380 @lilypondfile[verbatim,quote,ragged-right,texidoc]
381 {ancient-notation-template----modern-transcription-of-gregorian-music.ly}
382
383
384 @node Other templates
385 @appendixsec Other templates
386
387 @menu
388 * Jazz combo::
389 @end menu
390
391 @node Jazz combo
392 @appendixsubsec Jazz combo
393
394 @c Line-width below is because of Issue 766.  If that's fixed, it can be removed.
395 @lilypondfile[verbatim,quote,ragged-right,texidoc,line-width=140]
396 {jazz-combo-template.ly}
397
398
399
400
401 @ignore
402 This isn't very useful, and only duplicates material in
403 "global issues".  And if this info changes, this section often
404 gets forgotten.
405
406 @no de Other templates
407 @se ction Other templates
408 @su bsection All headers
409
410 This template displays all available headers.  Some of them are only
411 used in the Mutopia project; they don't affect the printed output at
412 all.  They are used if you want the piece to be listed with different
413 information in the Mutopia database than you wish to have printed on the
414 music.  For example, Mutopia lists the composer of the famous D major
415 violin concerto as TchaikovskyPI, whereas perhaps you wish to print
416 "Petr Tchaikowski" on your music.
417
418 @ The `line-width' is for \header.
419 @li lypond[quote,verbatim,ragged-right,line-width]
420 \version "2.19.2"
421 \header {
422   dedication = "dedication"
423   title = "Title"
424   subtitle = "Subtitle"
425   subsubtitle = "Subsubtitle"
426   composer = "Composer (xxxx-yyyy)"
427   opus = "Opus 0"
428   piece = "Piece I"
429   meter = "meter"
430   instrument = "Instrument"
431   arranger = "Arranger"
432   poet = "Poet"
433   texttranslator = "Translator"
434   copyright = "public domain"
435
436   % These are headers used by the Mutopia Project
437   % http://www.mutopiaproject.org/
438   mutopiatitle = ""
439   mutopiacomposer = ""
440   mutopiapoet = ""
441   mutopiainstrument = ""
442   date = "composer's dates"
443   source = "urtext "
444   maintainer = "your name here"
445   maintainerEmail = "your email here"
446   maintainerWeb = "your home page"
447   lastupdated = "2004/Aug/26"
448 }
449
450 \score {
451   { c'4 }
452   \header {
453     piece = "piece1"
454     opus = "opus1"
455   }
456 }
457
458 \score {
459   { c'4 }
460   \header {
461     piece = "piece2"
462     opus = "opus2"
463   }
464 }
465 @end lilypond
466 @end ignore
467
468
469