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 staves. 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 \override DynamicLineSpanner #'Y-offset = #0
350 pedalSustainStrings = #'("Ped." "*Ped." "*")
351 pedalUnaCordaStrings = #'("una corda" "" "tre corde")
353 \consists "Piano_pedal_engraver"
354 \consists "Script_engraver"
355 \consists "Dynamic_engraver"
356 \consists "Text_engraver"
358 \override TextScript #'font-size = #2
359 \override TextScript #'font-shape = #'italic
361 \consists "Skip_event_swallow_translator"
363 \consists "Axis_group_engraver"
373 \new Staff = "upper" << \upper \dynamics >>
374 \new Staff = "lower" << \lower \dynamics >>
375 \new Dynamics = "pedal" \pedal
379 \type "Performer_group"
381 \consists "Piano_pedal_performer"
393 @appendixsec String quartet
394 @appendixsubsec String quartet
396 This template demonstrates a string quartet. It also uses a @code{\global}
397 section for time and key signatures.
399 @lilypond[quote,verbatim,ragged-right]
407 violinOne = \new Voice { \relative c''{
408 \set Staff.instrumentName = "Violin 1 "
413 violinTwo = \new Voice { \relative c''{
414 \set Staff.instrumentName = "Violin 2 "
419 viola = \new Voice { \relative c' {
420 \set Staff.instrumentName = "Viola "
426 cello = \new Voice { \relative c' {
427 \set Staff.instrumentName = "Cello "
436 \new Staff << \global \violinOne >>
437 \new Staff << \global \violinTwo >>
438 \new Staff << \global \viola >>
439 \new Staff << \global \cello >>
446 @appendixsubsec String quartet parts
448 The previous example produces a nice string quartet, but what if you
449 needed to print parts? This template demonstrates how to use the
450 @code{\tag} feature to easily split a piece into individual parts.
452 You need to split this template into separate files; the filenames
453 are contained in comments at the beginning of each file. @code{piece.ly}
454 contains all the music definitions. The other files -- @code{score.ly},
455 @code{vn1.ly}, @code{vn2.ly}, @code{vla.ly}, and
456 @code{vlc.ly} -- produce the appropiate part.
467 Violinone = \new Voice { \relative c''{
468 \set Staff.instrumentName = "Violin 1 "
472 \bar "|." }} %*********************************
473 Violintwo = \new Voice { \relative c''{
474 \set Staff.instrumentName = "Violin 2 "
478 \bar "|." }} %*********************************
479 Viola = \new Voice { \relative c' {
480 \set Staff.instrumentName = "Viola "
485 \bar "|." }} %*********************************
486 Cello = \new Voice { \relative c' {
487 \set Staff.instrumentName = "Cello "
492 \bar "|."}} %**********************************
496 \tag #'score \tag #'vn1 \new Staff { << \global \Violinone >> }
497 \tag #'score \tag #'vn2 \new Staff { << \global \Violintwo>> }
498 \tag #'score \tag #'vla \new Staff { << \global \Viola>> }
499 \tag #'score \tag #'vlc \new Staff { << \global \Cello>> }
508 #(set-global-staff-size 14)
510 \new StaffGroup \keepWithTag #'score \music
520 \keepWithTag #'vn1 \music
529 \keepWithTag #'vn2 \music
538 \keepWithTag #'vla \music
547 \keepWithTag #'vlc \music
553 @node Vocal ensembles
554 @appendixsec Vocal ensembles
556 @appendixsubsec SATB vocal score
558 Here is a standard four-part SATB vocal score. With larger ensembles,
559 it's often useful to include a section which is included in all
560 parts. For example, the time signature and key signatures are almost
561 always the same for all parts.
563 @lilypond[quote,verbatim,ragged-right]
570 sopMusic = \relative c'' {
573 sopWords = \lyricmode {
577 altoMusic = \relative c' {
580 altoWords =\lyricmode {
584 tenorMusic = \relative c' {
587 tenorWords = \lyricmode {
591 bassMusic = \relative c {
594 bassWords = \lyricmode {
600 \new Lyrics = sopranos { s1 }
601 \new Staff = women <<
603 "sopranos" { \voiceOne << \global \sopMusic >> }
605 "altos" { \voiceTwo << \global \altoMusic >> }
607 \new Lyrics = "altos" { s1 }
608 \new Lyrics = "tenors" { s1 }
612 "tenors" { \voiceOne <<\global \tenorMusic >> }
614 "basses" { \voiceTwo <<\global \bassMusic >> }
616 \new Lyrics = basses { s1 }
618 \context Lyrics = sopranos \lyricsto sopranos \sopWords
619 \context Lyrics = altos \lyricsto altos \altoWords
620 \context Lyrics = tenors \lyricsto tenors \tenorWords
621 \context Lyrics = basses \lyricsto basses \bassWords
626 % a little smaller so lyrics
627 % can be closer to the staff
629 \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
636 @appendixsubsec SATB vocal score and automatic piano reduction
638 This template adds an automatic piano reduction to the SATB vocal
639 score. This demonstrates one of the strengths of LilyPond -- you
640 can use a music definition more than once. If you make any changes
641 to the vocal notes (say, tenorMusic), then the changes will also
642 apply to the piano reduction.
644 @lilypond[quote,verbatim,ragged-right]
651 sopMusic = \relative c'' {
654 sopWords = \lyricmode {
658 altoMusic = \relative c' {
661 altoWords =\lyricmode {
665 tenorMusic = \relative c' {
668 tenorWords = \lyricmode {
672 bassMusic = \relative c {
675 bassWords = \lyricmode {
682 \new Lyrics = sopranos { s1 }
683 \new Staff = women <<
685 "sopranos" { \voiceOne << \global \sopMusic >> }
687 "altos" { \voiceTwo << \global \altoMusic >> }
689 \new Lyrics = "altos" { s1 }
690 \new Lyrics = "tenors" { s1 }
694 "tenors" { \voiceOne <<\global \tenorMusic >> }
696 "basses" { \voiceTwo <<\global \bassMusic >> }
698 \new Lyrics = basses { s1 }
700 \context Lyrics = sopranos \lyricsto sopranos \sopWords
701 \context Lyrics = altos \lyricsto altos \altoWords
702 \context Lyrics = tenors \lyricsto tenors \tenorWords
703 \context Lyrics = basses \lyricsto basses \bassWords
707 \set Staff.printPartCombineTexts = ##f
709 << \global \sopMusic >>
710 << \global \altoMusic >>
714 \set Staff.printPartCombineTexts = ##f
716 << \global \tenorMusic >>
717 << \global \bassMusic >>
723 % a little smaller so lyrics
724 % can be closer to the staff
726 \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
732 @appendixsubsec SATB with aligned contexts
734 Here all the lyrics lines are placed using @code{alignAboveContext}
735 and @code{alignBelowContext}.
737 @lilypond[quote,verbatim,ragged-right]
744 sopMusic = \relative c'' {
747 sopWords = \lyricmode {
751 altoMusic = \relative c' {
754 altoWords =\lyricmode {
758 tenorMusic = \relative c' {
761 tenorWords = \lyricmode {
765 bassMusic = \relative c {
768 bassWords = \lyricmode {
774 \new Staff = women <<
776 "sopranos" { \voiceOne << \global \sopMusic >> }
778 "altos" { \voiceTwo << \global \altoMusic >> }
780 \new Lyrics \with {alignAboveContext=women} \lyricsto sopranos \sopWords
781 \new Lyrics \with {alignBelowContext=women} \lyricsto altos \altoWords
782 % we could remove the line about this with the line below, since we want
783 % the alto lyrics to be below the alto Voice anyway.
784 % \new Lyrics \lyricsto altos \altoWords
789 "tenors" { \voiceOne <<\global \tenorMusic >> }
791 "basses" { \voiceTwo <<\global \bassMusic >> }
794 \new Lyrics \with {alignAboveContext=men} \lyricsto tenors \tenorWords
795 \new Lyrics \with {alignBelowContext=men} \lyricsto basses \bassWords
796 % again, we could replace the line above this with the line below.
797 % \new Lyrics \lyricsto basses \bassWords
802 % a little smaller so lyrics
803 % can be closer to the staff
805 \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
813 \new Staff = women <<
815 "sopranos" { \voiceOne << \global \sopMusic >> }
817 "altos" { \voiceTwo << \global \altoMusic >> }
820 \new Lyrics \with {alignAboveContext=women} \lyricsto sopranos \sopWords
821 \new Lyrics \lyricsto altos \altoWords
826 "tenors" { \voiceOne <<\global \tenorMusic >> }
828 "basses" { \voiceTwo <<\global \bassMusic >> }
831 \new Lyrics \with {alignAboveContext=men} \lyricsto tenors \tenorWords
832 \new Lyrics \lyricsto basses \bassWords
837 % a little smaller so lyrics
838 % can be closer to the staff
840 \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
847 @c bad node name to avoid node name confict
848 @node Ancient notation templates
849 @appendixsec Ancient notation templates
851 @appendixsubsec Transcription of mensural music
853 When transcribing mensural music, an incipit at the beginning of the
854 piece is useful to indicate the original key and tempo. While today
855 musicians are used to bar lines in order to faster recognize rhythmic
856 patterns, bar lines were not yet invented during the period of
857 mensural music; in fact, the meter often changed after every few
858 notes. As a compromise, bar lines are often printed between the
859 staves rather than on the staves.
861 @lilypond[quote,verbatim,line-width=11.0\cm]
865 \set Score.skipBars = ##t
868 \once \override Score.SystemStartBracket #'transparent = ##t
869 \override Score.SpacingSpanner #'spacing-increment = #1.0 % tight spacing
872 \once \override Staff.TimeSignature #'style = #'neomensural
873 \override Voice.NoteHead #'style = #'neomensural
874 \override Voice.Rest #'style = #'neomensural
875 \set Staff.printKeyCancellation = ##f
876 \cadenzaOn % turn off bar lines
878 \once \override Staff.BarLine #'transparent = ##f
880 \skip 1*1 % need this extra \skip such that clef change comes
885 \revert Score.SpacingSpanner #'spacing-increment % CHECK: no effect?
886 \cadenzaOff % turn bar lines on again
887 \once \override Staff.Clef #'full-size-change = ##t
888 \set Staff.forceClef = ##t
891 \override Voice.NoteHead #'style = #'default
892 \override Voice.Rest #'style = #'default
894 % FIXME: setting printKeyCancellation back to #t must not
895 % occur in the first bar after the incipit. Dto. for forceClef.
896 % Therefore, we need an extra \skip.
898 \set Staff.printKeyCancellation = ##t
899 \set Staff.forceClef = ##f
901 \skip 1*7 % the actual music
903 % let finis bar go through all staves
904 \override Staff.BarLine #'transparent = ##f
912 \set Staff.instrumentName = "Discantus "
915 \clef "neomensural-c1"
917 \skip 1*8 % eight bars
927 \once \override NoteHead #'transparent = ##t c'1 |
932 discantusLyrics = \lyricmode {
948 \set Staff.instrumentName = "Altus "
951 \clef "neomensural-c3"
954 \skip 1*7 % seven bars
959 r2 g2. e4 fis g | % two bars
961 fis g4.( fis16 e fis4) |
963 \once \override NoteHead #'transparent = ##t g1 |
968 altusLyrics = \lyricmode {
973 Ju -- bi -- la -- te | % two bars
982 \set Staff.instrumentName = "Tenor "
985 \clef "neomensural-c4"
998 r2 d'2. d'4 b e' | % two bars
999 \once \override NoteHead #'transparent = ##t e'1 |
1004 tenorLyrics = \lyricmode {
1009 Ju -- bi -- la -- te | % two bars
1016 \set Staff.instrumentName = "Bassus "
1020 r\maxima % eight bars
1031 \once \override NoteHead #'transparent = ##t e1 |
1036 bassusLyrics = \lyricmode {
1047 \new StaffGroup = choirStaff <<
1049 "discantusNotes" << \global \discantusNotes >>
1051 "discantusLyrics" \lyricsto discantusNotes { \discantusLyrics }
1053 "altusNotes" << \global \altusNotes >>
1055 "altusLyrics" \lyricsto altusNotes { \altusLyrics }
1057 "tenorNotes" << \global \tenorNotes >>
1059 "tenorLyrics" \lyricsto tenorNotes { \tenorLyrics }
1061 "bassusNotes" << \global \bassusNotes >>
1063 "bassusLyrics" \lyricsto bassusNotes { \bassusLyrics }
1070 \override BarLine #'transparent = ##t
1072 % incipit should not start with a start delimiter
1073 \remove "System_start_delimiter_engraver"
1079 \override Slur #'transparent = ##t
1081 % Comment in the below "\remove" command to allow line
1082 % breaking also at those barlines where a note overlaps
1083 % into the next bar. The command is commented out in this
1084 % short example score, but especially for large scores, you
1085 % will typically yield better line breaking and thus improve
1086 % overall spacing if you comment in the following command.
1087 %\remove "Forbid_line_break_engraver"
1094 @appendixsubsec Gregorian transcription template
1096 This example demonstrates how to do modern transcription of Gregorian
1097 music. Gregorian music has no measure, no stems; it uses only half and
1098 quarter noteheads, and special marks, indicating rests of different length.
1100 @lilypond[quote,verbatim,ragged-right]
1101 \include "gregorian-init.ly"
1104 chant = \relative c' {
1105 \set Score.timing = ##f
1106 f4 a2 \divisioMinima
1107 g4 b a2 f2 \divisioMaior
1108 g4( f) f( g) a2 \finalis
1111 verba = \lyricmode {
1112 Lo -- rem ip -- sum do -- lor sit a -- met
1117 \new Voice = "melody" {
1120 \new Lyrics = "one" \lyricsto melody \verba
1126 \remove "Time_signature_engraver"
1127 \remove "Bar_engraver"
1128 \override Stem #'transparent = ##t
1132 \override Stem #'length = #0
1144 @appendixsec Jazz combo
1146 This is a much more complicated template, for a jazz ensemble. Note that all
1147 instruments are notated in @code{\key c \major}. This refers to the key in
1148 concert pitch; LilyPond will automatically transpose the key if the music
1149 is within a @code{\transpose} section.
1151 @c TODO must clean up this jazz combo example
1152 @c - transpositions stated in names (ie "trumpet in Bb" or whatever)
1153 @c - one global section, instead of "global" (time) and "key"
1154 @c - does it need those wierd macros? sl, nsl, etc.
1155 @c - maybe ask Amelie Zapf to clean it up, or whether I should just
1156 @c make whatever changes I feel like.
1158 @c FIXME: produces a warning ; key change merge.
1159 @c The `line-width' argument is for the \header.
1161 @lilypond[quote,verbatim,ragged-right,line-width]
1171 "LilyPond example file by Amelie Zapf,"
1175 texidoc = "Jazz tune for combo
1176 (horns, guitar, piano, bass, drums)."
1179 #(set-global-staff-size 16)
1180 \include "english.ly"
1182 %%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%%
1185 \override NoteHead #'style = #'slash
1186 \override Stem #'transparent = ##t
1189 \revert NoteHead #'style
1190 \revert Stem #'transparent
1192 cr = \override NoteHead #'style = #'cross
1193 ncr = \revert NoteHead #'style
1195 %% insert chord name style stuff here.
1200 %%%%%%%%%%%% Keys'n'thangs %%%%%%%%%%%%%%%%%
1206 Key = { \key c \major }
1208 % ############ Horns ############
1210 % ------ Trumpet ------
1211 trpt = \transpose c d \relative c'' {
1215 trpharmony = \transpose c' d {
1220 \set Staff.instrumentName = #"Trumpet"
1227 % ------ Alto Saxophone ------
1228 alto = \transpose c a \relative c' {
1232 altoharmony = \transpose c' a {
1237 \set Staff.instrumentName = #"Alto Sax"
1244 % ------ Baritone Saxophone ------
1245 bari = \transpose c a' \relative c {
1247 c1 c \sl d4^"Solo" d d d \nsl
1249 bariharmony = \transpose c' a \chordmode {
1250 \jzchords s1 s d2:maj e:m7
1254 \set Staff.instrumentName = #"Bari Sax"
1261 % ------ Trombone ------
1262 tbone = \relative c {
1266 tboneharmony = \chordmode {
1271 \set Staff.instrumentName = #"Trombone"
1278 % ############ Rhythm Section #############
1280 % ------ Guitar ------
1281 gtr = \relative c'' {
1283 c1 \sl b4 b b b \nsl c1
1285 gtrharmony = \chordmode {
1291 \set Staff.instrumentName = #"Guitar"
1298 %% ------ Piano ------
1299 rhUpper = \relative c'' {
1304 rhLower = \relative c' {
1310 lhUpper = \relative c' {
1315 lhLower = \relative c {
1324 \set Staff.midiInstrument = "acoustic grand"
1326 \new Voice = "one" \rhUpper
1327 \new Voice = "two" \rhLower
1333 \set Staff.midiInstrument = "acoustic grand"
1335 \new Voice = "one" \lhUpper
1336 \new Voice = "two" \lhLower
1342 \set PianoStaff.instrumentName = #"Piano"
1343 \new Staff = "upper" \PianoRH
1344 \new Staff = "lower" \PianoLH
1348 % ------ Bass Guitar ------
1349 Bass = \relative c {
1355 \set Staff.instrumentName = #"Bass"
1362 % ------ Drums ------
1364 hh4 <hh sn>4 hh <hh sn> hh <hh sn>4
1371 bd4 s bd s bd s bd s bd s bd s
1377 \set DrumStaff.instrumentName = #"Drums"
1378 \new DrumVoice { \voiceOne \up }
1379 \new DrumVoice { \voiceTwo \down }
1383 %%%%%%%%% It All Goes Together Here %%%%%%%%%%%%%%%%%%%%%%
1387 \new StaffGroup = "horns" <<
1388 \new Staff = "trumpet" \trumpet
1389 \new Staff = "altosax" \altosax
1390 \new ChordNames = "barichords" \bariharmony
1391 \new Staff = "barisax" \barisax
1392 \new Staff = "trombone" \trombone
1395 \new StaffGroup = "rhythm" <<
1396 \new ChordNames = "chords" \gtrharmony
1397 \new Staff = "guitar" \guitar
1398 \new PianoStaff = "piano" \piano
1399 \new Staff = "bass" \bass
1400 \new DrumStaff { \drumContents }
1405 \context { \RemoveEmptyStaffContext }
1408 \override BarNumber #'padding = #3
1409 \override RehearsalMark #'padding = #2
1420 This isn't very useful, and only duplicates material in
1421 "global issues". And if this info changes, this section often
1424 @no de Other templates
1425 @se ction Other templates
1426 @su bsection All headers
1428 This template displays all available headers. Some of them are only
1429 used in the Mutopia project; they don't affect the printed output at
1430 all. They are used if you want the piece to be listed with different
1431 information in the Mutopia database than you wish to have printed on the
1432 music. For example, Mutopia lists the composer of the famous D major
1433 violin concerto as TchaikovskyPI, whereas perhaps you wish to print
1434 "Petr Tchaikowski" on your music.
1436 @ The `line-width' is for \header.
1437 @li lypond[quote,verbatim,ragged-right,line-width]
1440 dedication = "dedication"
1442 subtitle = "Subtitle"
1443 subsubtitle = "Subsubtitle"
1444 composer = "Composer (xxxx-yyyy)"
1448 instrument = "Instrument"
1449 arranger = "Arranger"
1451 texttranslator = "Translator"
1452 copyright = "public domain"
1454 % These are headers used by the Mutopia Project
1455 % http://www.mutopiaproject.org/
1457 mutopiacomposer = ""
1459 mutopiainstrument = ""
1460 date = "composer's dates"
1462 maintainer = "your name here"
1463 maintainerEmail = "your email here"
1464 maintainerWeb = "your home page"
1465 lastupdated = "2004/Aug/26"
1487 @node Lilypond-book templates
1488 @appendixsec Lilypond-book templates
1490 These templates are for use with @code{lilypond-book}. If you're not familiar
1491 with this program, please refer to @rprogram{LilyPond-book}.
1493 @appendixsubsec LaTeX
1495 You can include LilyPond fragments in a LaTeX document.
1498 \documentclass[]@{article@}
1520 @appendixsubsec Texinfo
1522 You can include LilyPond fragments in Texinfo; in fact, this entire manual
1523 is written in Texinfo.
1531 @@lilypond[verbatim,fragment,ragged-right]
1537 @@lilypond[verbatim,fragment,ragged-right]