]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/examples.itely
* Documentation/user/examples.itely (Small ensembles): added
[lilypond.git] / Documentation / user / examples.itely
1 @c Note: -*-texinfo-*-
2 @node Example templates
3 @chapter 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 @menu
10 * Suggestions for writing LilyPond files::
11 * Single staff::
12 * Piano templates::
13 * Small ensembles::
14 * Jazz combo::
15 * Other templates::
16 @end menu
17
18 @c TODO explain \score{} ?  Maybe add a note to the tutorial?
19
20 @node Suggestions for writing LilyPond files
21 @section Suggestions for writing LilyPond files
22
23 Now you're ready to begin writing bigger LilyPond files -- not just the
24 little examples in the tutorial, but whole pieces.  But how should you
25 go about doing it?
26
27 The best answer is ``however you want to do it''.  As long as LilyPond
28 can understand your files and produces the output that you want, it
29 doesn't matter what your files look like.  That said, sometimes we
30 make mistakes when writing files.  If LilyPond can't understand your
31 files, or produces output that you don't like, how do you fix the
32 problem?
33
34 Here are a few suggestions that can help you in avoiding or fixing
35 problems:
36
37 @itemize @bullet
38 @item Include @code{\version} numbers in every file.  Note that all
39 templates contain a @code{\version "2.3.16"} string.  We
40 highly recommend that you always include the @code{\version}, no matter
41 how small your file is.  Speaking from personal experience, it's
42 quite frustrating to try to remember which version of LilyPond you were
43 using a few years ago.  @code{convert-ly} requires you to declare
44 which version of LilyPond you used.
45
46 @item Include checks:  See @ref{Bar check} and @ref{Octave check}.  If you
47 include checks every so often, then if you make a mistake, you can pinpoint
48 it quicker.  How often is ``every so often''?  It depends on the complexity
49 of the music.  For very simple music, perhaps just once or twice.  For
50 very complex music, every bar.
51
52 @item One bar per line.  If there is anything complicated, either in the music
53 itself or in the output you desire, it's often good to write only one bar
54 per line.  Saving screen space by cramming eight bars per line just isn't
55 worth it if you have to `debug' your files.
56
57 @item Comment your files, with either bar numbers (every so often) or
58 references to musical themes (``second theme in violins'', ``fourth
59 variation'').  You may not need it when you're writing the piece for
60 the first time, but if you want to go back and change something two
61 or three years later, you won't know how your file is structured if you
62 don't comment the file.
63
64 @end itemize
65
66 @node Single staff
67 @section Single staff
68 @subsection Notes only
69
70 The first example gives you a staff with notes, suitable for a solo
71 instrument or a melodic fragment.  Cut and paste this into a file,
72 add notes, and you're finished!
73
74 @lilypond[verbatim,raggedright]
75
76 \version "2.3.16"
77 melody = \relative c' {
78    \clef treble
79    \key c \major
80    \time 4/4
81
82    a4 b c d
83 }
84
85 \score{
86    \new Staff \melody
87    \paper { }
88    \midi { \tempo 4=60 }
89 }
90
91 @end lilypond
92
93 @subsection Notes and lyrics
94
95 The next example demonstrates a simple melody with lyrics.  Cut and
96 paste, add notes, then words for the lyrics.  This example turns off
97 automatic beaming, which is common for vocal parts.  If you want to use
98 automatic beaming, you'll have to change or comment out the relevant
99 line.
100
101 @lilypond[verbatim,raggedright]
102
103 \version "2.3.16"
104 melody = \relative c' {
105    \clef treble
106    \key c \major
107    \time 4/4
108
109    a4 b c d
110 }
111
112 text = \lyricmode {
113    Aaa Bee Cee Dee
114 }
115
116 \score{
117    <<
118       \context Voice = one {
119          \autoBeamOff
120          \melody
121       }
122       \lyricsto "one" \new Lyrics \text
123    >>
124    \paper { }
125    \midi { \tempo 4=60 }
126 }
127
128 @end lilypond
129
130 @subsection Notes and chords
131
132 Want to prepare a lead sheet with a melody and chords?  Look no further!
133
134 @lilypond[verbatim,raggedright]
135
136 \version "2.3.16"
137 melody =  \relative c' {
138    \clef treble
139    \key c \major
140    \time 4/4
141
142    f4 e8[ c] d4 g |
143    a2 ~ a2 |
144 }
145
146 harmonies = \chordmode {
147    c4:m f:min7 g:maj c:aug d2:dim b:sus
148 }
149
150 \score {
151    <<
152       \context ChordNames {
153          \set chordChanges = ##t
154          \harmonies
155       }
156    \context Staff = one \melody
157    >>
158
159    \paper{ }
160    \midi  { \tempo 4=60}
161 }
162
163 @end lilypond
164
165 @subsection Notes, lyrics, and chords.
166
167 This template allows you to prepare a song with melody, words, and chords.
168
169 @lilypond[verbatim,raggedright]
170
171 \version "2.3.16"
172 melody =  \relative c' {
173    \clef treble
174    \key c \major
175    \time 4/4
176
177    a b c d
178 }
179
180 text = \lyricmode {
181    Aaa Bee Cee Dee
182 }
183
184 harmonies = \chordmode {
185    a2 c2
186 }
187
188 \score {
189    <<
190       \context ChordNames {
191          \set chordChanges = ##t
192          \harmonies
193       }
194    \context Voice = one {
195       \autoBeamOff
196       \melody
197    }
198    \lyricsto "one" \new Lyrics \text
199    >>
200    \paper { }
201    \midi  { \tempo 4=60}
202 }
203
204 @end lilypond
205
206 @node Piano templates
207 @section Piano templates
208 @subsection Solo piano
209
210 Here is a simple piano staff.
211
212 @lilypond[verbatim,raggedright]
213
214 \version "2.3.16"
215 upper = \relative c'' {
216    \clef treble
217    \key c \major
218    \time 4/4
219
220    a b c d
221 }
222
223 lower = \relative c {
224    \clef bass
225    \key c \major
226    \time 4/4
227
228    a2 c
229 }
230
231 \score {
232    \context PianoStaff <<
233       \set PianoStaff.instrument = "Piano  "
234       \context Staff = upper \upper
235       \context Staff = lower \lower
236    >>  
237    \paper { }  
238    \midi { \tempo 4=60 }  
239 }
240
241 @end lilypond
242
243 @subsection Piano and melody with lyrics
244
245 Here is a typical song format: one staff with the melody and lyrics, with
246 piano accompaniment underneath.
247
248 @lilypond[verbatim,raggedright]
249
250 \version "2.3.16"
251 melody =  \relative c'' {
252    \clef treble
253    \key c \major
254    \time 4/4
255
256    a b c d
257 }
258
259 text = \lyricmode {
260    Aaa Bee Cee Dee
261 }
262
263 upper = \relative c'' {
264    \clef treble
265    \key c \major
266    \time 4/4
267
268    a b c d
269 }
270
271 lower = \relative c {
272    \clef bass
273    \key c \major
274    \time 4/4
275
276    a2 c
277 }
278
279 \score {
280    <<
281       \context Voice = mel {
282           \autoBeamOff
283           \melody
284       }
285       \lyricsto mel \new Lyrics \text
286
287       \context PianoStaff <<
288          \context Staff = upper \upper
289          \context Staff = lower \lower
290       >>
291    >>
292    \paper {
293       \context { \RemoveEmptyStaffContext }
294    }  
295    \midi { \tempo 4=60}
296 }
297
298 @end lilypond
299
300 @node Small ensembles
301 @section Small ensembles
302 @subsection SATB vocal score
303
304 Here is a standard four-part SATB vocal score.  With larger ensembles,
305 it's often useful to include a section which is included in all
306 parts.  For example, the time signature and key signatures are almost
307 always the same for all parts.
308
309 @lilypond[verbatim,raggedright]
310
311 \version "2.3.16"
312 global = {
313    \key c \major
314    \time 4/4
315 }
316
317 sopMusic = \relative c'' {
318    c4 c c8[( b)] c4
319 }
320 sopWords = \lyricmode {
321    hi hi hi hi
322 }
323
324 altoMusic = \relative c' {
325    e4 f d e 
326 }
327 altoWords =\lyricmode {
328    ha ha ha ha
329 }
330
331 tenorMusic = \relative c' {
332    g4 a f g
333 }
334 tenorWords = \lyricmode {
335    hu hu hu hu
336 }
337
338 bassMusic = \relative c {
339    c4 c g c
340 }
341 bassWords = \lyricmode {
342    ho ho ho ho
343 }
344
345 \score { 
346    \context ChoirStaff <<
347       \context Lyrics = sopranos { s1 }
348       \context Staff = women <<
349          \context Voice = sopranos { \voiceOne << \global \sopMusic >> }
350          \context Voice = altos { \voiceTwo << \global \altoMusic >> }
351       >>
352       \context Lyrics = altos { s1 }
353       \context Lyrics = tenors { s1 }
354       \context Staff = men <<
355          \clef bass
356          \context Voice = tenors { \voiceOne <<\global \tenorMusic >> }
357          \context Voice = basses { \voiceTwo <<\global \bassMusic >> }
358       >>
359       \context Lyrics = basses { s1 }
360       \context Lyrics = sopranos \lyricsto sopranos \sopWords
361       \context Lyrics = altos \lyricsto altos \altoWords
362       \context Lyrics = tenors \lyricsto tenors \tenorWords
363       \context Lyrics = basses \lyricsto basses \bassWords
364    >>
365
366    \paper {
367       \context {
368          % a little smaller so lyrics can be closer to the staff. 
369          \Staff minimumVerticalExtent = #'(-3 . 3) 
370       }
371    }
372 }
373
374 @end lilypond
375
376 @subsection Transcription of mensural music
377
378 When transcribing mensural music, an incipit at the beginning of the
379 piece is useful to indicate the original key and tempo.  While today
380 musicians are used to bar lines in order to faster recognize rhythmic
381 patterns, bar lines where not yet invented during the period of
382 mensural music; in fact, the meter often changed after every few
383 notes.  As a compromise, bar lines are often printed between the
384 staves rather than on the staves.
385
386 @lilypond[verbatim,raggedright]
387
388 \version "2.3.16"
389
390 global = {
391     % incipit
392     \once \override Score.SystemStartBracket #'transparent = ##t
393     \key f \major
394     \time 2/2
395     \once \override Staff.TimeSignature #'style = #'neomensural
396     \override Voice.NoteHead #'style = #'neomensural
397     \override Voice.Rest #'style = #'neomensural
398     \set Staff.printKeyCancellation = ##f
399     \cadenzaOn % turn off bar lines
400     \skip 1*10
401     \once \override Staff.BarLine #'transparent = ##f
402     \bar "||"
403     \skip 1*1 % need this extra \skip such that clef change comes
404               % after bar line
405     \bar ""
406
407     % main
408     \cadenzaOff % turn bar lines on again
409     \once \override Staff.Clef #'full-size-change = ##t
410     \set Staff.forceClef = ##t
411     \key g \major
412     \time 4/4
413     \override Voice.NoteHead #'style = #'default
414     \override Voice.Rest #'style = #'default
415
416     % FIXME: setting printKeyCancellation back to #t must not
417     % occur in the first bar after the incipit.  Dto. for forceClef.
418     % Therefore, we need an extra \skip.
419     \skip 1*1
420     \set Staff.printKeyCancellation = ##t
421     \set Staff.forceClef = ##f
422
423     \skip 1*5
424
425     % last bar contains a brevis (i.e. spans 2 bars);
426     % therefore do not draw this particular bar
427     \cadenzaOn
428     \skip 1*2
429     \cadenzaOff
430
431     % let finis bar go through all staves
432     \override Staff.BarLine #'transparent = ##f
433
434     % finis bar
435     \bar "|."
436 }
437
438 discantusNotes = {
439     \transpose c' c'' {
440         \set Staff.instrument = "Discantus  "
441
442         % incipit
443         \clef "neomensural-c1"
444         c'1. s2   % two bars
445         \skip 1*8 % eight bars
446         \skip 1*1 % one bar
447
448         % main
449         \clef "treble"
450         d'2. d'4 |
451         b e' d'2 |
452         c'4 e'4.( d'8 c' b |
453         a4) b a2 |
454         b4.( c'8 d'4) c'4 |
455         \once \override NoteHead #'transparent = ##t c'1 |
456         b\breve |
457     }
458 }
459
460 discantusLyrics = \lyricmode {
461     % incipit
462     IV-
463
464     % main
465     Ju -- bi -- |
466     la -- te De -- |
467     o, om --
468     nis ter -- |
469     ra, __ om- |
470     "..." |
471     -us. |
472 }
473
474 altusNotes = {
475     \transpose c' c'' {
476         \set Staff.instrument = "Altus  "
477
478         % incipit
479         \clef "neomensural-c3"
480         r1        % one bar
481         f1. s2    % two bars
482         \skip 1*7 % seven bars
483         \skip 1*1 % one bar
484
485         % main
486         \clef "treble"
487         r2 g2. e4 fis g | % two bars
488         a2 g4 e |
489         fis g4.( fis16 e fis4) |
490         g1 |
491         \once \override NoteHead #'transparent = ##t g1 |
492         g\breve |
493     }
494 }
495
496 altusLyrics = \lyricmode {
497     % incipit
498     IV-
499
500     % main
501     Ju -- bi -- la -- te | % two bars
502     De -- o, om -- |
503     nis ter -- ra, |
504     "..." |
505     -us. |
506 }
507
508 tenorNotes = {
509     \transpose c' c' {
510         \set Staff.instrument = "Tenor  "
511
512         % incipit
513         \clef "neomensural-c4"
514         r\longa   % four bars
515         r\breve   % two bars
516         r1        % one bar
517         c'1. s2   % two bars
518         \skip 1*1 % one bar
519         \skip 1*1 % one bar
520
521         % main
522         \clef "treble_8"
523         R1 |
524         R1 |
525         R1 |
526         r2 d'2. d'4 b e' | % two bars
527         \once \override NoteHead #'transparent = ##t e'1 |
528         d'\breve |
529     }
530 }
531
532 tenorLyrics = \lyricmode {
533     % incipit
534     IV-
535
536     % main
537     Ju -- bi -- la -- te | % two bars
538     "..." |
539     -us. |
540 }
541
542 bassusNotes = {
543     \transpose c' c' {
544         \set Staff.instrument = "Bassus  "
545
546         % incipit
547         \clef "bass"
548         r\maxima  % eight bars
549         f1. s2    % two bars
550         \skip 1*1 % one bar
551
552         % main
553         \clef "bass"
554         R1 |
555         R1 |
556         R1 |
557         R1 |
558         g2. e4 |
559         \once \override NoteHead #'transparent = ##t e1 |
560         g\breve |
561     }
562 }
563
564 bassusLyrics = \lyricmode {
565     % incipit
566     IV-
567
568     % main
569     Ju -- bi- |
570     "..." |
571     -us. |
572 }
573
574 \score {
575     \context StaffGroup = choirStaff <<
576         \context Voice = discantusNotes << \global \discantusNotes >>
577         \context Lyrics = discantusLyrics \lyricsto discantusNotes { \discantusLyrics }
578         \context Voice = altusNotes << \global \altusNotes >>
579         \context Lyrics = altusLyrics \lyricsto altusNotes { \altusLyrics }
580         \context Voice = tenorNotes << \global \tenorNotes >>
581         \context Lyrics = tenorLyrics \lyricsto tenorNotes { \tenorLyrics }
582         \context Voice = bassusNotes << \global \bassusNotes >>
583         \context Lyrics = bassusLyrics \lyricsto bassusNotes { \bassusLyrics }
584     >>
585     \paper {
586         \context {
587             \Score
588             \override BarLine #'transparent = ##t
589             \remove "System_start_delimiter_engraver"
590         }
591         \context {
592             \Voice
593             \override Slur #'transparent = ##t
594         }
595     }
596     \midi {
597         \tempo 4 = 96
598     }
599 }
600
601 @end lilypond
602
603 @subsection String quartet
604
605 This template demonstrates a string quartet.  It also uses a @code{\global}
606 section for time and key signatures.
607
608 @lilypond[verbatim,raggedright]
609
610 \version "2.3.16"
611 global = {
612    \time 4/4
613    \key c \major
614 }
615 violinOne = \relative c''{
616    \set Staff.instrument = "Violin 1  "
617    c2 d
618    e1
619 }
620 violinTwo = \relative c''{
621    \set Staff.instrument = "Violin 2  "
622    g2 g
623    g1
624 }
625 viola = \relative c'{
626    \set Staff.instrument = "Viola  "
627    \clef alto
628    e2 d
629    c1
630 }
631 cello = \relative c'{
632    \set Staff.instrument = "Cello  "
633    \clef bass
634    c2 g
635    c,1
636 }
637 \score {
638    \new StaffGroup <<
639       \new Staff << \global \violinOne >>
640       \new Staff << \global \violinTwo >>
641       \new Staff << \global \viola >>
642       \new Staff << \global \cello >>
643    >>
644    \paper { }
645    \midi { \tempo 4=60}
646 }
647
648 @end lilypond
649
650 @node Jazz combo
651 @section Jazz combo
652
653 This is a much more complicated template, for a jazz ensemble.  Note that all
654 instruments are notated @code{\key c \major}.  This refers to the key in
655 concert pitch; LilyPond will automatically transpose the key if the music
656 is within a @code{\transpose} section.
657
658 @c TODO must clean up this jazz combo example
659 @c   - transpositions stated in names (ie "trumpet in Bb" or whatever)
660 @c   - one global section, instead of "global" (time) and "key"
661 @c   - does it need those wierd macros?  sl, nsl, etc.
662 @c   - maybe ask Amelie Zapf to clean it up, or whether I should just
663 @c     make whatever changes I feel like.
664
665 @c FIXME: produces a warning ; key change merge.
666
667 @lilypond[verbatim,raggedright]
668
669 \version "2.3.16"
670 \header {
671         title = "Song"
672         subtitle = "(tune)"
673         composer = "Me"
674         meter = "moderato"
675         piece = "Swing"
676         tagline = "LilyPond example file by Amelie Zapf, Berlin 07/07/2003"
677         texidoc = "Jazz tune for combo (horns, guitar, piano, bass, drums)."
678 }
679
680 #(set-global-staff-size 16)
681 \include "english.ly"
682
683 %%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%%
684
685 sl = {
686     \override NoteHead  #'style = #'slash
687     \override Stem  #'transparent = ##t
688 }
689 nsl = {
690     \revert NoteHead #'style
691     \revert Stem #'transparent
692 }
693 cr = \override NoteHead  #'style = #'cross
694 ncr = \revert NoteHead #'style
695
696 %% insert chord name style stuff here.
697
698 jzchords = { } 
699
700
701 %%%%%%%%%%%% Keys'n'thangs %%%%%%%%%%%%%%%%%
702
703 global =  {
704     \time 4/4
705 }
706
707 Key =  { \key c \major }
708
709 % ############ Horns ############
710 % ------ Trumpet ------
711 trpt =  \transpose c d \relative c'' {
712     \Key
713     c1 c c
714 }
715
716 trpharmony = \transpose c' d { \jzchords }
717 trumpet = {
718     \global 
719     \set Staff.instrument = #"Trumpet"
720     \clef treble
721     \context Staff <<
722         \trpt
723     >>
724 }
725
726 % ------ Alto Saxophone ------
727 alto = \transpose c a \relative c' {
728         \Key
729         c1 c c
730 }
731
732 altoharmony = \transpose c' a { \jzchords }
733 altosax = {
734         \global
735         \set Staff.instrument = #"Alto Sax"
736         \clef treble
737         \context Staff <<
738                 \alto
739         >>
740 }
741
742 % ------ Baritone Saxophone ------
743 bari = \transpose c a' \relative c {
744         \Key
745         c1 c \sl d4^"Solo" d d d \nsl
746 }
747
748 bariharmony = \transpose c' a \chordmode { \jzchords s1 s d2:maj e:m7 }
749 barisax = {
750         \global
751         \set Staff.instrument = #"Bari Sax"
752         \clef treble
753         \context Staff <<
754                 \bari
755         >>
756 }
757 % ------ Trombone ------
758 tbone =  \relative c {
759         \Key
760         c1 c c
761 }
762
763 tboneharmony = \chordmode { \jzchords }
764 trombone = {
765         \global
766         \set Staff.instrument = #"Trombone"
767         \clef bass
768         \context Staff <<
769                 \tbone
770         >>
771 }
772 % ############ Rhythm Section #############
773 % ------ Guitar ------
774 gtr =  \relative c'' {
775         \Key
776         c1 \sl b4 b b b \nsl c1
777 }
778
779 gtrharmony = \chordmode { \jzchords
780         s1 c2:min7+ d2:maj9
781 }
782
783 guitar = {
784         \global
785         \set Staff.instrument = #"Guitar"
786         \clef treble
787         \context Staff <<
788                 \gtr
789         >>
790 }
791
792 %% ------ Piano ------
793 rhUpper =  \relative c'' {
794         \voiceOne
795         \Key
796         c1 c c
797 }
798
799 rhLower =  \relative c' {
800         \voiceTwo
801         \Key
802         e1 e e
803 }
804
805 lhUpper =  \relative c' {
806         \voiceOne
807         \Key
808         g1 g g
809 }
810
811 lhLower =  \relative c {
812         \voiceTwo
813         \Key
814         c1 c c
815 }
816
817 PianoRH = {
818         \clef treble
819         \global
820         \set Staff.midiInstrument = "acoustic grand"
821         \context Staff <<
822                 \context Voice = one \rhUpper
823                 \context Voice = two \rhLower
824         >>
825 }
826
827 PianoLH = {
828         \clef bass
829         \global
830         \set Staff.midiInstrument = "acoustic grand"
831         \context Staff <<
832                 \context Voice = one \lhUpper
833                 \context Voice = two \lhLower
834         >>
835 }
836
837 piano = {
838         \context PianoStaff <<
839                 \set PianoStaff.instrument = #"Piano"
840                 \context Staff = upper \PianoRH
841                 \context Staff = lower \PianoLH
842         >>
843 }
844
845 % ------ Bass Guitar ------
846 bass =  \relative c {
847         \Key
848         c1 c c
849 }
850
851 bass = {
852     \global
853     \set Staff.instrument = #"Bass"
854     \clef bass
855     \context Staff <<
856         \bass
857     >>
858 }
859
860                                 % ------ Drums ------
861
862 up = \drummode {
863     hh4 <hh sn>4 hh <hh sn> hh <hh sn>4
864     hh4 <hh sn>4
865     hh4 <hh sn>4
866     hh4 <hh sn>4
867 }
868
869 down = \drummode {
870     bd4 s bd s bd s bd s bd s bd s
871 }
872
873 drumContents = {
874         \global
875         <<
876                 \set DrumStaff.instrument = #"Drums"
877                 \new DrumVoice { \voiceOne \up }
878                 \new DrumVoice { \voiceTwo \down }
879         >>
880 }
881
882 %%%%%%%%% It All Goes Together Here %%%%%%%%%%%%%%%%%%%%%%
883
884 \score {
885 <<
886         \context StaffGroup = horns <<
887                 \context Staff = trumpet \trumpet
888
889                 \context Staff = altosax \altosax
890
891                 \context ChordNames = barichords \bariharmony
892
893                 \context Staff = barisax \barisax
894
895                 \context Staff = trombone \trombone
896         >>
897
898         \context StaffGroup = rhythm <<
899                 \context ChordNames = chords \gtrharmony
900                 \context Staff = guitar \guitar
901                 \context PianoStaff = piano \piano
902                 
903                 \context Staff = bass \bass
904                 
905                 \new DrumStaff { \drumContents }
906         >>
907 >>
908         \paper {
909                 \context { \RemoveEmptyStaffContext }
910                 \context {
911                         \Score
912                         \override BarNumber #'padding = #3
913                         \override RehearsalMark #'padding = #2
914                         skipBars = ##t
915                 }
916         }
917         \midi { \tempo 4 = 75 }
918 }
919
920 @end lilypond
921
922 @node Other templates
923 @section Other templates
924 @subsection All headers
925
926 This template displays all available headers.  Some of them are only
927 used in the Mutopia project; they don't affect the printed output at
928 all.  They are used  if you want the piece to be listed with different
929 information in the Mutopia database than you wish to have printed on the
930 music.  For example, Mutopia lists the composer of the famous D major
931 violin concerto as TchaikovskyPI, whereas perhaps you wish to print
932 "Petr Tchaikowski" on your music.
933
934 @lilypond[verbatim,raggedright]
935
936 \version "2.3.16"
937 \header {
938    dedication = "dedication"
939    title = "Title"
940    subtitle = "Subtitle"
941    subsubtitle = "Subsubtitle"
942    composer = "Composer (xxxx-yyyy)"
943    opus = "Opus 0"
944    piece = "Piece I"
945    instrument = "Instrument"
946    arranger = "Arranger"
947    poet = "Poet"
948    texttranslator = "Translator"
949    copyright = "public domain"
950
951 % These are headers used by the Mutopia Project  http://www.mutopiaproject.org/
952    mutopiatitle = ""
953    mutopiacomposer = ""
954    mutopiapoet = ""
955    mutopiainstrument = ""
956    date = "composer's dates"
957    source = "urtext "
958    maintainer = "your name here"
959    maintainerEmail = "your email here"
960    maintainerWeb = "your home page"
961    lastupdated = "2004/Aug/26"
962 }
963
964 \score {
965    \header {
966       piece = "piece1"
967       opus = "opus1"
968    }
969    { c'4 }
970 }
971
972 \score {
973    \header {
974       piece = "piece2"
975       opus = "opus2"
976    }
977    { c'4 }
978 }
979
980 @end lilypond
981
982 @subsection Gregorian template
983
984 This example demonstrates how to do modern transcriptions of Gregorian
985 music.  Gregorian music has no measure, no stems; it uses only half and
986 quarter notes, and two types of barlines, a short one indicating a rest,
987 and a second one indicating a breath mark.
988
989 @lilypond[verbatim,raggedright]
990
991 barOne = { \once \override Staff.BarLine  #'bar-size = #2
992    \bar "|" }
993 barTwo = { \once \override Staff.BarLine  #'extra-offset = #'(0 . 2)
994    \once \override Staff.BarLine  #'bar-size = #2
995    \bar "|" }
996 chant = \relative c' {
997    \set Score.timing = ##f
998    \override Staff.Stem  #'transparent = ##t
999
1000    f4 a2 \barTwo
1001    g4 a2 f2 \barOne
1002    g4( f) f( g) a2
1003 }
1004 \score {
1005    \chant
1006    \paper{ }
1007    \midi { \tempo 4=60 }
1008 }
1009
1010 @end lilypond
1011
1012 @subsection Bagpipe music
1013
1014 Here is an example of bagpipe music.  It demonstrates a big strength of
1015 LilyPond, compared to graphical score editors: in LilyPond, you can
1016 very easily reuse small segments of music without writing them out
1017 completely.  This template defines a large number of small segments
1018 (@code{taor, grip, thrd,} etc), which can be reused easily.
1019
1020 TODO - replace Bagpipe template with Andrew McNabb's work?
1021
1022 @lilypond[verbatim,raggedright]
1023
1024 taor = { \grace { g32[ d' g e'] } }
1025 grip = { \grace { g32[ b g ]    } }
1026 thrd = { \grace { g32[ d' c']   } }
1027 birl = { \grace { g32[ a g]     } }
1028 gstd = { \grace { g'32[ d' g]   } }
1029 fgg =  { \grace { f32[ g'32]    } }
1030 dblb = { \grace { g'32[ b d']   } }
1031 dblc = { \grace { g'32[ c' d']  } }
1032 dble = { \grace { g'32[ e' f']  } }
1033 dblf = { \grace { g'32[ f' g']  } }
1034 dblg = { \grace { g'32[ f']     } }
1035 dbla = { \grace { a'32[ g']     } }
1036 lgg =  { \grace { g32  } }
1037 lag =  { \grace { a32  } }
1038 cg   = { \grace { c'32 } }
1039 eg   = { \grace { e'32 } }
1040 gg   = { \grace { g'32 } }
1041 dg   = { \grace { d'32 } }
1042 hag  = { \grace { a'32 } }
1043 gefg = { \grace { g'32[ e' f']  } }
1044 efg  = { \grace { e'32[ f']     } }
1045 gdcg = { \grace { g'32[ d' c']  } }
1046 gcdg = { \grace { g'32[ c' d']  } }
1047         
1048 \transpose a a' {
1049     #(add-grace-property 'Voice 'Stem 'length 6)
1050     \time 6/8 \partial 4
1051     \tieUp
1052     \slurUp
1053     
1054     f'4 |
1055     \gg f'4 e'8 \thrd d'4. |
1056     \eg a4.(a4) d'8 |
1057     \gg d'4 f'8 \dble e'4. ( | \noBreak
1058     e'8) d'4 \gg d'4 e'8 |
1059
1060     \break
1061     \time 9/8
1062     \dblf f'2.( f'4) d'8 |
1063     \time 6/8
1064     \dblg g'4 a'8 \gg a'4. |
1065     \thrd d'4.( d'4) \eg a8 |
1066     \time 9/8
1067     \dble e'4 \lag e'8 \gg  e'16[ d'8. e'8] \gg f'4 g'8 |
1068
1069     \break
1070     \time 6/8
1071     \gg f'4 e'8 \thrd d'4. |
1072     \eg a4.( a4) d'8 |
1073     \dblg g'4 a'8 \gg a'4. |
1074     \thrd d'4.( d'4) f'8 |
1075
1076     \break
1077     \dblg g'4 e'8( e'8) \dblf  f'8.[ e'16] |
1078     \thrd d'4.( d'4) \cg d'8 |
1079     \gg c'4 e'8 \thrd d'4.( |
1080     d'4.) \gdcg d'4.
1081     
1082 }
1083
1084 @end lilypond
1085
1086