]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/tutorial.itely
''
[lilypond.git] / Documentation / user / tutorial.itely
index bbc3d201337b4cfc49b111567a892e920ba616a3..79cc1c79be02cbb04750648d00efaca5da4af527 100644 (file)
@@ -2,10 +2,13 @@
 
 @c TODO: LilyPond LilyPond LilyPond
 
-
 @node Tutorial
 @chapter Tutorial
-  
+
+@html
+<!--- @@WEB-TITLE@@=Tutorial --->
+@end html
+
 @menu
 * First steps::                 Music language of LilyPond
 * Simple legend::               Small table of music language symbols
@@ -75,7 +78,7 @@ c d e f g a b
 @separate
 
 The length of a note is specified by adding a number, ``@code{1}'' for a
-whole note, ``@code{2}'' for a halve note, and so on:
+whole note, ``@code{2}'' for a half note, and so on:
 
 @quotation
 @example
@@ -87,7 +90,7 @@ a1 a2 a4 a16 a32
 @lilypond[fragment]
 \property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.noAutoBeaming = ##t
+\property Staff.autoBeaming = ##f
 %\property Staff.Clef = \turnOff
 \transpose c'' { a1 a2 a4 a16 a32 }
 s16_" "
@@ -255,7 +258,7 @@ We continue with the introduction of the remaining musical constructs.
 
 @c maybe legend here?
 
-Rests are entered just like notes with the name ``@code{r}'':
+Normal rests are entered just like notes with the name ``@code{r}'':
 
 @quotation
 @example
@@ -471,8 +474,9 @@ and @code{]}:
 @separate
 
 To print more than one staff, each piece of music that makes up a staff
-is marked by adding @code{\context Staff} before it.  These staffs can
-be grouped inside @code{<} and @code{>}, as is demonstrated here:
+is marked by adding @code{\context Staff} before it.  These
+@code{Staff}'s can be grouped inside @code{<} and @code{>}, as is
+demonstrated here:
 
 @quotation
 @lilypond[fragment,verbatim]
@@ -484,12 +488,12 @@ be grouped inside @code{<} and @code{>}, as is demonstrated here:
 @end quotation
 
 In this example, @code{staffA} and @code{staffB} are names that are
-given to the staffs.  For now, it doesn't matter what names you give, as
+given to the staves.  For now, it doesn't matter what names you give, as
 long as each staff has a unique name.
 
 @separate
 
-We can typeset a melody with two staffs now:
+We can typeset a melody with two staves now:
 
 @quotation
 @lilypond[verbatim]
@@ -513,7 +517,7 @@ We can typeset a melody with two staffs now:
 
 Notice that the time signature is specified in one melody staff only
 (the top staff), but is printed on both.  LilyPond knows that the time
-signature should be the same for all staffs.
+signature should be the same for all staves.
 
 @separate
 
@@ -555,7 +559,7 @@ r4 <c e g> <c f a>
 @c hmm, te losjes, iig
 In general, @code{ < @var{stuff} > } is used when @var{stuff} all
 happens at the same time, like in chords, or (like in the two-staff
-example above) in a bunch of stacked staffs.
+example above) in a bunch of stacked staves.
 @end ignore
 
 Of course, you can combine beams and ties with chords.  Notice that
@@ -649,7 +653,7 @@ fine tuning output, polyphonic music, and integrating text and music.
 @lilypond[fragment, relative 1]
 \property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.noAutoBeaming = ##t
+\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
 [a8 b]
 @end lilypond
@@ -660,7 +664,7 @@ fine tuning output, polyphonic music, and integrating text and music.
 @lilypond[fragment, relative 1]
 \property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.noAutoBeaming = ##t
+\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
 d ~ d
 @end lilypond
@@ -671,7 +675,7 @@ d ~ d
 @lilypond[fragment, relative 1]
 \property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.noAutoBeaming = ##t
+\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
 c( d )e
 @end lilypond
@@ -681,7 +685,7 @@ c( d )e
 @lilypond[fragment, relative 1]
 \property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.noAutoBeaming = ##t
+\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
 a a'
 @end lilypond
@@ -692,7 +696,7 @@ a a'
 @lilypond[fragment, relative 1]
 \property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.noAutoBeaming = ##t
+\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
 c c,
 @end lilypond
@@ -703,7 +707,7 @@ c c,
 @lilypond[fragment, relative 1]
 \property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.noAutoBeaming = ##t
+\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
 \context Voice { <a c> }
 @end lilypond
@@ -714,7 +718,7 @@ c c,
 @lilypond[fragment, relative 1]
 \property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.noAutoBeaming = ##t
+\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
 a\< a \!a
 @end lilypond
@@ -725,7 +729,7 @@ a\< a \!a
 @lilypond[fragment, relative 1]
 \property Score.timing = ##f
 \property Staff.TimeSignature = \turnOff
-\property Staff.noAutoBeaming = ##t
+\property Staff.autoBeaming = ##f
 \property Staff.Clef = \turnOff
 a\> a \!a
 @end lilypond
@@ -831,12 +835,20 @@ at @uref{http://www.ghostscript.com}.
 @cindex PostScript
 
 @unnumberedsubsec Windows users
-Windows users start the terminal by clicking on the LilyPond icon.
-Notepad is sufficient for editing the LilyPond file. Viewing the PS file
-can be done with @code{gsview32 test.ps}.  Viewing DVI files can be done
-with @code{yap test.dvi}.  The "print" button in Yap will print files.
-You can also print from the command line by executing @code{gsview32 /s
-test.ps}
+Windows users start the terminal by clicking on the LilyPond or Cygwin
+icon.  Notepad is sufficient for editing the LilyPond file.  Viewing
+the PS file can be done with:
+@quotation
+@example
+@code{gsview32 test.ps}
+@end example
+@end quotation
+You can also print from the command line by executing:
+@quotation
+@example
+@code{gsview32 /s test.ps}
+@end example
+@end quotation
 
 
 @node The first real tune
@@ -913,7 +925,9 @@ can also make longer comments by enclosing text in @code{%@{} and
 @end example
 @cindex @code{\include}
 @cindex point, printer's
-@cindex staff size setting 
+@cindex staff size, setting
+@cindex font size, setting
+
 By default, LilyPond will typeset the music in a size such that each
 staff is 20 point (0.7 cm, or 0.27 inch) high.  We want smaller output
 (16 point staff height), so we must import the settings for that size,
@@ -1005,6 +1019,10 @@ The following piece of music is played twice.  The first argument
 indicates the type of repeat.  In this case, @code{"volta"} means that
 prima volta/secunda volta brackets are used for the alternative
 endings---if there were any.
+
+A special notation for repeats allows you to get correct repeats in
+MIDI output. However, some extra trickery is needed to get this
+working, See @ref{Repeats and MIDI}.  
 @separate
 @example 
 
@@ -1036,7 +1054,7 @@ note have real pitch @code{g'}.  The @code{8} represents an eight note.
 @end example 
 Two more notes, with pitch @code{a} and @code{b}.  Because their
 duration is the same as the @code{g,8}, there is no need to enter the
-duration, but you may enter it anyway, i.e., @code{a4 b4}
+duration, but you may enter it anyway, i.e., @code{a8 b8}
 @separate
 @example 
 
@@ -1217,7 +1235,7 @@ accompaniment =\chords @{
 
           \addlyrics
             \context Staff = mel @{        
-              \property Staff.noAutoBeaming = ##t
+              \property Staff.autoBeaming = ##f
               \property Staff.automaticMelismata = ##t
               \melody 
             @}
@@ -1268,7 +1286,7 @@ accompaniment =\chords {
 
           \addlyrics
             \context Staff = mel {
-              \property Staff.noAutoBeaming = ##t
+              \property Staff.autoBeaming = ##f
               \property Staff.automaticMelismata = ##t
               \melody 
             }
@@ -1520,20 +1538,21 @@ a @code{Staff} context explicitly: should you choose to remove the
 comment before the ``note heads'' version of the accompaniment, the
 accompaniment will be on a nameless staff.  The melody has to be on
 staff different from the accompaniment.  This is accomplished by giving
-the melody and accompaniment staffs different names.
+the melody and accompaniment staves different names.
 @separate
 @example 
 
-        \property Staff.noAutoBeaming = ##t
+        \property Staff.autoBeaming = ##f
  
 @end example
 @cindex \property
 @cindex context variables
 @cindex setting context variables
 An interpretation context has variables, called properties, that tune
-its behavior.  One of the variables is @code{noAutoBeaming}.  Setting
-this Staff's property to @code{##t}, which is the boolean value @var{true},
-turns the automatic beaming mechanism off for the current staff.
+its behavior.  One of the variables is @code{autoBeaming}.  Setting
+this @code{Staff}'s property to @code{##f}, which is the boolean value
+@var{false}, turns the automatic beaming mechanism off for the current
+staff.
 @cindex GUILE
 @cindex Scheme
 @cindex accessing Scheme
@@ -1807,10 +1826,10 @@ will be at the left.
 @node A piano excerpt
 @section A piano excerpt
 
-Our fourth subject is a piece of piano music.  The fragment in the input
-file is a piano reduction of the G major Sinfonia by Giovanni Battista
-Sammartini.  It was composed around 1740.  It's in the source package
-under  the name @file{sammartini.ly}.
+Our fourth subject is a piece of piano music.  The fragment in the
+input file is a piano reduction of the G major Sinfonia by Giovanni
+Battista Sammartini.  It was composed around 1740.  It's in the source
+package under the name @file{sammartini.ly}.
 
 @lilypond[verbatim]
 \include "paper16.ly"
@@ -1835,8 +1854,10 @@ oboes = \notes \relative c'' \context Voice = oboe {
         \context Voice = oboeTwo {
             \stemDown
             \grace {
-                \property Grace.Stem \override #'direction = #-1
-                [f,16 g] }
+                \property Voice.Stem \override #'direction = #-1
+                [f,16 g] 
+                \property Voice.Stem \revert #'direction
+           }
             f8 e e2
         }
     >
@@ -1847,11 +1868,11 @@ oboes = \notes \relative c'' \context Voice = oboe {
 }
 
 hoomPah = \repeat unfold 8 \notes
-    \transpose c' { \stemUp c8 \stemBoth \stemDown c'8 \stemBoth }
+    \transpose c' { \stemUp c8 \stemBoth \stemDown g'8 \stemBoth }
 
 bassvoices = \notes \relative c' {
     c4 g8. b,16
-    \autochange Staff \hoomPah
+    \autochange Staff \context Voice \hoomPah
     \translator Staff = down
     \stemDown [c8 c'8] r4
     <g d'> r4
@@ -1991,7 +2012,6 @@ defined above.
 @cindex @code{\grace}
 @cindex ornaments
 @cindex grace notes
-
 @code{\grace} introduces grace notes.  It takes one argument, in this
 case a chord.
 
@@ -2050,7 +2070,7 @@ We can't share stems with the other voice, so we have to create a new
 it from the other context.  Stems go down in this voice.
 @separate
 @example 
-\grace @{  
+\grace
 @end example
 @cindex Grace context
 When a grace section is processed, a @code{Grace} context is
@@ -2061,8 +2081,9 @@ etc. Here we fiddle with a property and make a beam.  The argument of
 
 @separate
 @example 
-\property Grace.Stem \override #'direction = #-1
-[f,16 g] @}
+                \property Voice.Stem \override #'direction = #-1
+                [f,16 g] 
+                \property Voice.Stem \revert #'direction
 @end example 
 
 Normally, grace notes are always stem up, but in this case, the upper
@@ -2090,7 +2111,7 @@ This ends the two-part section.
 positioned as if it were single part music.
 
 The bass has a little hoom-pah melody to demonstrate parts switching
-between staffs.  Since it is repetitive, we use repeats:
+between staves.  Since it is repetitive, we use repeats:
 @separate
 @example 
 hoomPah  =  \repeat unfold 8
@@ -2118,16 +2139,16 @@ having to worry about getting the motive in a wrong octave.
 @example 
 bassvoices = \notes \relative c' @{
 c4 g8. b,16
-\autochange Staff \hoomPah 
+\autochange Staff \hoomPah \context Voice
 @end example
 @cindex staff switch, automatic
 @cindex cross staff voice, automatic
 @cindex @code{\autochange}
 
-Voices can switch between staffs. The easiest way to get this, is to use
+Voices can switch between staves. The easiest way to get this, is to use
 @code{\autochange}. This command looks at the pitch of each note, and if
 necessary, will cross to the other staff. For this to work, the two
-staffs must be called @code{"up"} and @code{"down"}.
+staves must be called @code{"up"} and @code{"down"}.
 @separate
 @example
         \translator Staff = down
@@ -2263,7 +2284,7 @@ to the end of the piece, and we can set the end bar.
 Key = \notes \key as \major
 @end example
 Declare the key signature of the piece and assign it to the identifier
-@var{Key}.  Later on, we'll use @code{\Key} for all staffs except those
+@var{Key}.  Later on, we'll use @code{\Key} for all staves except those
 for transposing instruments.
 
 @node The full score
@@ -2381,7 +2402,7 @@ When naming the tuning of the french horn, we'll need a piece of text
 with a flat sign.  LilyPond has a mechanism for font selection and
 kerning called Scheme markup text (See @ref{Text markup}).  The flat
 sign is taken from the music font, and its name is @code{accidentals--1}
-(The sharp sign is called @code{accidentals-1}).  The default font is
+(The natural sign is called @code{accidentals-0}).  The default font is
 too big for text, so we select a relative size of @code{-2}.
 
 @separate
@@ -2389,7 +2410,7 @@ too big for text, so we select a relative size of @code{-2}.
   <
     \global
 @end example
-Of course, all staffs are simultaneous and use the same global settings.
+Of course, all staves are simultaneous and use the same global settings.
 
 @separate
 @example
@@ -2417,11 +2438,11 @@ the online documentation.
     \context StaffGroup = woodwind <
       \context Staff = flauti <
 @end example
-A new notation context: the StaffGroup.  StaffGroup can hold one or more
-Staffs, and will print a big bracket at the left of the score.  Start a
-new staff group for the woodwind section (just the flutes in this case).
-Immediately after that, we start the staff for the two flutes, that also
-play simultaneously.
+A new notation context: the @code{StaffGroup}.  @code{StaffGroup} can
+hold one or more @code{Staff}'s, and will print a big bracket at the
+left of the score.  Start a new staff group for the woodwind section
+(just the flutes in this case).  Immediately after that, we start the
+staff for the two flutes, that also play simultaneously.
 
 @separate
 @example
@@ -2541,7 +2562,7 @@ want a different type of Staff context.
 In orchestral scores, it often happens that one instrument has only
 rests during one line of the score.  The @code{HaraKiriStaffContext} can
 be used as a regular @code{StaffContext} drop-in and will take care of
-the automatic removing of empty staffs.
+the automatic removing of empty staves.
 
 @node Extracting an individual part
 @subsection Extracting an individual part
@@ -2724,9 +2745,8 @@ Under Unix, you can view the results as follows.
 $ cd input/tutorial
 $ lilypond-book --outdir=out/ lilbook.tex
 lilypond-book (GNU LilyPond) 1.3.146
-Reading `/home/hanwen/usr/src/lilypond-1.3.146/input/tutorial/lilbook.tex'
-Reading
-`/home/hanwen/usr/src/lilypond-1.3.146/input/tutorial/sammartini.ly'
+Reading `input/tutorial/lilbook.tex'
+Reading `input/tutorial/sammartini.ly'
 @var{lots of stuff deleted}
 Writing `out/lilbook.latex'
 $ cd out