]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/templates.itely
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / Documentation / user / templates.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @node Example templates
3 @appendix Example templates
4
5 This section of the manual contains templates with the LilyPond score
6 already set up for you.  Just add notes, run LilyPond, and enjoy
7 beautiful printed scores!
8
9 @c bad node name for ancient notation to avoid confict
10 @menu
11 * Single staff::                
12 * Piano templates::             
13 * String quartet::              
14 * Vocal ensembles::             
15 * Ancient notation templates::  
16 * Jazz combo::                  
17 * Lilypond-book templates::     
18 @end menu
19
20
21 @node Single staff
22 @appendixsec Single staff
23 @appendixsubsec Notes only
24
25 The first example gives you a staff with notes, suitable for a solo
26 instrument or a melodic fragment.  Cut and paste this into a file,
27 add notes, and you're finished!
28
29 @lilypond[quote,verbatim,ragged-right]
30 \version "2.9.13"
31 melody = \relative c' {
32    \clef treble
33    \key c \major
34    \time 4/4
35
36    a4 b c d
37 }
38
39 \score {
40    \new Staff \melody
41    \layout { }
42    \midi {}
43 }
44 @end lilypond
45
46 @appendixsubsec Notes and lyrics
47
48 The next example demonstrates a simple melody with lyrics.  Cut and
49 paste, add notes, then words for the lyrics.  This example turns off
50 automatic beaming, which is common for vocal parts.  If you want to use
51 automatic beaming, you'll have to change or comment out the relevant
52 line.
53
54 @lilypond[quote,verbatim,ragged-right]
55 \version "2.9.13"
56 melody = \relative c' {
57    \clef treble
58    \key c \major
59    \time 4/4
60
61    a4 b c d
62 }
63
64 text = \lyricmode {
65    Aaa Bee Cee Dee
66 }
67
68 \score{
69    <<
70       \new Voice = "one" {
71          \autoBeamOff
72          \melody
73       }
74       \new Lyrics \lyricsto "one" \text
75    >>
76    \layout { }
77    \midi { }
78 }
79 @end lilypond
80
81 @appendixsubsec Notes and chords
82
83 Want to prepare a lead sheet with a melody and chords?  Look no further!
84
85 @lilypond[quote,verbatim,ragged-right]
86 \version "2.9.13"
87 melody = \relative c' {
88    \clef treble
89    \key c \major
90    \time 4/4
91
92    f4 e8[ c] d4 g |
93    a2 ~ a2 |
94 }
95
96 harmonies = \chordmode {
97    c4:m f:min7 g:maj c:aug d2:dim b:sus
98 }
99
100 \score {
101    <<
102       \new ChordNames {
103          \set chordChanges = ##t
104          \harmonies
105       }
106    \new Staff \melody
107    >>
108
109    \layout{ }
110    \midi { }
111 }
112 @end lilypond
113
114 @appendixsubsec Notes, lyrics, and chords.
115
116 This template allows you to prepare a song with melody, words, and chords.
117
118 @lilypond[quote,verbatim,ragged-right]
119 \version "2.9.13"
120 melody = \relative c' {
121    \clef treble
122    \key c \major
123    \time 4/4
124
125    a b c d
126 }
127
128 text = \lyricmode {
129    Aaa Bee Cee Dee
130 }
131
132 harmonies = \chordmode {
133    a2 c2
134 }
135
136 \score {
137    <<
138       \new ChordNames {
139          \set chordChanges = ##t
140          \harmonies
141       }
142    \new Voice = "one" {
143       \autoBeamOff
144       \melody
145    }
146    \new Lyrics \lyricsto "one" \text
147    >>
148    \layout { }
149    \midi { }
150 }
151 @end lilypond
152
153 @node Piano templates
154 @appendixsec Piano templates
155 @appendixsubsec Solo piano
156
157 Here is a simple piano staff.
158
159 @lilypond[quote,verbatim,ragged-right]
160 \version "2.9.13"
161 upper = \relative c'' {
162    \clef treble
163    \key c \major
164    \time 4/4
165
166    a b c d
167 }
168
169 lower = \relative c {
170    \clef bass
171    \key c \major
172    \time 4/4
173
174    a2 c
175 }
176
177 \score {
178    \new PianoStaff <<
179       \set PianoStaff.instrumentName = "Piano  "
180       \new Staff = "upper" \upper
181       \new Staff = "lower" \lower
182    >>
183    \layout { }
184    \midi { }
185 }
186 @end lilypond
187
188 @appendixsubsec Piano and melody with lyrics
189
190 Here is a typical song format: one staff with the melody and lyrics, with
191 piano accompaniment underneath.
192
193 @lilypond[quote,verbatim,ragged-right]
194 \version "2.9.13"
195 melody = \relative c'' {
196    \clef treble
197    \key c \major
198    \time 4/4
199
200    a b c d
201 }
202
203 text = \lyricmode {
204    Aaa Bee Cee Dee
205 }
206
207 upper = \relative c'' {
208    \clef treble
209    \key c \major
210    \time 4/4
211
212    a b c d
213 }
214
215 lower = \relative c {
216    \clef bass
217    \key c \major
218    \time 4/4
219
220    a2 c
221 }
222
223 \score {
224    <<
225       \new Voice = "mel" {
226           \autoBeamOff
227           \melody
228       }
229       \new Lyrics \lyricsto mel \text
230
231       \new PianoStaff <<
232          \new Staff = "upper" \upper
233          \new Staff = "lower" \lower
234       >>
235    >>
236    \layout {
237       \context { \RemoveEmptyStaffContext }
238    }
239    \midi { }
240 }
241 @end lilypond
242
243
244 @appendixsubsec Piano centered lyrics
245
246 Instead of having a full staff for the melody and lyrics, you can place
247 the lyrics between the piano staff (and omit the separate melody staff).
248
249 @lilypond[quote,verbatim,ragged-right]
250 \version "2.9.13"
251 upper = \relative c'' {
252    \clef treble
253    \key c \major
254    \time 4/4
255
256    a b c d
257 }
258
259 lower = \relative c {
260    \clef bass
261    \key c \major
262    \time 4/4
263
264    a2 c
265 }
266
267 text = \lyricmode {
268    Aaa Bee Cee Dee
269 }
270
271 \score {
272   \new GrandStaff <<
273     \new Staff = upper { \new Voice = "singer" \upper }
274     \new Lyrics \lyricsto "singer" \text
275     \new Staff = lower {
276       \clef bass
277       \lower
278     }
279   >>
280   \layout {
281     \context { \GrandStaff \accepts "Lyrics" }
282     \context { \Lyrics \consists "Bar_engraver" }
283   }
284   \midi { }
285 }
286 @end lilypond
287
288
289 @appendixsubsec Piano centered dynamics
290
291 Many piano scores have the dynamics centered between the two
292 staffs.  This requires a bit of tweaking to implement, but
293 since the template is right here, you don't have to do the
294 tweaking yourself.
295
296 @lilypond[quote,verbatim,ragged-right]
297 \version "2.9.13"
298 upper = \relative c'' {
299   \clef treble
300   \key c \major
301   \time 4/4
302
303   a b c d
304 }
305
306 lower = \relative c {
307   \clef bass
308   \key c \major
309   \time 4/4
310
311   a2 c
312 }
313
314 dynamics = {
315   s2\fff\> s4
316   s\!\pp
317 }
318
319 pedal = {
320   s2\sustainDown s2\sustainUp
321 }
322
323 \score {
324   \new PianoStaff <<
325     \new Staff = "upper" \upper
326     \new Dynamics = "dynamics" \dynamics
327     \new Staff = "lower" <<
328       \clef bass
329       \lower
330     >>
331     \new Dynamics = "pedal" \pedal
332   >>
333   \layout {
334     \context {
335       \type "Engraver_group"
336       \name Dynamics
337       \alias Voice % So that \cresc works, for example.
338       \consists "Output_property_engraver"
339
340       \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
341       pedalSustainStrings = #'("Ped." "*Ped." "*")
342       pedalUnaCordaStrings = #'("una corda" "" "tre corde")
343
344       \consists "Piano_pedal_engraver"
345       \consists "Script_engraver"
346       \consists "Dynamic_engraver"
347       \consists "Text_engraver"
348
349       \override TextScript #'font-size = #2
350       \override TextScript #'font-shape = #'italic
351       \override DynamicText #'extra-offset = #'(0 . 2.5)
352       \override Hairpin #'extra-offset = #'(0 . 2.5)
353
354       \consists "Skip_event_swallow_translator"
355
356       \consists "Axis_group_engraver"
357     }
358     \context {
359       \PianoStaff
360       \accepts Dynamics
361       \override VerticalAlignment #'forced-distance = #7
362     }
363   }
364 }
365 \score {
366   \new PianoStaff <<
367     \new Staff = "upper" << \upper \dynamics >>
368     \new Staff = "lower" << \lower \dynamics >>
369     \new Dynamics = "pedal" \pedal
370   >>
371   \midi {
372     \context {
373       \type "Performer_group"
374       \name Dynamics
375       \consists "Piano_pedal_performer"
376     }
377     \context {
378       \PianoStaff
379       \accepts Dynamics
380     }
381   }
382 }
383 @end lilypond
384
385
386 @node String quartet
387 @appendixsec String quartet
388 @appendixsubsec String quartet
389
390 This template demonstrates a string quartet.  It also uses a @code{\global}
391 section for time and key signatures.
392
393 @lilypond[quote,verbatim,ragged-right]
394 \version "2.9.13"
395
396 global= {
397   \time 4/4
398   \key c \major
399 }
400
401 violinOne = \new Voice { \relative c''{
402   \set Staff.instrumentName = "Violin 1 "
403
404   c2 d e1
405
406 \bar "|." }}
407 violinTwo = \new Voice { \relative c''{
408   \set Staff.instrumentName = "Violin 2 "
409
410   g2 f e1
411
412 \bar "|." }}
413 viola = \new Voice { \relative c' {
414   \set Staff.instrumentName = "Viola "
415   \clef alto
416
417   e2 d c1
418
419 \bar "|." }}
420 cello = \new Voice { \relative c' {
421   \set Staff.instrumentName = "Cello     "
422   \clef bass
423
424   c2 b a1
425
426 \bar "|."}}
427
428 \score {
429    \new StaffGroup <<
430       \new Staff << \global \violinOne >>
431       \new Staff << \global \violinTwo >>
432       \new Staff << \global \viola >>
433       \new Staff << \global \cello >>
434    >>
435    \layout { }
436    \midi { }
437 }
438 @end lilypond
439
440 @appendixsubsec String quartet parts
441
442 The previous example produces a nice string quartet, but what if you
443 needed to print parts?  This template demonstrates how to use the
444 @code{\tag} feature to easily split a piece into individual parts.
445
446 You need to split this template into separate files; the filenames
447 are contained in comments at the beginning of each file.  @code{piece.ly}
448 contains all the music definitions.  The other files -- @code{score.ly},
449 @code{vn1.ly}, @code{vn2.ly}, @code{vla.ly}, and
450 @code{vlc.ly} -- produce the appropiate part.
451
452 @verbatim
453 %%%%% piece.ly
454 \version "2.9.13"
455
456 global= {
457   \time 4/4
458   \key c \major
459 }
460
461 Violinone = \new Voice { \relative c''{
462   \set Staff.instrumentName = "Violin 1 "
463
464   c2 d e1
465
466 \bar "|." }}   %*********************************
467 Violintwo = \new Voice { \relative c''{
468   \set Staff.instrumentName = "Violin 2 "
469
470   g2 f e1
471
472 \bar "|." }}   %*********************************
473 Viola = \new Voice { \relative c' {
474   \set Staff.instrumentName = "Viola "
475   \clef alto
476
477   e2 d c1
478
479 \bar "|." }}   %*********************************
480 Cello = \new Voice { \relative c' {
481   \set Staff.instrumentName = "Cello     "
482   \clef bass
483
484   c2 b a1
485
486 \bar "|."}}   %**********************************
487
488 music = {
489   <<
490     \tag #'score \tag #'vn1 \new Staff { << \global \Violinone >> }
491     \tag #'score \tag #'vn2 \new Staff { << \global \Violintwo>> }
492     \tag #'score \tag #'vla \new Staff { << \global \Viola>> }
493     \tag #'score \tag #'vlc \new Staff { << \global \Cello>> }
494   >>
495 }
496
497
498
499 %%%%% score.ly
500 \version "2.9.13"
501 \include "piece.ly"
502 #(set-global-staff-size 14)
503 \score {
504   \new StaffGroup \keepWithTag #'score \music
505   \layout { }
506   \midi { }
507 }
508
509
510 %%%%% vn1.ly
511 \version "2.9.13"
512 \include "piece.ly"
513 \score {
514   \keepWithTag #'vn1 \music
515   \layout { }
516 }
517
518
519 %%%%% vn2.ly
520 \version "2.9.13"
521 \include "piece.ly"
522 \score {
523   \keepWithTag #'vn2 \music
524   \layout { }
525 }
526
527
528 %%%%% vla.ly
529 \version "2.9.13"
530 \include "piece.ly"
531 \score {
532   \keepWithTag #'vla \music
533   \layout { }
534 }
535
536
537 %%%%% vlc.ly
538 \version "2.9.13"
539 \include "piece.ly"
540 \score {
541   \keepWithTag #'vlc \music
542   \layout { }
543 }
544 @end verbatim
545
546
547 @node Vocal ensembles
548 @appendixsec Vocal ensembles
549
550 @appendixsubsec SATB vocal score
551
552 Here is a standard four-part SATB vocal score.  With larger ensembles,
553 it's often useful to include a section which is included in all
554 parts.  For example, the time signature and key signatures are almost
555 always the same for all parts.
556
557 @lilypond[quote,verbatim,ragged-right]
558 \version "2.9.13"
559 global = {
560    \key c \major
561    \time 4/4
562 }
563
564 sopMusic = \relative c'' {
565    c4 c c8[( b)] c4
566 }
567 sopWords = \lyricmode {
568    hi hi hi hi
569 }
570
571 altoMusic = \relative c' {
572    e4 f d e
573 }
574 altoWords =\lyricmode {
575    ha ha ha ha
576 }
577
578 tenorMusic = \relative c' {
579    g4 a f g
580 }
581 tenorWords = \lyricmode {
582    hu hu hu hu
583 }
584
585 bassMusic = \relative c {
586    c4 c g c
587 }
588 bassWords = \lyricmode {
589    ho ho ho ho
590 }
591
592 \score {
593    \new ChoirStaff <<
594       \new Lyrics = sopranos { s1 }
595       \new Staff = women <<
596          \new Voice =
597            "sopranos" { \voiceOne << \global \sopMusic >> }
598          \new Voice =
599            "altos" { \voiceTwo << \global \altoMusic >> }
600       >>
601       \new Lyrics = "altos" { s1 }
602       \new Lyrics = "tenors" { s1 }
603       \new Staff = men <<
604          \clef bass
605          \new Voice =
606            "tenors" { \voiceOne <<\global \tenorMusic >> }
607          \new Voice =
608            "basses" { \voiceTwo <<\global \bassMusic >> }
609       >>
610       \new Lyrics = basses { s1 }
611
612       \context Lyrics = sopranos \lyricsto sopranos \sopWords
613       \context Lyrics = altos \lyricsto altos \altoWords
614       \context Lyrics = tenors \lyricsto tenors \tenorWords
615       \context Lyrics = basses \lyricsto basses \bassWords
616    >>
617
618    \layout {
619       \context {
620          % a little smaller so lyrics
621          % can be closer to the staff
622          \Staff
623          \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
624       }
625    }
626 }
627 @end lilypond
628
629
630 @appendixsubsec SATB vocal score and automatic piano reduction
631
632 This template adds an automatic piano reduction to the SATB vocal
633 score.  This demonstrates one of the strengths of LilyPond -- you
634 can use a music definition more than once.  If you make any changes
635 to the vocal notes (say, tenorMusic), then the changes will also
636 apply to the piano reduction.
637
638 @lilypond[quote,verbatim,ragged-right]
639 \version "2.9.13"
640 global = {
641    \key c \major
642    \time 4/4
643 }
644
645 sopMusic = \relative c'' {
646    c4 c c8[( b)] c4
647 }
648 sopWords = \lyricmode {
649    hi hi hi hi
650 }
651
652 altoMusic = \relative c' {
653    e4 f d e
654 }
655 altoWords =\lyricmode {
656    ha ha ha ha
657 }
658
659 tenorMusic = \relative c' {
660    g4 a f g
661 }
662 tenorWords = \lyricmode {
663    hu hu hu hu
664 }
665
666 bassMusic = \relative c {
667    c4 c g c
668 }
669 bassWords = \lyricmode {
670    ho ho ho ho
671 }
672
673 \score {
674   <<
675     \new ChoirStaff <<
676       \new Lyrics = sopranos { s1 }
677       \new Staff = women <<
678         \new Voice =
679           "sopranos" { \voiceOne << \global \sopMusic >> }
680         \new Voice =
681           "altos" { \voiceTwo << \global \altoMusic >> }
682       >>
683       \new Lyrics = "altos" { s1 }
684       \new Lyrics = "tenors" { s1 }
685       \new Staff = men <<
686         \clef bass
687         \new Voice =
688           "tenors" { \voiceOne <<\global \tenorMusic >> }
689         \new Voice =
690           "basses" { \voiceTwo <<\global \bassMusic >> }
691       >>
692       \new Lyrics = basses { s1 }
693
694       \context Lyrics = sopranos \lyricsto sopranos \sopWords
695       \context Lyrics = altos \lyricsto altos \altoWords
696       \context Lyrics = tenors \lyricsto tenors \tenorWords
697       \context Lyrics = basses \lyricsto basses \bassWords
698     >>
699   \new PianoStaff <<
700     \new Staff <<
701       \set Staff.printPartCombineTexts = ##f
702       \partcombine
703       << \global \sopMusic >>
704       << \global \altoMusic >>
705     >>
706     \new Staff <<
707       \clef bass
708       \set Staff.printPartCombineTexts = ##f
709       \partcombine
710       << \global \tenorMusic >>
711       << \global \bassMusic >>
712     >>
713    >>
714   >>
715   \layout {
716     \context {
717       % a little smaller so lyrics
718       % can be closer to the staff
719       \Staff
720         \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
721     }
722   }
723 }
724 @end lilypond
725
726
727 @c bad node name to avoid node name confict
728 @node Ancient notation templates
729 @appendixsec Ancient notation templates
730
731 @appendixsubsec Transcription of mensural music
732
733 When transcribing mensural music, an incipit at the beginning of the
734 piece is useful to indicate the original key and tempo.  While today
735 musicians are used to bar lines in order to faster recognize rhythmic
736 patterns, bar lines were not yet invented during the period of
737 mensural music; in fact, the meter often changed after every few
738 notes.  As a compromise, bar lines are often printed between the
739 staves rather than on the staves.
740
741 @lilypond[quote,verbatim,line-width=11.0\cm]
742 \version "2.9.13"
743
744 global = {
745   \set Score.skipBars = ##t
746
747   % incipit
748   \once \override Score.SystemStartBracket #'transparent = ##t
749   \override Score.SpacingSpanner #'spacing-increment = #1.0 % tight spacing
750   \key f \major
751   \time 2/2
752   \once \override Staff.TimeSignature #'style = #'neomensural
753   \override Voice.NoteHead #'style = #'neomensural
754   \override Voice.Rest #'style = #'neomensural
755   \set Staff.printKeyCancellation = ##f
756   \cadenzaOn % turn off bar lines
757   \skip 1*10
758   \once \override Staff.BarLine #'transparent = ##f
759   \bar "||"
760   \skip 1*1 % need this extra \skip such that clef change comes
761             % after bar line
762   \bar ""
763
764   % main
765   \revert Score.SpacingSpanner #'spacing-increment % CHECK: no effect?
766   \cadenzaOff % turn bar lines on again
767   \once \override Staff.Clef #'full-size-change = ##t
768   \set Staff.forceClef = ##t
769   \key g \major
770   \time 4/4
771   \override Voice.NoteHead #'style = #'default
772   \override Voice.Rest #'style = #'default
773
774   % FIXME: setting printKeyCancellation back to #t must not
775   % occur in the first bar after the incipit.  Dto. for forceClef.
776   % Therefore, we need an extra \skip.
777   \skip 1*1
778   \set Staff.printKeyCancellation = ##t
779   \set Staff.forceClef = ##f
780
781   \skip 1*7 % the actual music
782
783   % let finis bar go through all staves
784   \override Staff.BarLine #'transparent = ##f
785
786   % finis bar
787   \bar "|."
788 }
789
790 discantusNotes = {
791   \transpose c' c'' {
792     \set Staff.instrumentName = "Discantus  "
793
794     % incipit
795     \clef "neomensural-c1"
796     c'1. s2   % two bars
797     \skip 1*8 % eight bars
798     \skip 1*1 % one bar
799
800     % main
801     \clef "treble"
802     d'2. d'4 |
803     b e' d'2 |
804     c'4 e'4.( d'8 c' b |
805     a4) b a2 |
806     b4.( c'8 d'4) c'4 |
807     \once \override NoteHead #'transparent = ##t c'1 |
808     b\breve |
809   }
810 }
811
812 discantusLyrics = \lyricmode {
813   % incipit
814   IV-
815
816   % main
817   Ju -- bi -- |
818   la -- te De -- |
819   o, om --
820   nis ter -- |
821   ra, __ om- |
822   "..." |
823   -us. |
824 }
825
826 altusNotes = {
827   \transpose c' c'' {
828     \set Staff.instrumentName = "Altus  "
829
830     % incipit
831     \clef "neomensural-c3"
832     r1        % one bar
833     f1. s2    % two bars
834     \skip 1*7 % seven bars
835     \skip 1*1 % one bar
836
837     % main
838     \clef "treble"
839     r2 g2. e4 fis g | % two bars
840     a2 g4 e |
841     fis g4.( fis16 e fis4) |
842     g1 |
843     \once \override NoteHead #'transparent = ##t g1 |
844     g\breve |
845   }
846 }
847
848 altusLyrics = \lyricmode {
849   % incipit
850   IV-
851
852   % main
853   Ju -- bi -- la -- te | % two bars
854   De -- o, om -- |
855   nis ter -- ra, |
856   "..." |
857   -us. |
858 }
859
860 tenorNotes = {
861   \transpose c' c' {
862     \set Staff.instrumentName = "Tenor  "
863
864     % incipit
865     \clef "neomensural-c4"
866     r\longa   % four bars
867     r\breve   % two bars
868     r1        % one bar
869     c'1. s2   % two bars
870     \skip 1*1 % one bar
871     \skip 1*1 % one bar
872
873     % main
874     \clef "treble_8"
875     R1 |
876     R1 |
877     R1 |
878     r2 d'2. d'4 b e' | % two bars
879     \once \override NoteHead #'transparent = ##t e'1 |
880     d'\breve |
881   }
882 }
883
884 tenorLyrics = \lyricmode {
885   % incipit
886   IV-
887
888   % main
889   Ju -- bi -- la -- te | % two bars
890   "..." |
891   -us. |
892 }
893
894 bassusNotes = {
895   \transpose c' c' {
896     \set Staff.instrumentName = "Bassus  "
897
898     % incipit
899     \clef "bass"
900     r\maxima  % eight bars
901     f1. s2    % two bars
902     \skip 1*1 % one bar
903
904     % main
905     \clef "bass"
906     R1 |
907     R1 |
908     R1 |
909     R1 |
910     g2. e4 |
911     \once \override NoteHead #'transparent = ##t e1 |
912     g\breve |
913   }
914 }
915
916 bassusLyrics = \lyricmode {
917   % incipit
918   IV-
919
920   % main
921   Ju -- bi- |
922   "..." |
923   -us. |
924 }
925
926 \score {
927   \new StaffGroup = choirStaff <<
928     \new Voice =
929       "discantusNotes" << \global \discantusNotes >>
930     \new Lyrics =
931       "discantusLyrics" \lyricsto discantusNotes { \discantusLyrics }
932     \new Voice =
933       "altusNotes" << \global \altusNotes >>
934     \new Lyrics =
935       "altusLyrics" \lyricsto altusNotes { \altusLyrics }
936     \new Voice =
937       "tenorNotes" << \global \tenorNotes >>
938     \new Lyrics =
939       "tenorLyrics" \lyricsto tenorNotes { \tenorLyrics }
940     \new Voice =
941       "bassusNotes" << \global \bassusNotes >>
942     \new Lyrics =
943       "bassusLyrics" \lyricsto bassusNotes { \bassusLyrics }
944   >>
945   \layout {
946     \context {
947       \Score
948
949       % no bars in staves
950       \override BarLine #'transparent = ##t
951
952       % incipit should not start with a start delimiter
953       \remove "System_start_delimiter_engraver"
954     }
955     \context {
956       \Voice
957
958       % no slurs
959       \override Slur #'transparent = ##t
960
961       % Comment in the below "\remove" command to allow line
962       % breaking also at those barlines where a note overlaps
963       % into the next bar.  The command is commented out in this
964       % short example score, but especially for large scores, you
965       % will typically yield better line breaking and thus improve
966       % overall spacing if you comment in the following command.
967       %\remove "Forbid_line_break_engraver"
968     }
969   }
970 }
971 @end lilypond
972
973
974 @appendixsubsec Gregorian transcription template
975
976 This example demonstrates how to do modern transcription of Gregorian
977 music.  Gregorian music has no measure, no stems; it uses only half and
978 quarter noteheads, and special marks, indicating rests of different length.
979
980 @lilypond[quote,verbatim,ragged-right]
981 \include "gregorian-init.ly"
982 \version "2.9.13"
983
984 chant = \relative c' {
985   \set Score.timing = ##f
986   f4 a2 \divisioMinima
987   g4 b a2 f2 \divisioMaior
988   g4( f) f( g) a2 \finalis
989 }
990
991 verba = \lyricmode {
992   Lo -- rem ip -- sum do -- lor sit a -- met
993 }
994
995 \score {
996   \new Staff <<
997     \new Voice = "melody" {
998       \chant
999     }
1000     \new Lyrics = "one" \lyricsto melody \verba
1001   >>
1002
1003   \layout {
1004     \context {
1005       \Staff
1006       \remove "Time_signature_engraver"
1007       \remove "Bar_engraver"
1008       \override Stem #'transparent = ##t
1009     }
1010     \context {
1011       \Voice
1012       \override Stem #'length = #0
1013     }
1014     \context {
1015       \Score
1016       barAlways = ##t
1017     }
1018   }
1019 }
1020 @end lilypond
1021
1022
1023 @node Jazz combo
1024 @appendixsec Jazz combo
1025
1026 This is a much more complicated template, for a jazz ensemble.  Note that all
1027 instruments are notated in @code{\key c \major}.  This refers to the key in
1028 concert pitch; LilyPond will automatically transpose the key if the music
1029 is within a @code{\transpose} section.
1030
1031 @c TODO must clean up this jazz combo example
1032 @c   - transpositions stated in names (ie "trumpet in Bb" or whatever)
1033 @c   - one global section, instead of "global" (time) and "key"
1034 @c   - does it need those wierd macros?  sl, nsl, etc.
1035 @c   - maybe ask Amelie Zapf to clean it up, or whether I should just
1036 @c     make whatever changes I feel like.
1037
1038 @c FIXME: produces a warning ; key change merge.
1039 @c The `line-width' argument is for the \header.
1040
1041 @lilypond[quote,verbatim,ragged-right,line-width]
1042 \version "2.9.13"
1043 \header {
1044   title = "Song"
1045   subtitle = "(tune)"
1046   composer = "Me"
1047   meter = "moderato"
1048   piece = "Swing"
1049   tagline = \markup {
1050     \column {
1051       "LilyPond example file by Amelie Zapf,"
1052       "Berlin 07/07/2003"
1053     }
1054   }
1055   texidoc = "Jazz tune for combo
1056              (horns, guitar, piano, bass, drums)."
1057 }
1058
1059 #(set-global-staff-size 16)
1060 \include "english.ly"
1061
1062 %%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%%
1063
1064 sl = {
1065   \override NoteHead #'style = #'slash
1066   \override Stem #'transparent = ##t
1067 }
1068 nsl = {
1069   \revert NoteHead #'style
1070   \revert Stem #'transparent
1071 }
1072 cr = \override NoteHead #'style = #'cross
1073 ncr = \revert NoteHead #'style
1074
1075 %% insert chord name style stuff here.
1076
1077 jzchords = { }
1078
1079
1080 %%%%%%%%%%%% Keys'n'thangs %%%%%%%%%%%%%%%%%
1081
1082 global = {
1083   \time 4/4
1084 }
1085
1086 Key = { \key c \major }
1087
1088 % ############ Horns ############
1089
1090 % ------ Trumpet ------
1091 trpt = \transpose c d \relative c'' {
1092   \Key
1093   c1 c c
1094 }
1095 trpharmony = \transpose c' d {
1096   \jzchords
1097 }
1098 trumpet = {
1099   \global
1100   \set Staff.instrumentName = #"Trumpet"
1101   \clef treble
1102   <<
1103     \trpt
1104   >>
1105 }
1106
1107 % ------ Alto Saxophone ------
1108 alto = \transpose c a \relative c' {
1109   \Key
1110   c1 c c
1111 }
1112 altoharmony = \transpose c' a {
1113   \jzchords
1114 }
1115 altosax = {
1116   \global
1117   \set Staff.instrumentName = #"Alto Sax"
1118   \clef treble
1119   <<
1120     \alto
1121   >>
1122 }
1123
1124 % ------ Baritone Saxophone ------
1125 bari = \transpose c a' \relative c {
1126   \Key
1127   c1 c \sl d4^"Solo" d d d \nsl
1128 }
1129 bariharmony = \transpose c' a \chordmode {
1130   \jzchords s1 s d2:maj e:m7
1131 }
1132 barisax = {
1133   \global
1134   \set Staff.instrumentName = #"Bari Sax"
1135   \clef treble
1136   <<
1137     \bari
1138   >>
1139 }
1140
1141 % ------ Trombone ------
1142 tbone = \relative c {
1143   \Key
1144   c1 c c
1145 }
1146 tboneharmony = \chordmode {
1147   \jzchords
1148 }
1149 trombone = {
1150   \global
1151   \set Staff.instrumentName = #"Trombone"
1152   \clef bass
1153   <<
1154     \tbone
1155   >>
1156 }
1157
1158 % ############ Rhythm Section #############
1159
1160 % ------ Guitar ------
1161 gtr = \relative c'' {
1162   \Key
1163   c1 \sl b4 b b b \nsl c1
1164 }
1165 gtrharmony = \chordmode {
1166   \jzchords
1167   s1 c2:min7+ d2:maj9
1168 }
1169 guitar = {
1170   \global
1171   \set Staff.instrumentName = #"Guitar"
1172   \clef treble
1173   <<
1174     \gtr
1175   >>
1176 }
1177
1178 %% ------ Piano ------
1179 rhUpper = \relative c'' {
1180   \voiceOne
1181   \Key
1182   c1 c c
1183 }
1184 rhLower = \relative c' {
1185   \voiceTwo
1186   \Key
1187   e1 e e
1188 }
1189
1190 lhUpper = \relative c' {
1191   \voiceOne
1192   \Key
1193   g1 g g
1194 }
1195 lhLower = \relative c {
1196   \voiceTwo
1197   \Key
1198   c1 c c
1199 }
1200
1201 PianoRH = {
1202   \clef treble
1203   \global
1204   \set Staff.midiInstrument = "acoustic grand"
1205   <<
1206     \new Voice = "one" \rhUpper
1207     \new Voice = "two" \rhLower
1208   >>
1209 }
1210 PianoLH = {
1211   \clef bass
1212   \global
1213   \set Staff.midiInstrument = "acoustic grand"
1214   <<
1215     \new Voice = "one" \lhUpper
1216     \new Voice = "two" \lhLower
1217   >>
1218 }
1219
1220 piano = {
1221   <<
1222     \set PianoStaff.instrumentName = #"Piano"
1223     \new Staff = "upper" \PianoRH
1224     \new Staff = "lower" \PianoLH
1225   >>
1226 }
1227
1228 % ------ Bass Guitar ------
1229 Bass = \relative c {
1230   \Key
1231   c1 c c
1232 }
1233 bass = {
1234   \global
1235   \set Staff.instrumentName = #"Bass"
1236   \clef bass
1237   <<
1238     \Bass
1239   >>
1240 }
1241
1242 % ------ Drums ------
1243 up = \drummode {
1244   hh4 <hh sn>4 hh <hh sn> hh <hh sn>4
1245   hh4 <hh sn>4
1246   hh4 <hh sn>4
1247   hh4 <hh sn>4
1248 }
1249
1250 down = \drummode {
1251   bd4 s bd s bd s bd s bd s bd s
1252 }
1253
1254 drumContents = {
1255   \global
1256   <<
1257     \set DrumStaff.instrumentName = #"Drums"
1258     \new DrumVoice { \voiceOne \up }
1259     \new DrumVoice { \voiceTwo \down }
1260   >>
1261 }
1262
1263 %%%%%%%%% It All Goes Together Here %%%%%%%%%%%%%%%%%%%%%%
1264
1265 \score {
1266   <<
1267     \new StaffGroup = "horns" <<
1268       \new Staff = "trumpet" \trumpet
1269       \new Staff = "altosax" \altosax
1270       \new ChordNames = "barichords" \bariharmony
1271       \new Staff = "barisax" \barisax
1272       \new Staff = "trombone" \trombone
1273     >>
1274
1275     \new StaffGroup = "rhythm" <<
1276       \new ChordNames = "chords" \gtrharmony
1277       \new Staff = "guitar" \guitar
1278       \new PianoStaff = "piano" \piano
1279       \new Staff = "bass" \bass
1280       \new DrumStaff { \drumContents }
1281     >>
1282   >>
1283
1284   \layout {
1285     \context { \RemoveEmptyStaffContext }
1286     \context {
1287       \Score
1288       \override BarNumber #'padding = #3
1289       \override RehearsalMark #'padding = #2
1290       skipBars = ##t
1291     }
1292   }
1293
1294   \midi { }
1295 }
1296 @end lilypond
1297
1298 @ignore
1299
1300 This isn't very useful, and only duplicates material in
1301 "global issues".  And if this info changes, this section often
1302 gets forgotten.
1303
1304 @no de Other templates
1305 @se ction Other templates
1306 @su bsection All headers
1307
1308 This template displays all available headers.  Some of them are only
1309 used in the Mutopia project; they don't affect the printed output at
1310 all.  They are used if you want the piece to be listed with different
1311 information in the Mutopia database than you wish to have printed on the
1312 music.  For example, Mutopia lists the composer of the famous D major
1313 violin concerto as TchaikovskyPI, whereas perhaps you wish to print
1314 "Petr Tchaikowski" on your music.
1315
1316 @ The `line-width' is for \header.
1317 @li lypond[quote,verbatim,ragged-right,line-width]
1318 \version "2.9.13"
1319 \header {
1320   dedication = "dedication"
1321   title = "Title"
1322   subtitle = "Subtitle"
1323   subsubtitle = "Subsubtitle"
1324   composer = "Composer (xxxx-yyyy)"
1325   opus = "Opus 0"
1326   piece = "Piece I"
1327   meter = "meter"
1328   instrument = "Instrument"
1329   arranger = "Arranger"
1330   poet = "Poet"
1331   texttranslator = "Translator"
1332   copyright = "public domain"
1333
1334   % These are headers used by the Mutopia Project
1335   % http://www.mutopiaproject.org/
1336   mutopiatitle = ""
1337   mutopiacomposer = ""
1338   mutopiapoet = ""
1339   mutopiainstrument = ""
1340   date = "composer's dates"
1341   source = "urtext "
1342   maintainer = "your name here"
1343   maintainerEmail = "your email here"
1344   maintainerWeb = "your home page"
1345   lastupdated = "2004/Aug/26"
1346 }
1347
1348 \score {
1349   { c'4 }
1350   \header {
1351     piece = "piece1"
1352     opus = "opus1"
1353   }
1354 }
1355
1356 \score {
1357   { c'4 }
1358   \header {
1359     piece = "piece2"
1360     opus = "opus2"
1361   }
1362 }
1363 @end lilypond
1364 @end ignore
1365
1366
1367 @node Lilypond-book templates
1368 @appendixsec Lilypond-book templates
1369
1370 These templates are for use with @code{lilypond-book}.  If you're not familiar
1371 with this program, please refer to @ref{LilyPond-book}.
1372
1373 @appendixsubsec LaTeX
1374
1375 You can include LilyPond fragments in a LaTeX document.
1376
1377 @example
1378 \documentclass[]@{article@}
1379
1380 \begin@{document@}
1381
1382 Normal LaTeX text.
1383
1384 \begin@{lilypond@}
1385 \relative c'' @{
1386 a4 b c d
1387 @}
1388 \end@{lilypond@}
1389
1390 More LaTeX text.
1391
1392 \begin@{lilypond@}
1393 \relative c'' @{
1394 d4 c b a
1395 @}
1396 \end@{lilypond@}
1397 \end@{document@}
1398 @end example
1399
1400 @appendixsubsec Texinfo
1401
1402 You can include LilyPond fragments in Texinfo; in fact, this entire manual
1403 is written in Texinfo.
1404
1405 @example
1406 \input texinfo
1407 @@node Top
1408
1409 Texinfo text
1410
1411 @@lilypond[verbatim,fragment,ragged-right]
1412 a4 b c d
1413 @@end lilypond
1414
1415 More Texinfo text
1416
1417 @@lilypond[verbatim,fragment,ragged-right]
1418 d4 c b a
1419 @@end lilypond
1420
1421 @@bye
1422 @end example