1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond.tely
4 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
6 When revising a translation, copy the HEAD committish of the
7 version that you are working on. See TRANSLATION for details.
13 This section of the manual contains templates with the LilyPond score
14 already set up for you. Just add notes, run LilyPond, and enjoy
15 beautiful printed scores!
17 @c bad node name for ancient notation to avoid confict
23 * Ancient notation templates::
25 * Lilypond-book templates::
30 @appendixsec Single staff
31 @appendixsubsec Notes only
33 The first example gives you a staff with notes, suitable for a solo
34 instrument or a melodic fragment. Cut and paste this into a file,
35 add notes, and you're finished!
37 @lilypond[quote,verbatim,ragged-right]
39 melody = \relative c' {
54 @appendixsubsec Notes and lyrics
56 The next example demonstrates a simple melody with lyrics. Cut and
57 paste, add notes, then words for the lyrics. This example turns off
58 automatic beaming, which is common for vocal parts. If you want to use
59 automatic beaming, you'll have to change or comment out the relevant
62 @lilypond[quote,verbatim,ragged-right]
64 melody = \relative c' {
82 \new Lyrics \lyricsto "one" \text
89 @appendixsubsec Notes and chords
91 Want to prepare a lead sheet with a melody and chords? Look no further!
93 @lilypond[quote,verbatim,ragged-right]
95 melody = \relative c' {
104 harmonies = \chordmode {
105 c4:m f:min7 g:maj c:aug d2:dim b:sus
111 \set chordChanges = ##t
122 @appendixsubsec Notes, lyrics, and chords.
124 This template allows you to prepare a song with melody, words, and chords.
126 @lilypond[quote,verbatim,ragged-right]
128 melody = \relative c' {
140 harmonies = \chordmode {
147 \set chordChanges = ##t
154 \new Lyrics \lyricsto "one" \text
161 @node Piano templates
162 @appendixsec Piano templates
163 @appendixsubsec Solo piano
165 Here is a simple piano staff.
167 @lilypond[quote,verbatim,ragged-right]
169 upper = \relative c'' {
177 lower = \relative c {
187 \set PianoStaff.instrumentName = "Piano "
188 \new Staff = "upper" \upper
189 \new Staff = "lower" \lower
196 @appendixsubsec Piano and melody with lyrics
198 Here is a typical song format: one staff with the melody and lyrics, with
199 piano accompaniment underneath.
201 @lilypond[quote,verbatim,ragged-right]
203 melody = \relative c'' {
215 upper = \relative c'' {
223 lower = \relative c {
237 \new Lyrics \lyricsto mel \text
240 \new Staff = "upper" \upper
241 \new Staff = "lower" \lower
245 \context { \RemoveEmptyStaffContext }
252 @appendixsubsec Piano centered lyrics
254 Instead of having a full staff for the melody and lyrics, you can place
255 the lyrics between the piano staff (and omit the separate melody staff).
257 @lilypond[quote,verbatim,ragged-right]
259 upper = \relative c'' {
267 lower = \relative c {
281 \new Staff = upper { \new Voice = "singer" \upper }
282 \new Lyrics \lyricsto "singer" \text
289 \context { \GrandStaff \accepts "Lyrics" }
290 \context { \Lyrics \consists "Bar_engraver" }
297 @appendixsubsec Piano centered dynamics
299 Many piano scores have the dynamics centered between the two
300 staffs. This requires a bit of tweaking to implement, but
301 since the template is right here, you don't have to do the
304 @lilypond[quote,verbatim,ragged-right]
306 upper = \relative c'' {
314 lower = \relative c {
328 s2\sustainDown s2\sustainUp
333 \new Staff = "upper" \upper
334 \new Dynamics = "dynamics" \dynamics
335 \new Staff = "lower" <<
339 \new Dynamics = "pedal" \pedal
343 \type "Engraver_group"
345 \alias Voice % So that \cresc works, for example.
346 \consists "Output_property_engraver"
348 \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
349 pedalSustainStrings = #'("Ped." "*Ped." "*")
350 pedalUnaCordaStrings = #'("una corda" "" "tre corde")
352 \consists "Piano_pedal_engraver"
353 \consists "Script_engraver"
354 \consists "Dynamic_engraver"
355 \consists "Text_engraver"
357 \override TextScript #'font-size = #2
358 \override TextScript #'font-shape = #'italic
359 \override DynamicText #'extra-offset = #'(0 . 2.5)
360 \override Hairpin #'extra-offset = #'(0 . 2.5)
362 \consists "Skip_event_swallow_translator"
364 \consists "Axis_group_engraver"
374 \new Staff = "upper" << \upper \dynamics >>
375 \new Staff = "lower" << \lower \dynamics >>
376 \new Dynamics = "pedal" \pedal
380 \type "Performer_group"
382 \consists "Piano_pedal_performer"
394 @appendixsec String quartet
395 @appendixsubsec String quartet
397 This template demonstrates a string quartet. It also uses a @code{\global}
398 section for time and key signatures.
400 @lilypond[quote,verbatim,ragged-right]
408 violinOne = \new Voice { \relative c''{
409 \set Staff.instrumentName = "Violin 1 "
414 violinTwo = \new Voice { \relative c''{
415 \set Staff.instrumentName = "Violin 2 "
420 viola = \new Voice { \relative c' {
421 \set Staff.instrumentName = "Viola "
427 cello = \new Voice { \relative c' {
428 \set Staff.instrumentName = "Cello "
437 \new Staff << \global \violinOne >>
438 \new Staff << \global \violinTwo >>
439 \new Staff << \global \viola >>
440 \new Staff << \global \cello >>
447 @appendixsubsec String quartet parts
449 The previous example produces a nice string quartet, but what if you
450 needed to print parts? This template demonstrates how to use the
451 @code{\tag} feature to easily split a piece into individual parts.
453 You need to split this template into separate files; the filenames
454 are contained in comments at the beginning of each file. @code{piece.ly}
455 contains all the music definitions. The other files -- @code{score.ly},
456 @code{vn1.ly}, @code{vn2.ly}, @code{vla.ly}, and
457 @code{vlc.ly} -- produce the appropiate part.
468 Violinone = \new Voice { \relative c''{
469 \set Staff.instrumentName = "Violin 1 "
473 \bar "|." }} %*********************************
474 Violintwo = \new Voice { \relative c''{
475 \set Staff.instrumentName = "Violin 2 "
479 \bar "|." }} %*********************************
480 Viola = \new Voice { \relative c' {
481 \set Staff.instrumentName = "Viola "
486 \bar "|." }} %*********************************
487 Cello = \new Voice { \relative c' {
488 \set Staff.instrumentName = "Cello "
493 \bar "|."}} %**********************************
497 \tag #'score \tag #'vn1 \new Staff { << \global \Violinone >> }
498 \tag #'score \tag #'vn2 \new Staff { << \global \Violintwo>> }
499 \tag #'score \tag #'vla \new Staff { << \global \Viola>> }
500 \tag #'score \tag #'vlc \new Staff { << \global \Cello>> }
509 #(set-global-staff-size 14)
511 \new StaffGroup \keepWithTag #'score \music
521 \keepWithTag #'vn1 \music
530 \keepWithTag #'vn2 \music
539 \keepWithTag #'vla \music
548 \keepWithTag #'vlc \music
554 @node Vocal ensembles
555 @appendixsec Vocal ensembles
557 @appendixsubsec SATB vocal score
559 Here is a standard four-part SATB vocal score. With larger ensembles,
560 it's often useful to include a section which is included in all
561 parts. For example, the time signature and key signatures are almost
562 always the same for all parts.
564 @lilypond[quote,verbatim,ragged-right]
571 sopMusic = \relative c'' {
574 sopWords = \lyricmode {
578 altoMusic = \relative c' {
581 altoWords =\lyricmode {
585 tenorMusic = \relative c' {
588 tenorWords = \lyricmode {
592 bassMusic = \relative c {
595 bassWords = \lyricmode {
601 \new Lyrics = sopranos { s1 }
602 \new Staff = women <<
604 "sopranos" { \voiceOne << \global \sopMusic >> }
606 "altos" { \voiceTwo << \global \altoMusic >> }
608 \new Lyrics = "altos" { s1 }
609 \new Lyrics = "tenors" { s1 }
613 "tenors" { \voiceOne <<\global \tenorMusic >> }
615 "basses" { \voiceTwo <<\global \bassMusic >> }
617 \new Lyrics = basses { s1 }
619 \context Lyrics = sopranos \lyricsto sopranos \sopWords
620 \context Lyrics = altos \lyricsto altos \altoWords
621 \context Lyrics = tenors \lyricsto tenors \tenorWords
622 \context Lyrics = basses \lyricsto basses \bassWords
627 % a little smaller so lyrics
628 % can be closer to the staff
630 \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
637 @appendixsubsec SATB vocal score and automatic piano reduction
639 This template adds an automatic piano reduction to the SATB vocal
640 score. This demonstrates one of the strengths of LilyPond -- you
641 can use a music definition more than once. If you make any changes
642 to the vocal notes (say, tenorMusic), then the changes will also
643 apply to the piano reduction.
645 @lilypond[quote,verbatim,ragged-right]
652 sopMusic = \relative c'' {
655 sopWords = \lyricmode {
659 altoMusic = \relative c' {
662 altoWords =\lyricmode {
666 tenorMusic = \relative c' {
669 tenorWords = \lyricmode {
673 bassMusic = \relative c {
676 bassWords = \lyricmode {
683 \new Lyrics = sopranos { s1 }
684 \new Staff = women <<
686 "sopranos" { \voiceOne << \global \sopMusic >> }
688 "altos" { \voiceTwo << \global \altoMusic >> }
690 \new Lyrics = "altos" { s1 }
691 \new Lyrics = "tenors" { s1 }
695 "tenors" { \voiceOne <<\global \tenorMusic >> }
697 "basses" { \voiceTwo <<\global \bassMusic >> }
699 \new Lyrics = basses { s1 }
701 \context Lyrics = sopranos \lyricsto sopranos \sopWords
702 \context Lyrics = altos \lyricsto altos \altoWords
703 \context Lyrics = tenors \lyricsto tenors \tenorWords
704 \context Lyrics = basses \lyricsto basses \bassWords
708 \set Staff.printPartCombineTexts = ##f
710 << \global \sopMusic >>
711 << \global \altoMusic >>
715 \set Staff.printPartCombineTexts = ##f
717 << \global \tenorMusic >>
718 << \global \bassMusic >>
724 % a little smaller so lyrics
725 % can be closer to the staff
727 \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
733 @appendixsubsec SATB with aligned contexts
735 Here all the lyrics lines are placed using @code{alignAboveContext}
736 and @code{alignBelowContext}.
738 @lilypond[quote,verbatim,ragged-right]
745 sopMusic = \relative c'' {
748 sopWords = \lyricmode {
752 altoMusic = \relative c' {
755 altoWords =\lyricmode {
759 tenorMusic = \relative c' {
762 tenorWords = \lyricmode {
766 bassMusic = \relative c {
769 bassWords = \lyricmode {
775 \new Staff = women <<
777 "sopranos" { \voiceOne << \global \sopMusic >> }
779 "altos" { \voiceTwo << \global \altoMusic >> }
781 \new Lyrics \with {alignAboveContext=women} \lyricsto sopranos \sopWords
782 \new Lyrics \with {alignBelowContext=women} \lyricsto altos \altoWords
783 % we could remove the line about this with the line below, since we want
784 % the alto lyrics to be below the alto Voice anyway.
785 % \new Lyrics \lyricsto altos \altoWords
790 "tenors" { \voiceOne <<\global \tenorMusic >> }
792 "basses" { \voiceTwo <<\global \bassMusic >> }
795 \new Lyrics \with {alignAboveContext=men} \lyricsto tenors \tenorWords
796 \new Lyrics \with {alignBelowContext=men} \lyricsto basses \bassWords
797 % again, we could replace the line above this with the line below.
798 % \new Lyrics \lyricsto basses \bassWords
803 % a little smaller so lyrics
804 % can be closer to the staff
806 \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
814 \new Staff = women <<
816 "sopranos" { \voiceOne << \global \sopMusic >> }
818 "altos" { \voiceTwo << \global \altoMusic >> }
821 \new Lyrics \with {alignAboveContext=women} \lyricsto sopranos \sopWords
822 \new Lyrics \lyricsto altos \altoWords
827 "tenors" { \voiceOne <<\global \tenorMusic >> }
829 "basses" { \voiceTwo <<\global \bassMusic >> }
832 \new Lyrics \with {alignAboveContext=men} \lyricsto tenors \tenorWords
833 \new Lyrics \lyricsto basses \bassWords
838 % a little smaller so lyrics
839 % can be closer to the staff
841 \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
848 @c bad node name to avoid node name confict
849 @node Ancient notation templates
850 @appendixsec Ancient notation templates
852 @appendixsubsec Transcription of mensural music
854 When transcribing mensural music, an incipit at the beginning of the
855 piece is useful to indicate the original key and tempo. While today
856 musicians are used to bar lines in order to faster recognize rhythmic
857 patterns, bar lines were not yet invented during the period of
858 mensural music; in fact, the meter often changed after every few
859 notes. As a compromise, bar lines are often printed between the
860 staves rather than on the staves.
862 @lilypond[quote,verbatim,line-width=11.0\cm]
866 \set Score.skipBars = ##t
869 \once \override Score.SystemStartBracket #'transparent = ##t
870 \override Score.SpacingSpanner #'spacing-increment = #1.0 % tight spacing
873 \once \override Staff.TimeSignature #'style = #'neomensural
874 \override Voice.NoteHead #'style = #'neomensural
875 \override Voice.Rest #'style = #'neomensural
876 \set Staff.printKeyCancellation = ##f
877 \cadenzaOn % turn off bar lines
879 \once \override Staff.BarLine #'transparent = ##f
881 \skip 1*1 % need this extra \skip such that clef change comes
886 \revert Score.SpacingSpanner #'spacing-increment % CHECK: no effect?
887 \cadenzaOff % turn bar lines on again
888 \once \override Staff.Clef #'full-size-change = ##t
889 \set Staff.forceClef = ##t
892 \override Voice.NoteHead #'style = #'default
893 \override Voice.Rest #'style = #'default
895 % FIXME: setting printKeyCancellation back to #t must not
896 % occur in the first bar after the incipit. Dto. for forceClef.
897 % Therefore, we need an extra \skip.
899 \set Staff.printKeyCancellation = ##t
900 \set Staff.forceClef = ##f
902 \skip 1*7 % the actual music
904 % let finis bar go through all staves
905 \override Staff.BarLine #'transparent = ##f
913 \set Staff.instrumentName = "Discantus "
916 \clef "neomensural-c1"
918 \skip 1*8 % eight bars
928 \once \override NoteHead #'transparent = ##t c'1 |
933 discantusLyrics = \lyricmode {
949 \set Staff.instrumentName = "Altus "
952 \clef "neomensural-c3"
955 \skip 1*7 % seven bars
960 r2 g2. e4 fis g | % two bars
962 fis g4.( fis16 e fis4) |
964 \once \override NoteHead #'transparent = ##t g1 |
969 altusLyrics = \lyricmode {
974 Ju -- bi -- la -- te | % two bars
983 \set Staff.instrumentName = "Tenor "
986 \clef "neomensural-c4"
999 r2 d'2. d'4 b e' | % two bars
1000 \once \override NoteHead #'transparent = ##t e'1 |
1005 tenorLyrics = \lyricmode {
1010 Ju -- bi -- la -- te | % two bars
1017 \set Staff.instrumentName = "Bassus "
1021 r\maxima % eight bars
1032 \once \override NoteHead #'transparent = ##t e1 |
1037 bassusLyrics = \lyricmode {
1048 \new StaffGroup = choirStaff <<
1050 "discantusNotes" << \global \discantusNotes >>
1052 "discantusLyrics" \lyricsto discantusNotes { \discantusLyrics }
1054 "altusNotes" << \global \altusNotes >>
1056 "altusLyrics" \lyricsto altusNotes { \altusLyrics }
1058 "tenorNotes" << \global \tenorNotes >>
1060 "tenorLyrics" \lyricsto tenorNotes { \tenorLyrics }
1062 "bassusNotes" << \global \bassusNotes >>
1064 "bassusLyrics" \lyricsto bassusNotes { \bassusLyrics }
1071 \override BarLine #'transparent = ##t
1073 % incipit should not start with a start delimiter
1074 \remove "System_start_delimiter_engraver"
1080 \override Slur #'transparent = ##t
1082 % Comment in the below "\remove" command to allow line
1083 % breaking also at those barlines where a note overlaps
1084 % into the next bar. The command is commented out in this
1085 % short example score, but especially for large scores, you
1086 % will typically yield better line breaking and thus improve
1087 % overall spacing if you comment in the following command.
1088 %\remove "Forbid_line_break_engraver"
1095 @appendixsubsec Gregorian transcription template
1097 This example demonstrates how to do modern transcription of Gregorian
1098 music. Gregorian music has no measure, no stems; it uses only half and
1099 quarter noteheads, and special marks, indicating rests of different length.
1101 @lilypond[quote,verbatim,ragged-right]
1102 \include "gregorian-init.ly"
1105 chant = \relative c' {
1106 \set Score.timing = ##f
1107 f4 a2 \divisioMinima
1108 g4 b a2 f2 \divisioMaior
1109 g4( f) f( g) a2 \finalis
1112 verba = \lyricmode {
1113 Lo -- rem ip -- sum do -- lor sit a -- met
1118 \new Voice = "melody" {
1121 \new Lyrics = "one" \lyricsto melody \verba
1127 \remove "Time_signature_engraver"
1128 \remove "Bar_engraver"
1129 \override Stem #'transparent = ##t
1133 \override Stem #'length = #0
1145 @appendixsec Jazz combo
1147 This is a much more complicated template, for a jazz ensemble. Note that all
1148 instruments are notated in @code{\key c \major}. This refers to the key in
1149 concert pitch; LilyPond will automatically transpose the key if the music
1150 is within a @code{\transpose} section.
1152 @c TODO must clean up this jazz combo example
1153 @c - transpositions stated in names (ie "trumpet in Bb" or whatever)
1154 @c - one global section, instead of "global" (time) and "key"
1155 @c - does it need those wierd macros? sl, nsl, etc.
1156 @c - maybe ask Amelie Zapf to clean it up, or whether I should just
1157 @c make whatever changes I feel like.
1159 @c FIXME: produces a warning ; key change merge.
1160 @c The `line-width' argument is for the \header.
1162 @lilypond[quote,verbatim,ragged-right,line-width]
1172 "LilyPond example file by Amelie Zapf,"
1176 texidoc = "Jazz tune for combo
1177 (horns, guitar, piano, bass, drums)."
1180 #(set-global-staff-size 16)
1181 \include "english.ly"
1183 %%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%%
1186 \override NoteHead #'style = #'slash
1187 \override Stem #'transparent = ##t
1190 \revert NoteHead #'style
1191 \revert Stem #'transparent
1193 cr = \override NoteHead #'style = #'cross
1194 ncr = \revert NoteHead #'style
1196 %% insert chord name style stuff here.
1201 %%%%%%%%%%%% Keys'n'thangs %%%%%%%%%%%%%%%%%
1207 Key = { \key c \major }
1209 % ############ Horns ############
1211 % ------ Trumpet ------
1212 trpt = \transpose c d \relative c'' {
1216 trpharmony = \transpose c' d {
1221 \set Staff.instrumentName = #"Trumpet"
1228 % ------ Alto Saxophone ------
1229 alto = \transpose c a \relative c' {
1233 altoharmony = \transpose c' a {
1238 \set Staff.instrumentName = #"Alto Sax"
1245 % ------ Baritone Saxophone ------
1246 bari = \transpose c a' \relative c {
1248 c1 c \sl d4^"Solo" d d d \nsl
1250 bariharmony = \transpose c' a \chordmode {
1251 \jzchords s1 s d2:maj e:m7
1255 \set Staff.instrumentName = #"Bari Sax"
1262 % ------ Trombone ------
1263 tbone = \relative c {
1267 tboneharmony = \chordmode {
1272 \set Staff.instrumentName = #"Trombone"
1279 % ############ Rhythm Section #############
1281 % ------ Guitar ------
1282 gtr = \relative c'' {
1284 c1 \sl b4 b b b \nsl c1
1286 gtrharmony = \chordmode {
1292 \set Staff.instrumentName = #"Guitar"
1299 %% ------ Piano ------
1300 rhUpper = \relative c'' {
1305 rhLower = \relative c' {
1311 lhUpper = \relative c' {
1316 lhLower = \relative c {
1325 \set Staff.midiInstrument = "acoustic grand"
1327 \new Voice = "one" \rhUpper
1328 \new Voice = "two" \rhLower
1334 \set Staff.midiInstrument = "acoustic grand"
1336 \new Voice = "one" \lhUpper
1337 \new Voice = "two" \lhLower
1343 \set PianoStaff.instrumentName = #"Piano"
1344 \new Staff = "upper" \PianoRH
1345 \new Staff = "lower" \PianoLH
1349 % ------ Bass Guitar ------
1350 Bass = \relative c {
1356 \set Staff.instrumentName = #"Bass"
1363 % ------ Drums ------
1365 hh4 <hh sn>4 hh <hh sn> hh <hh sn>4
1372 bd4 s bd s bd s bd s bd s bd s
1378 \set DrumStaff.instrumentName = #"Drums"
1379 \new DrumVoice { \voiceOne \up }
1380 \new DrumVoice { \voiceTwo \down }
1384 %%%%%%%%% It All Goes Together Here %%%%%%%%%%%%%%%%%%%%%%
1388 \new StaffGroup = "horns" <<
1389 \new Staff = "trumpet" \trumpet
1390 \new Staff = "altosax" \altosax
1391 \new ChordNames = "barichords" \bariharmony
1392 \new Staff = "barisax" \barisax
1393 \new Staff = "trombone" \trombone
1396 \new StaffGroup = "rhythm" <<
1397 \new ChordNames = "chords" \gtrharmony
1398 \new Staff = "guitar" \guitar
1399 \new PianoStaff = "piano" \piano
1400 \new Staff = "bass" \bass
1401 \new DrumStaff { \drumContents }
1406 \context { \RemoveEmptyStaffContext }
1409 \override BarNumber #'padding = #3
1410 \override RehearsalMark #'padding = #2
1421 This isn't very useful, and only duplicates material in
1422 "global issues". And if this info changes, this section often
1425 @no de Other templates
1426 @se ction Other templates
1427 @su bsection All headers
1429 This template displays all available headers. Some of them are only
1430 used in the Mutopia project; they don't affect the printed output at
1431 all. They are used if you want the piece to be listed with different
1432 information in the Mutopia database than you wish to have printed on the
1433 music. For example, Mutopia lists the composer of the famous D major
1434 violin concerto as TchaikovskyPI, whereas perhaps you wish to print
1435 "Petr Tchaikowski" on your music.
1437 @ The `line-width' is for \header.
1438 @li lypond[quote,verbatim,ragged-right,line-width]
1441 dedication = "dedication"
1443 subtitle = "Subtitle"
1444 subsubtitle = "Subsubtitle"
1445 composer = "Composer (xxxx-yyyy)"
1449 instrument = "Instrument"
1450 arranger = "Arranger"
1452 texttranslator = "Translator"
1453 copyright = "public domain"
1455 % These are headers used by the Mutopia Project
1456 % http://www.mutopiaproject.org/
1458 mutopiacomposer = ""
1460 mutopiainstrument = ""
1461 date = "composer's dates"
1463 maintainer = "your name here"
1464 maintainerEmail = "your email here"
1465 maintainerWeb = "your home page"
1466 lastupdated = "2004/Aug/26"
1488 @node Lilypond-book templates
1489 @appendixsec Lilypond-book templates
1491 These templates are for use with @code{lilypond-book}. If you're not familiar
1492 with this program, please refer to @ref{LilyPond-book}.
1494 @appendixsubsec LaTeX
1496 You can include LilyPond fragments in a LaTeX document.
1499 \documentclass[]@{article@}
1521 @appendixsubsec Texinfo
1523 You can include LilyPond fragments in Texinfo; in fact, this entire manual
1524 is written in Texinfo.
1532 @@lilypond[verbatim,fragment,ragged-right]
1538 @@lilypond[verbatim,fragment,ragged-right]