]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/examples.itely
Fixed misc broken links.
[lilypond.git] / Documentation / user / examples.itely
index 2582e3f00a4400ffdc9c8610be54fc070898d01e..53a68f0c9388f43ac17c45d14602e1a81851ebe5 100644 (file)
@@ -1,3 +1,4 @@
+@c -*- coding: latin-1; mode: texinfo; -*-
 @node Example templates
 @chapter Example templates
 
@@ -5,13 +6,17 @@ This section of the manual contains templates with the LilyPond score
 already set up for you.  Just add notes, run LilyPond, and enjoy
 beautiful printed scores!
 
+@c bad node name for ancient notation to avoid confict
 @menu
 * Suggestions for writing LilyPond files::
 * Single staff::
 * Piano templates::
 * Small ensembles::
+* Vocal ensembles::
+* Ancient notation templates::
 * Jazz combo::
 * Other templates::
+* Lilypond-book templates::
 @end menu
 
 @c TODO explain \score{} ?  Maybe add a note to the tutorial?
@@ -19,30 +24,30 @@ beautiful printed scores!
 @node Suggestions for writing LilyPond files
 @section Suggestions for writing LilyPond files
 
-Now you're ready to begin writing bigger LilyPond files -- not just the
+Now you're ready to begin writing larger LilyPond files -- not just the
 little examples in the tutorial, but whole pieces.  But how should you
 go about doing it?
 
-The best answer is ``however you want to do it''.  As long as LilyPond
+The best answer is ``however you want to do it.''  As long as LilyPond
 can understand your files and produces the output that you want, it
 doesn't matter what your files look like.  That said, sometimes we
 make mistakes when writing files.  If LilyPond can't understand your
 files, or produces output that you don't like, how do you fix the
 problem?
 
-Here are a few suggestions that can help you in avoiding or fixing
+Here are a few suggestions that can help you to avoid or fix
 problems:
 
 @itemize @bullet
 @item Include @code{\version} numbers in every file.  Note that all
-templates contain a @code{\version "2.3.16"} string.  We
+templates contain a @code{\version "2.4.0"} string.  We
 highly recommend that you always include the @code{\version}, no matter
 how small your file is.  Speaking from personal experience, it's
 quite frustrating to try to remember which version of LilyPond you were
 using a few years ago.  @code{convert-ly} requires you to declare
 which version of LilyPond you used.
 
-@item Include checks:  See @ref{Bar check} and @ref{Octave check}.  If you
+@item Include checks: See @ref{Bar check} and @ref{Octave check}.  If you
 include checks every so often, then if you make a mistake, you can pinpoint
 it quicker.  How often is ``every so often''?  It depends on the complexity
 of the music.  For very simple music, perhaps just once or twice.  For
@@ -70,9 +75,8 @@ The first example gives you a staff with notes, suitable for a solo
 instrument or a melodic fragment.  Cut and paste this into a file,
 add notes, and you're finished!
 
-@lilypond[verbatim,raggedright]
-
-\version "2.3.16"
+@lilypond[quote,verbatim,raggedright]
+\version "2.4.0"
 melody = \relative c' {
    \clef treble
    \key c \major
@@ -81,12 +85,11 @@ melody = \relative c' {
    a4 b c d
 }
 
-\score{
+\score {
    \new Staff \melody
-   \paper { }
+   \layout { }
    \midi { \tempo 4=60 }
 }
-
 @end lilypond
 
 @subsection Notes and lyrics
@@ -97,9 +100,8 @@ automatic beaming, which is common for vocal parts.  If you want to use
 automatic beaming, you'll have to change or comment out the relevant
 line.
 
-@lilypond[verbatim,raggedright]
-
-\version "2.3.16"
+@lilypond[quote,verbatim,raggedright]
+\version "2.4.0"
 melody = \relative c' {
    \clef treble
    \key c \major
@@ -120,20 +122,18 @@ text = \lyricmode {
       }
       \lyricsto "one" \new Lyrics \text
    >>
-   \paper { }
+   \layout { }
    \midi { \tempo 4=60 }
 }
-
 @end lilypond
 
 @subsection Notes and chords
 
-Want to prepare a lead sheet with a melody and chords?  Look no farther!
-
-@lilypond[verbatim,raggedright]
+Want to prepare a lead sheet with a melody and chords?  Look no further!
 
-\version "2.3.16"
-melody =  \relative c' {
+@lilypond[quote,verbatim,raggedright]
+\version "2.4.0"
+melody = \relative c' {
    \clef treble
    \key c \major
    \time 4/4
@@ -155,20 +155,18 @@ harmonies = \chordmode {
    \context Staff = one \melody
    >>
 
-   \paper{ }
-   \midi  { \tempo 4=60}
+   \layout{ }
+   \midi { \tempo 4=60}
 }
-
 @end lilypond
 
 @subsection Notes, lyrics, and chords.
 
 This template allows you to prepare a song with melody, words, and chords.
 
-@lilypond[verbatim,raggedright]
-
-\version "2.3.16"
-melody =  \relative c' {
+@lilypond[quote,verbatim,raggedright]
+\version "2.4.0"
+melody = \relative c' {
    \clef treble
    \key c \major
    \time 4/4
@@ -196,10 +194,9 @@ harmonies = \chordmode {
    }
    \lyricsto "one" \new Lyrics \text
    >>
-   \paper { }
-   \midi  { \tempo 4=60}
+   \layout { }
+   \midi { \tempo 4=60 }
 }
-
 @end lilypond
 
 @node Piano templates
@@ -208,9 +205,8 @@ harmonies = \chordmode {
 
 Here is a simple piano staff.
 
-@lilypond[verbatim,raggedright]
-
-\version "2.3.16"
+@lilypond[quote,verbatim,raggedright]
+\version "2.4.0"
 upper = \relative c'' {
    \clef treble
    \key c \major
@@ -232,11 +228,10 @@ lower = \relative c {
       \set PianoStaff.instrument = "Piano  "
       \context Staff = upper \upper
       \context Staff = lower \lower
-   >>  
-   \paper { }  
-   \midi { \tempo 4=60 }  
+   >>
+   \layout { }
+   \midi { \tempo 4=60 }
 }
-
 @end lilypond
 
 @subsection Piano and melody with lyrics
@@ -244,10 +239,9 @@ lower = \relative c {
 Here is a typical song format: one staff with the melody and lyrics, with
 piano accompaniment underneath.
 
-@lilypond[verbatim,raggedright]
-
-\version "2.3.16"
-melody =  \relative c'' {
+@lilypond[quote,verbatim,raggedright]
+\version "2.4.0"
+melody = \relative c'' {
    \clef treble
    \key c \major
    \time 4/4
@@ -288,16 +282,208 @@ lower = \relative c {
          \context Staff = lower \lower
       >>
    >>
-   \paper {
+   \layout {
       \context { \RemoveEmptyStaffContext }
-   }  
-   \midi { \tempo 4=60}
+   }
+   \midi { \tempo 4=60 }
 }
+@end lilypond
+
+
+@subsection Piano centered lyrics
 
+Instead of having a full staff for the melody and lyrics, you can place
+the lyrics between the piano staff (and omit the separate melody staff).
+
+@lilypond[quote,verbatim,raggedright]
+\version "2.4.0"
+upper = \relative c'' {
+   \clef treble
+   \key c \major
+   \time 4/4
+
+   a b c d
+}
+
+lower = \relative c {
+   \clef bass
+   \key c \major
+   \time 4/4
+
+   a2 c
+}
+
+text = \lyricmode {
+   Aaa Bee Cee Dee
+}
+
+\score {
+  \context GrandStaff <<
+    \context Staff = upper {
+        \context Voice = singer \upper }
+    \lyricsto "singer" \new Lyrics \text
+    \context Staff = lower <<
+      \clef bass
+      \lower
+    >>
+  >>
+  \layout {
+    \context { \GrandStaff \accepts "Lyrics" }
+    \context { \Lyrics \consists "Bar_engraver" }
+  }
+  \midi { \tempo 4=60 }
+}
 @end lilypond
 
+
+@subsection Piano centered dynamics
+
+Many piano scores have the dynamics centered between the two
+staffs.  This requires a bit of tweaking to implement, but
+since the template is right here, you don't have to do the
+tweaking yourself.
+
+@lilypond[quote,verbatim,raggedright]
+\version "2.4.0"
+upper = \relative c'' {
+  \clef treble
+  \key c \major
+  \time 4/4
+
+  a b c d
+}
+
+lower = \relative c {
+  \clef bass
+  \key c \major
+  \time 4/4
+
+  a2 c
+}
+
+dynamics = {
+  s2\fff\> s4
+  s\!\pp
+}
+
+pedal = {
+  s2\sustainDown s2\sustainUp
+}
+
+\score {
+  \context PianoStaff <<
+    \context Staff=upper \upper
+    \context Dynamics=dynamics \dynamics
+    \context Staff=lower <<
+      \clef bass
+      \lower
+    >>
+    \context Dynamics=pedal \pedal
+  >>
+  \layout {
+    \context {
+      \type "Engraver_group_engraver"
+      \name Dynamics
+      \alias Voice % So that \cresc works, for example.
+      \consists "Output_property_engraver"
+
+      minimumVerticalExtent = #'(-1 . 1)
+      pedalSustainStrings = #'("Ped." "*Ped." "*")
+      pedalUnaCordaStrings = #'("una corda" "" "tre corde")
+
+      \consists "Piano_pedal_engraver"
+      \consists "Script_engraver"
+      \consists "Dynamic_engraver"
+      \consists "Text_engraver"
+
+      \override TextScript #'font-size = #2
+      \override TextScript #'font-shape = #'italic
+      \override DynamicText #'extra-offset = #'(0 . 2.5)
+      \override Hairpin #'extra-offset = #'(0 . 2.5)
+
+      \consists "Skip_event_swallow_translator"
+
+      \consists "Axis_group_engraver"
+    }
+    \context {
+      \PianoStaff
+      \accepts Dynamics
+      \override VerticalAlignment #'forced-distance = #7
+    }
+  }
+  \midi {
+    \context {
+      \type "Performer_group_performer"
+      \name Dynamics
+      \consists "Piano_pedal_performer"
+      \consists "Span_dynamic_performer"
+      \consists "Dynamic_performer"
+    }
+    \context {
+      \PianoStaff
+      \accepts Dynamics
+    }
+  }
+}
+@end lilypond
+
+
 @node Small ensembles
 @section Small ensembles
+@subsection String quartet
+
+This template demonstrates a string quartet.  It also uses a @code{\global}
+section for time and key signatures.
+
+@lilypond[quote,verbatim,raggedright]
+\version "2.4.0"
+global = {
+   \time 4/4
+   \key c \major
+}
+
+violinOne = \relative c''{
+   \set Staff.instrument = "Violin 1  "
+   c2 d
+   e1
+}
+
+violinTwo = \relative c''{
+   \set Staff.instrument = "Violin 2  "
+   g2 g
+   g1
+}
+
+viola = \relative c'{
+   \set Staff.instrument = "Viola  "
+   \clef alto
+   e2 d
+   c1
+}
+
+cello = \relative c'{
+   \set Staff.instrument = "Cello  "
+   \clef bass
+   c2 g
+   c,1
+}
+
+\score {
+   \new StaffGroup <<
+      \new Staff << \global \violinOne >>
+      \new Staff << \global \violinTwo >>
+      \new Staff << \global \viola >>
+      \new Staff << \global \cello >>
+   >>
+   \layout { }
+   \midi { \tempo 4=60}
+}
+@end lilypond
+
+
+@node Vocal ensembles
+@section Vocal ensembles
+
 @subsection SATB vocal score
 
 Here is a standard four-part SATB vocal score.  With larger ensembles,
@@ -305,9 +491,8 @@ it's often useful to include a section which is included in all
 parts.  For example, the time signature and key signatures are almost
 always the same for all parts.
 
-@lilypond[verbatim,raggedright]
-
-\version "2.3.16"
+@lilypond[quote,verbatim,raggedright]
+\version "2.4.0"
 global = {
    \key c \major
    \time 4/4
@@ -321,7 +506,7 @@ sopWords = \lyricmode {
 }
 
 altoMusic = \relative c' {
-   e4 f d e 
+   e4 f d e
 }
 altoWords =\lyricmode {
    ha ha ha ha
@@ -341,19 +526,23 @@ bassWords = \lyricmode {
    ho ho ho ho
 }
 
-\score { 
+\score {
    \context ChoirStaff <<
       \context Lyrics = sopranos { s1 }
       \context Staff = women <<
-         \context Voice = sopranos { \voiceOne << \global \sopMusic >> }
-         \context Voice = altos { \voiceTwo << \global \altoMusic >> }
+         \context Voice =
+           sopranos { \voiceOne << \global \sopMusic >> }
+         \context Voice =
+           altos { \voiceTwo << \global \altoMusic >> }
       >>
       \context Lyrics = altos { s1 }
       \context Lyrics = tenors { s1 }
       \context Staff = men <<
          \clef bass
-         \context Voice = tenors { \voiceOne <<\global \tenorMusic >> }
-         \context Voice = basses { \voiceTwo <<\global \bassMusic >> }
+         \context Voice =
+           tenors { \voiceOne <<\global \tenorMusic >> }
+         \context Voice =
+           basses { \voiceTwo <<\global \bassMusic >> }
       >>
       \context Lyrics = basses { s1 }
       \context Lyrics = sopranos \lyricsto sopranos \sopWords
@@ -362,68 +551,258 @@ bassWords = \lyricmode {
       \context Lyrics = basses \lyricsto basses \bassWords
    >>
 
-   \paper {
+   \layout {
       \context {
-         % a little smaller so lyrics can be closer to the staff. 
-         \Staff minimumVerticalExtent = #'(-3 . 3) 
+         % a little smaller so lyrics
+         % can be closer to the staff
+         \Staff minimumVerticalExtent = #'(-3 . 3)
       }
    }
 }
-
 @end lilypond
 
-@subsection String quartet
 
-This template demonstrates a string quartet.  It also uses a @code{\global}
-section for time and key signatures.
+@c bad node name to avoid node name confict
+@node Ancient notation templates
+@section Ancient notation templates
+
+@subsection Transcription of mensural music
+
+When transcribing mensural music, an incipit at the beginning of the
+piece is useful to indicate the original key and tempo.  While today
+musicians are used to bar lines in order to faster recognize rhythmic
+patterns, bar lines where not yet invented during the period of
+mensural music; in fact, the meter often changed after every few
+notes.  As a compromise, bar lines are often printed between the
+staves rather than on the staves.
 
-@lilypond[verbatim,raggedright]
+@lilypond[quote,verbatim,linewidth=11.0\cm]
+\version "2.4.0"
 
-\version "2.3.16"
 global = {
-   \time 4/4
-   \key c \major
-}
-violinOne = \relative c''{
-   \set Staff.instrument = "Violin 1  "
-   c2 d
-   e1
-}
-violinTwo = \relative c''{
-   \set Staff.instrument = "Violin 2  "
-   g2 g
-   g1
-}
-viola = \relative c'{
-   \set Staff.instrument = "Viola  "
-   \clef alto
-   e2 d
-   c1
-}
-cello = \relative c'{
-   \set Staff.instrument = "Cello  "
-   \clef bass
-   c2 g
-   c,1
+  % incipit
+  \once \override Score.SystemStartBracket #'transparent = ##t
+  \key f \major
+  \time 2/2
+  \once \override Staff.TimeSignature #'style = #'neomensural
+  \override Voice.NoteHead #'style = #'neomensural
+  \override Voice.Rest #'style = #'neomensural
+  \set Staff.printKeyCancellation = ##f
+  \cadenzaOn % turn off bar lines
+  \skip 1*10
+  \once \override Staff.BarLine #'transparent = ##f
+  \bar "||"
+  \skip 1*1 % need this extra \skip such that clef change comes
+            % after bar line
+  \bar ""
+
+  % main
+  \cadenzaOff % turn bar lines on again
+  \once \override Staff.Clef #'full-size-change = ##t
+  \set Staff.forceClef = ##t
+  \key g \major
+  \time 4/4
+  \override Voice.NoteHead #'style = #'default
+  \override Voice.Rest #'style = #'default
+
+  % FIXME: setting printKeyCancellation back to #t must not
+  % occur in the first bar after the incipit.  Dto. for forceClef.
+  % Therefore, we need an extra \skip.
+  \skip 1*1
+  \set Staff.printKeyCancellation = ##t
+  \set Staff.forceClef = ##f
+
+  \skip 1*5
+
+  % last bar contains a brevis (i.e., spans 2 bars);
+  % therefore do not draw this particular bar
+  \cadenzaOn
+  \skip 1*2
+  \cadenzaOff
+
+  % let finis bar go through all staves
+  \override Staff.BarLine #'transparent = ##f
+
+  % finis bar
+  \bar "|."
+}
+
+discantusNotes = {
+  \transpose c' c'' {
+    \set Staff.instrument = "Discantus  "
+
+    % incipit
+    \clef "neomensural-c1"
+    c'1. s2   % two bars
+    \skip 1*8 % eight bars
+    \skip 1*1 % one bar
+
+    % main
+    \clef "treble"
+    d'2. d'4 |
+    b e' d'2 |
+    c'4 e'4.( d'8 c' b |
+    a4) b a2 |
+    b4.( c'8 d'4) c'4 |
+    \once \override NoteHead #'transparent = ##t c'1 |
+    b\breve |
+  }
+}
+
+discantusLyrics = \lyricmode {
+  % incipit
+  IV-
+
+  % main
+  Ju -- bi -- |
+  la -- te De -- |
+  o, om --
+  nis ter -- |
+  ra, __ om- |
+  "..." |
+  -us. |
+}
+
+altusNotes = {
+  \transpose c' c'' {
+    \set Staff.instrument = "Altus  "
+
+    % incipit
+    \clef "neomensural-c3"
+    r1        % one bar
+    f1. s2    % two bars
+    \skip 1*7 % seven bars
+    \skip 1*1 % one bar
+
+    % main
+    \clef "treble"
+    r2 g2. e4 fis g | % two bars
+    a2 g4 e |
+    fis g4.( fis16 e fis4) |
+    g1 |
+    \once \override NoteHead #'transparent = ##t g1 |
+    g\breve |
+  }
+}
+
+altusLyrics = \lyricmode {
+  % incipit
+  IV-
+
+  % main
+  Ju -- bi -- la -- te | % two bars
+  De -- o, om -- |
+  nis ter -- ra, |
+  "..." |
+  -us. |
+}
+
+tenorNotes = {
+  \transpose c' c' {
+    \set Staff.instrument = "Tenor  "
+
+    % incipit
+    \clef "neomensural-c4"
+    r\longa   % four bars
+    r\breve   % two bars
+    r1        % one bar
+    c'1. s2   % two bars
+    \skip 1*1 % one bar
+    \skip 1*1 % one bar
+
+    % main
+    \clef "treble_8"
+    R1 |
+    R1 |
+    R1 |
+    r2 d'2. d'4 b e' | % two bars
+    \once \override NoteHead #'transparent = ##t e'1 |
+    d'\breve |
+  }
+}
+
+tenorLyrics = \lyricmode {
+  % incipit
+  IV-
+
+  % main
+  Ju -- bi -- la -- te | % two bars
+  "..." |
+  -us. |
+}
+
+bassusNotes = {
+  \transpose c' c' {
+    \set Staff.instrument = "Bassus  "
+
+    % incipit
+    \clef "bass"
+    r\maxima  % eight bars
+    f1. s2    % two bars
+    \skip 1*1 % one bar
+
+    % main
+    \clef "bass"
+    R1 |
+    R1 |
+    R1 |
+    R1 |
+    g2. e4 |
+    \once \override NoteHead #'transparent = ##t e1 |
+    g\breve |
+  }
+}
+
+bassusLyrics = \lyricmode {
+  % incipit
+  IV-
+
+  % main
+  Ju -- bi- |
+  "..." |
+  -us. |
 }
+
 \score {
-   \new StaffGroup <<
-      \new Staff << \global \violinOne >>
-      \new Staff << \global \violinTwo >>
-      \new Staff << \global \viola >>
-      \new Staff << \global \cello >>
-   >>
-   \paper { }
-   \midi { \tempo 4=60}
+  \context StaffGroup = choirStaff <<
+    \context Voice =
+      discantusNotes << \global \discantusNotes >>
+    \context Lyrics =
+      discantusLyrics \lyricsto discantusNotes { \discantusLyrics }
+    \context Voice =
+      altusNotes << \global \altusNotes >>
+    \context Lyrics =
+      altusLyrics \lyricsto altusNotes { \altusLyrics }
+    \context Voice =
+      tenorNotes << \global \tenorNotes >>
+    \context Lyrics =
+      tenorLyrics \lyricsto tenorNotes { \tenorLyrics }
+    \context Voice =
+      bassusNotes << \global \bassusNotes >>
+    \context Lyrics =
+      bassusLyrics \lyricsto bassusNotes { \bassusLyrics }
+  >>
+  \layout {
+    \context {
+      \Score
+      \override BarLine #'transparent = ##t
+      \remove "System_start_delimiter_engraver"
+    }
+    \context {
+      \Voice
+      \override Slur #'transparent = ##t
+    }
+  }
 }
-
 @end lilypond
 
+
+
 @node Jazz combo
 @section Jazz combo
 
 This is a much more complicated template, for a jazz ensemble.  Note that all
-instruments are notated @code{\key c \major}.  This refers to the key in
+instruments are notated in @code{\key c \major}.  This refers to the key in
 concert pitch; LilyPond will automatically transpose the key if the music
 is within a @code{\transpose} section.
 
@@ -435,18 +814,20 @@ is within a @code{\transpose} section.
 @c     make whatever changes I feel like.
 
 @c FIXME: produces a warning ; key change merge.
+@c The `linewidth' argument is for the \header.
 
-@lilypond[verbatim,raggedright]
-
-\version "2.3.16"
+@lilypond[quote,verbatim,raggedright,linewidth]
+\version "2.4.0"
 \header {
-        title = "Song"
-        subtitle = "(tune)"
-        composer = "Me"
-        meter = "moderato"
-        piece = "Swing"
-       tagline = "LilyPond example file by Amelie Zapf, Berlin 07/07/2003"
-       texidoc = "Jazz tune for combo (horns, guitar, piano, bass, drums)."
+  title = "Song"
+  subtitle = "(tune)"
+  composer = "Me"
+  meter = "moderato"
+  piece = "Swing"
+  tagline = "LilyPond example file by Amelie Zapf,
+             Berlin 07/07/2003"
+  texidoc = "Jazz tune for combo
+             (horns, guitar, piano, bass, drums)."
 }
 
 #(set-global-staff-size 16)
@@ -455,240 +836,237 @@ is within a @code{\transpose} section.
 %%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%%
 
 sl = {
-    \override NoteHead  #'style = #'slash
-    \override Stem  #'transparent = ##t
+  \override NoteHead #'style = #'slash
+  \override Stem #'transparent = ##t
 }
 nsl = {
-    \revert NoteHead #'style
-    \revert Stem #'transparent
+  \revert NoteHead #'style
+  \revert Stem #'transparent
 }
-cr = \override NoteHead  #'style = #'cross
+cr = \override NoteHead #'style = #'cross
 ncr = \revert NoteHead #'style
 
 %% insert chord name style stuff here.
 
-jzchords = { } 
+jzchords = { }
 
 
 %%%%%%%%%%%% Keys'n'thangs %%%%%%%%%%%%%%%%%
 
-global =  {
-    \time 4/4
+global = {
+  \time 4/4
 }
 
-Key =  { \key c \major }
+Key = { \key c \major }
 
 % ############ Horns ############
+
 % ------ Trumpet ------
-trpt =  \transpose c d \relative c'' {
-    \Key
-    c1 c c
+trpt = \transpose c d \relative c'' {
+  \Key
+  c1 c c
+}
+trpharmony = \transpose c' d {
+  \jzchords
 }
-
-trpharmony = \transpose c' d { \jzchords }
 trumpet = {
-    \global 
-    \set Staff.instrument = #"Trumpet"
-    \clef treble
-    \context Staff <<
-       \trpt
-    >>
+  \global
+  \set Staff.instrument = #"Trumpet"
+  \clef treble
+  \context Staff <<
+    \trpt
+  >>
 }
 
 % ------ Alto Saxophone ------
 alto = \transpose c a \relative c' {
-       \Key
-        c1 c c
+  \Key
+  c1 c c
+}
+altoharmony = \transpose c' a {
+  \jzchords
 }
-
-altoharmony = \transpose c' a { \jzchords }
 altosax = {
-        \global
-        \set Staff.instrument = #"Alto Sax"
-        \clef treble
-        \context Staff <<
-                \alto
-        >>
+  \global
+  \set Staff.instrument = #"Alto Sax"
+  \clef treble
+  \context Staff <<
+    \alto
+  >>
 }
 
 % ------ Baritone Saxophone ------
 bari = \transpose c a' \relative c {
-       \Key
-        c1 c \sl d4^"Solo" d d d \nsl
+  \Key
+  c1 c \sl d4^"Solo" d d d \nsl
+}
+bariharmony = \transpose c' a \chordmode {
+  \jzchords s1 s d2:maj e:m7
 }
-
-bariharmony = \transpose c' a \chordmode { \jzchords s1 s d2:maj e:m7 }
 barisax = {
-        \global
-        \set Staff.instrument = #"Bari Sax"
-        \clef treble
-        \context Staff <<
-                \bari
-        >>
+  \global
+  \set Staff.instrument = #"Bari Sax"
+  \clef treble
+  \context Staff <<
+    \bari
+  >>
 }
+
 % ------ Trombone ------
-tbone =  \relative c {
-       \Key
-        c1 c c
+tbone = \relative c {
+  \Key
+  c1 c c
+}
+tboneharmony = \chordmode {
+  \jzchords
 }
-
-tboneharmony = \chordmode { \jzchords }
 trombone = {
-        \global
-        \set Staff.instrument = #"Trombone"
-        \clef bass
-        \context Staff <<
-                \tbone
-        >>
+  \global
+  \set Staff.instrument = #"Trombone"
+  \clef bass
+  \context Staff <<
+    \tbone
+  >>
 }
+
 % ############ Rhythm Section #############
+
 % ------ Guitar ------
-gtr =  \relative c'' {
-       \Key
-        c1 \sl b4 b b b \nsl c1
+gtr = \relative c'' {
+  \Key
+  c1 \sl b4 b b b \nsl c1
 }
-
-gtrharmony = \chordmode { \jzchords
-        s1 c2:min7+ d2:maj9
+gtrharmony = \chordmode {
+  \jzchords
+  s1 c2:min7+ d2:maj9
 }
-
 guitar = {
-        \global
-        \set Staff.instrument = #"Guitar"
-        \clef treble
-        \context Staff <<
-               \gtr
-        >>
+  \global
+  \set Staff.instrument = #"Guitar"
+  \clef treble
+  \context Staff <<
+    \gtr
+  >>
 }
 
 %% ------ Piano ------
-rhUpper =  \relative c'' {
-        \voiceOne
-       \Key
-        c1 c c
+rhUpper = \relative c'' {
+  \voiceOne
+  \Key
+  c1 c c
 }
-
-rhLower =  \relative c' {
-        \voiceTwo
-       \Key
-        e1 e e
+rhLower = \relative c' {
+  \voiceTwo
+  \Key
+  e1 e e
 }
 
-lhUpper =  \relative c' {
-        \voiceOne
-       \Key
-        g1 g g
+lhUpper = \relative c' {
+  \voiceOne
+  \Key
+  g1 g g
 }
-
-lhLower =  \relative c {
-        \voiceTwo
-       \Key
-        c1 c c
+lhLower = \relative c {
+  \voiceTwo
+  \Key
+  c1 c c
 }
 
 PianoRH = {
-        \clef treble
-        \global
-        \set Staff.midiInstrument = "acoustic grand"
-        \context Staff <<
-                \context Voice = one \rhUpper
-               \context Voice = two \rhLower
-        >>
+  \clef treble
+  \global
+  \set Staff.midiInstrument = "acoustic grand"
+  \context Staff <<
+    \context Voice = one \rhUpper
+    \context Voice = two \rhLower
+  >>
 }
-
 PianoLH = {
-        \clef bass
-        \global
-        \set Staff.midiInstrument = "acoustic grand"
-        \context Staff <<
-               \context Voice = one \lhUpper
-               \context Voice = two \lhLower
-        >>
+  \clef bass
+  \global
+  \set Staff.midiInstrument = "acoustic grand"
+  \context Staff <<
+    \context Voice = one \lhUpper
+    \context Voice = two \lhLower
+  >>
 }
 
 piano = {
-       \context PianoStaff <<
-               \set PianoStaff.instrument = #"Piano"
-               \context Staff = upper \PianoRH
-               \context Staff = lower \PianoLH
-        >>
+  \context PianoStaff <<
+    \set PianoStaff.instrument = #"Piano"
+    \context Staff = upper \PianoRH
+    \context Staff = lower \PianoLH
+  >>
 }
 
 % ------ Bass Guitar ------
-bass =  \relative c {
-       \Key
-        c1 c c
+Bass = \relative c {
+  \Key
+  c1 c c
 }
-
 bass = {
-    \global
-    \set Staff.instrument = #"Bass"
-    \clef bass
-    \context Staff <<
-       \bass
-    >>
+  \global
+  \set Staff.instrument = #"Bass"
+  \clef bass
+  \context Staff <<
+    \Bass
+  >>
 }
 
-                               % ------ Drums ------
-
+% ------ Drums ------
 up = \drummode {
-    hh4 <hh sn>4 hh <hh sn> hh <hh sn>4
-    hh4 <hh sn>4
-    hh4 <hh sn>4
-    hh4 <hh sn>4
+  hh4 <hh sn>4 hh <hh sn> hh <hh sn>4
+  hh4 <hh sn>4
+  hh4 <hh sn>4
+  hh4 <hh sn>4
 }
 
 down = \drummode {
-    bd4 s bd s bd s bd s bd s bd s
+  bd4 s bd s bd s bd s bd s bd s
 }
 
 drumContents = {
-       \global
-       <<
-               \set DrumStaff.instrument = #"Drums"
-               \new DrumVoice { \voiceOne \up }
-               \new DrumVoice { \voiceTwo \down }
-       >>
+  \global
+  <<
+    \set DrumStaff.instrument = #"Drums"
+    \new DrumVoice { \voiceOne \up }
+    \new DrumVoice { \voiceTwo \down }
+  >>
 }
 
 %%%%%%%%% It All Goes Together Here %%%%%%%%%%%%%%%%%%%%%%
 
 \score {
-<<
-        \context StaffGroup = horns <<
-                \context Staff = trumpet \trumpet
-
-                \context Staff = altosax \altosax
-
-               \context ChordNames = barichords \bariharmony
-
-                \context Staff = barisax \barisax
-
-                \context Staff = trombone \trombone
-        >>
-
-        \context StaffGroup = rhythm <<
-               \context ChordNames = chords \gtrharmony
-                \context Staff = guitar \guitar
-               \context PianoStaff = piano \piano
-                
-                \context Staff = bass \bass
-                
-                \new DrumStaff { \drumContents }
-        >>
->>
-        \paper {
-                \context { \RemoveEmptyStaffContext }
-                \context {
-                        \Score
-                        \override BarNumber #'padding = #3
-                        \override RehearsalMark #'padding = #2
-                        skipBars = ##t
-                }
-        }
-        \midi { \tempo 4 = 75 }
-}
+  <<
+    \context StaffGroup = horns <<
+      \context Staff = trumpet \trumpet
+      \context Staff = altosax \altosax
+      \context ChordNames = barichords \bariharmony
+      \context Staff = barisax \barisax
+      \context Staff = trombone \trombone
+    >>
+
+    \context StaffGroup = rhythm <<
+      \context ChordNames = chords \gtrharmony
+      \context Staff = guitar \guitar
+      \context PianoStaff = piano \piano
+      \context Staff = bass \bass
+      \new DrumStaff { \drumContents }
+    >>
+  >>
+
+  \layout {
+    \context { \RemoveEmptyStaffContext }
+    \context {
+      \Score
+      \override BarNumber #'padding = #3
+      \override RehearsalMark #'padding = #2
+      skipBars = ##t
+    }
+  }
 
+  \midi { \tempo 4 = 75 }
+}
 @end lilypond
 
 @node Other templates
@@ -697,58 +1075,58 @@ drumContents = {
 
 This template displays all available headers.  Some of them are only
 used in the Mutopia project; they don't affect the printed output at
-all.  They are used  if you want the piece to be listed with different
+all.  They are used if you want the piece to be listed with different
 information in the Mutopia database than you wish to have printed on the
 music.  For example, Mutopia lists the composer of the famous D major
 violin concerto as TchaikovskyPI, whereas perhaps you wish to print
 "Petr Tchaikowski" on your music.
 
-@lilypond[verbatim,raggedright]
-
-\version "2.3.16"
+@ The `linewidth' is for \header.
+@lilypond[quote,verbatim,raggedright,linewidth]
+\version "2.4.0"
 \header {
-   dedication = "dedication"
-   title = "Title"
-   subtitle = "Subtitle"
-   subsubtitle = "Subsubtitle"
-   composer = "Composer (xxxx-yyyy)"
-   opus = "Opus 0"
-   piece = "Piece I"
-   instrument = "Instrument"
-   arranger = "Arranger"
-   poet = "Poet"
-   texttranslator = "Translator"
-   copyright = "public domain"
-
-% These are headers used by the Mutopia Project  http://www.mutopiaproject.org/
-   mutopiatitle = ""
-   mutopiacomposer = ""
-   mutopiapoet = ""
-   mutopiainstrument = ""
-   date = "composer's dates"
-   source = "urtext "
-   maintainer = "your name here"
-   maintainerEmail = "your email here"
-   maintainerWeb = "your home page"
-   lastupdated = "2004/Aug/26"
+  dedication = "dedication"
+  title = "Title"
+  subtitle = "Subtitle"
+  subsubtitle = "Subsubtitle"
+  composer = "Composer (xxxx-yyyy)"
+  opus = "Opus 0"
+  piece = "Piece I"
+  instrument = "Instrument"
+  arranger = "Arranger"
+  poet = "Poet"
+  texttranslator = "Translator"
+  copyright = "public domain"
+
+  % These are headers used by the Mutopia Project
+  % http://www.mutopiaproject.org/
+  mutopiatitle = ""
+  mutopiacomposer = ""
+  mutopiapoet = ""
+  mutopiainstrument = ""
+  date = "composer's dates"
+  source = "urtext "
+  maintainer = "your name here"
+  maintainerEmail = "your email here"
+  maintainerWeb = "your home page"
+  lastupdated = "2004/Aug/26"
 }
 
 \score {
-   \header {
-      piece = "piece1"
-      opus = "opus1"
-   }
-   { c'4 }
+  \header {
+    piece = "piece1"
+    opus = "opus1"
+  }
+  { c'4 }
 }
 
 \score {
-   \header {
-      piece = "piece2"
-      opus = "opus2"
-   }
-   { c'4 }
+  \header {
+    piece = "piece2"
+    opus = "opus2"
+  }
+  { c'4 }
 }
-
 @end lilypond
 
 @subsection Gregorian template
@@ -758,27 +1136,25 @@ music.  Gregorian music has no measure, no stems; it uses only half and
 quarter notes, and two types of barlines, a short one indicating a rest,
 and a second one indicating a breath mark.
 
-@lilypond[verbatim,raggedright]
-
-barOne = { \once \override Staff.BarLine  #'bar-size = #2
-   \bar "|" }
-barTwo = { \once \override Staff.BarLine  #'extra-offset = #'(0 . 2)
-   \once \override Staff.BarLine  #'bar-size = #2
-   \bar "|" }
+@lilypond[quote,verbatim,raggedright]
+barOne = { \once \override Staff.BarLine #'bar-size = #2
+  \bar "|" }
+barTwo = { \once \override Staff.BarLine #'extra-offset = #'(0 . 2)
+  \once \override Staff.BarLine #'bar-size = #2
+  \bar "|" }
 chant = \relative c' {
-   \set Score.timing = ##f
-   \override Staff.Stem  #'transparent = ##t
+  \set Score.timing = ##f
+  \override Staff.Stem #'transparent = ##t
 
-   f4 a2 \barTwo
-   g4 a2 f2 \barOne
-   g4( f) f( g) a2
+  f4 a2 \barTwo
+  g4 a2 f2 \barOne
+  g4( f) f( g) a2
 }
 \score {
-   \chant
-   \paper{ }
-   \midi { \tempo 4=60 }
+  \chant
+  \layout{ }
+  \midi { \tempo 4=60 }
 }
-
 @end lilypond
 
 @subsection Bagpipe music
@@ -787,26 +1163,25 @@ Here is an example of bagpipe music.  It demonstrates a big strength of
 LilyPond, compared to graphical score editors: in LilyPond, you can
 very easily reuse small segments of music without writing them out
 completely.  This template defines a large number of small segments
-(@code{taor, grip, thrd,} etc), which can be reused easily.
-
-TODO - replace Bagpipe template with Andrew McNabb's work?
+(@code{taor}, @code{grip}, @code{thrd}, etc), which can be reused easily.
 
-@lilypond[verbatim,raggedright]
+@c TODO - replace Bagpipe template with Andrew McNabb's work?
 
+@lilypond[quote,verbatim]
 taor = { \grace { g32[ d' g e'] } }
 grip = { \grace { g32[ b g ]    } }
 thrd = { \grace { g32[ d' c']   } }
 birl = { \grace { g32[ a g]     } }
 gstd = { \grace { g'32[ d' g]   } }
-fgg  { \grace { f32[ g'32]    } }
+fgg  = { \grace { f32[ g'32]    } }
 dblb = { \grace { g'32[ b d']   } }
 dblc = { \grace { g'32[ c' d']  } }
 dble = { \grace { g'32[ e' f']  } }
 dblf = { \grace { g'32[ f' g']  } }
 dblg = { \grace { g'32[ f']     } }
 dbla = { \grace { a'32[ g']     } }
-lgg  { \grace { g32  } }
-lag  { \grace { a32  } }
+lgg  = { \grace { g32  } }
+lag  = { \grace { a32  } }
 cg   = { \grace { c'32 } }
 eg   = { \grace { e'32 } }
 gg   = { \grace { g'32 } }
@@ -816,43 +1191,96 @@ gefg = { \grace { g'32[ e' f']  } }
 efg  = { \grace { e'32[ f']     } }
 gdcg = { \grace { g'32[ d' c']  } }
 gcdg = { \grace { g'32[ c' d']  } }
-       
+
 \transpose a a' {
-    #(add-grace-property 'Voice 'Stem 'length 6)
-    \time 6/8 \partial 4
-    \tieUp
-    \slurUp
-    
-    f'4 |
-    \gg f'4 e'8 \thrd d'4. |
-    \eg a4.(a4) d'8 |
-    \gg d'4 f'8 \dble e'4. ( | \noBreak
-    e'8) d'4 \gg d'4 e'8 |
-
-    \break
-    \time 9/8
-    \dblf f'2.( f'4) d'8 |
-    \time 6/8
-    \dblg g'4 a'8 \gg a'4. |
-    \thrd d'4.( d'4) \eg a8 |
-    \time 9/8
-    \dble e'4 \lag e'8 \gg  e'16[ d'8. e'8] \gg f'4 g'8 |
-
-    \break
-    \time 6/8
-    \gg f'4 e'8 \thrd d'4. |
-    \eg a4.( a4) d'8 |
-    \dblg g'4 a'8 \gg a'4. |
-    \thrd d'4.( d'4) f'8 |
-
-    \break
-    \dblg g'4 e'8( e'8) \dblf  f'8.[ e'16] |
-    \thrd d'4.( d'4) \cg d'8 |
-    \gg c'4 e'8 \thrd d'4.( |
-    d'4.) \gdcg d'4.
-    
+  #(add-grace-property 'Voice 'Stem 'length 6)
+  \time 6/8 \partial 4
+  \tieUp
+  \slurUp
+
+  f'4 |
+  \gg f'4 e'8 \thrd d'4. |
+  \eg a4.(a4) d'8 |
+  \gg d'4 f'8 \dble e'4. ( | \noBreak
+  e'8) d'4 \gg d'4 e'8 |
+
+  \break
+  \time 9/8
+  \dblf f'2.( f'4) d'8 |
+  \time 6/8
+  \dblg g'4 a'8 \gg a'4. |
+  \thrd d'4.( d'4) \eg a8 |
+  \time 9/8
+  \dble e'4 \lag e'8 \gg e'16[ d'8. e'8] \gg f'4 g'8 |
+
+  \break
+  \time 6/8
+  \gg f'4 e'8 \thrd d'4. |
+  \eg a4.( a4) d'8 |
+  \dblg g'4 a'8 \gg a'4. |
+  \thrd d'4.( d'4) f'8 |
+
+  \break
+  \dblg g'4 e'8( e'8) \dblf f'8.[ e'16] |
+  \thrd d'4.( d'4) \cg d'8 |
+  \gg c'4 e'8 \thrd d'4.( |
+  d'4.) \gdcg d'4.
 }
-
 @end lilypond
 
 
+@node Lilypond-book templates
+@section Lilypond-book templates
+
+These templates are for use with @code{lilypond-book}.  If you're not familiar
+with this program, please refer to @ref{LilyPond-book}.
+
+@subsection LaTeX
+
+You can include LilyPond fragments in a LaTeX document.
+
+@example
+\documentclass[]@{article@}
+\begin@{document@}
+
+Normal LaTeX text.
+
+\begin@{lilypond@}
+\relative c'' @{
+a4 b c d
+@}
+\end@{lilypond@}
+
+More LaTeX text.
+
+\begin@{lilypond@}
+\relative c'' @{
+d4 c b a
+@}
+\end@{lilypond@}
+\end@{document@}
+@end example
+
+@subsection Texinfo
+
+You can include LilyPond fragments in Texinfo; in fact, this entire manual
+is written in Texinfo.
+
+@example
+\input texinfo
+@@node Top
+
+Texinfo text
+
+@@lilypond[verbatim,fragment,raggedright]
+a4 b c d
+@@end lilypond
+
+More Texinfo text
+
+@@lilypond[verbatim,fragment,raggedright]
+d4 c b a
+@@end lilypond
+
+@@bye
+@end example