]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/tutorial.itely
(system): remove errorlog files.
[lilypond.git] / Documentation / user / tutorial.itely
index 02659ce3f9f402e801601038ee50ab5aa7aae3ec..c7eb23342440bbd9ce09171b0176be43d8461522 100644 (file)
@@ -8,9 +8,6 @@
 @node Tutorial
 @chapter Tutorial
 
-@html
-<!--- @@WEB-TITLE@@=Tutorial --->
-@end html
 
 
 Using LilyPond comes down to encoding music in an input file. After
@@ -52,7 +49,6 @@ should then be able to create and print your first sheets of music.
 * Running LilyPond::            Printing music.
 * More about pitches and accidentals::  
 * Octave entry::                
-* Relative octave entry::       
 * Combining music into compound expressions::  
 * Adding articulation marks to notes::  
 * Combining notes into chords::  
@@ -61,7 +57,7 @@ should then be able to create and print your first sheets of music.
 * Listening to output::         
 * Titling::                     
 * Single staff polyphony::      
-* Piano staffs::                
+* Piano staves::                
 * Setting variables::           
 * Fine tuning layout::          
 * Organizing larger pieces::    
@@ -312,8 +308,8 @@ DVI output to `test.dvi'...
 @cindex Viewing music
 @cindex xdvi
 
-The result of the ly2dvi is the file @file{test.pdf}.@footnote{ For
-@TeX{} afficionados, there is also a (@file{test.dvi}) file. It can be
+The result of the ly2dvi is the file @file{test.pdf}.@footnote{For
+@TeX{} afficionados, there is also a @file{test.dvi} file. It can be
 viewed with @code{xdvi}. The DVI uses a lot of PostScript specials,
 which do not show up in the magnifying glass. The specials also mean
 that the DVI file cannot be processed with @code{dvilj}. Use
@@ -323,7 +319,6 @@ that the DVI file cannot be processed with @code{dvilj}. Use
 @cindex DVI driver
 }  One of the following commands should put the PDF on your
 screen:
-@c eeek
 @quotation
 @example
   gv test.pdf
@@ -333,6 +328,7 @@ screen:
   xpdf test.pdf
   gpdf test.pdf
   acroread test.pdf
+  gsview32 test.pdf
 @end example
 @end quotation
 If the music on your screen looks good, you can print it by clicking
@@ -345,28 +341,24 @@ File/Print inside your viewing program.
 @cindex PDF
 
 
-On Windows,  the terminal is started by clicking on the LilyPond or
-Cygwin icon.  Any text editor (such as NotePad, Emacs or Vim) may be
-used to edit the LilyPond file.  If you have a PDF viewer installed,
-use that for viewing the PDF
-@c where on file system for double-click people?
-If you have no viewer, then  you can download @code{GSView}  from
-@uref{http://www.cs.wisc.edu/~ghost}. With @code{GSView},
-the PDF file can viewed with
-@quotation
-@example
-@code{gsview32 test.pdf}
-@end example
-@end quotation
-Printing may be done with
-@quotation
-@example
-@code{gsview32 /s test.pdf}
-@end example
-@end quotation
+On Windows, the same procedure should work, the terminal is started by
+clicking on the LilyPond or Cygwin icon.  Any text editor (such as
+NotePad, Emacs or Vim) may be used to edit the LilyPond file.
 
-The commands for formatting and printing music are detailed in
-@ref{Invoking LilyPond}.
+To view the PDF file, try the following:
+@itemize
+@item
+If your system has a PDF viewer installed, open
+@file{C:\Cygwin\home\@var{your-name}} in the explorer and double-click
+@file{test.pdf}.
+@item
+If you prefer the keyboard, you can also try the list of commands
+shown before. If none work, go to
+@uref{http://www.cs.wisc.edu/~ghost/} to install the proper software.
+@end itemize
+
+The commands for formatting and printing music on all platforms are
+detailed in @ref{Invoking LilyPond}.
 
 @node More about pitches and accidentals
 @section More about pitches and accidentals
@@ -485,6 +477,22 @@ typing, but the advantage is that transposing is easier. It also makes
 it possible to use different conventions for when to print
 accidentals.
 
+@cindex beams, by hand 
+Beams are drawn automatically, but if you do not like where they are
+put, they can be entered by hand. Mark the first note to be beamed
+with @code{[} and the last one with @code{]}:
+@quotation
+@lilypond[fragment,relative 1, verbatim]
+a8[ ais] d[ es r d]
+@end lilypond
+@end quotation
+@separate
+
+Rests are described in full detail in @ref{Rests}. 
+
+The notation manual discusses ties in @ref{Ties}.
+
+
 @node  Octave entry
 @section Octave entry
 
@@ -631,38 +639,7 @@ Here is an example of the difference between relative mode and
 
 
 
-@node  Relative octave entry
-@section Relative octave entry
-
-@c lousy example
-@c ? --hwn
-@c fragment of 1st hrn in Adams' The Chairman Dances, with creative
-@c chromatic thing pasted in front.  (admittedly the original does not
-@c have a phrasing slur. The problem is that we do not want the slur
-@c and the Phrasing slur to collide. We are trying to make a good
-@c impression here.
 
-@quotation
-@lilypond[fragment,relative 1, verbatim]
-a8-(-\( ais b  c-) cis2 b'2 a4 cis,  c-\)
-@end lilypond
-@end quotation
-@separate
-
-@cindex beams, by hand 
-Beams are drawn automatically, but if you do not like where they are
-put, they can be entered by hand. Mark the first note to be beamed
-with @code{[} and the last one with @code{]}:
-@quotation
-@lilypond[fragment,relative 1, verbatim]
-a8-[ ais-] d-[ es r d-]
-@end lilypond
-@end quotation
-@separate
-
-Rests are described in full detail in @ref{Rests}. 
-
-The notation manual discusses ties in @ref{Ties}.
 
 
 
@@ -678,8 +655,8 @@ staff is marked by adding @code{\context Staff} before it.  These
 @quotation
 @lilypond[fragment,verbatim]
 \simultaneous {
-  \context Staff = staffA { \clef violin c'' }
-  \context Staff = staffB { \clef bass c }
+  \new Staff { \clef violin c'' }
+  \new Staff { \clef bass c }
 }
 @end lilypond
 @end quotation
@@ -719,14 +696,14 @@ We can now typeset a melody with two staves:
 @lilypond[verbatim,singleline]
 \score {
   \notes 
-  < \context Staff = staffA {
+  < \new Staff {
       \time 3/4
       \clef violin
       \relative c'' {
-        e2-( d4 c2 b4 a8-[ a-]
-        b-[ b-] g-[ g-] a2.-) }  
+        e2( d4 c2 b4 a8[ a]
+        b[ b] g[ g] a2.) }  
     }
-    \context Staff = staffB {
+    \new Staff {
        \clef bass
        c2 e4  g2.
        f4 e d c2.
@@ -824,7 +801,7 @@ Similarly, fingering indications can be added to a note using a dash
 Dynamic signs are made by adding the markings to the note:
 @quotation
 @lilypond[verbatim,relative 1]
-c-\ff c-\mf
+c\ff c\mf
 @end lilypond
 @end quotation
 @separate
@@ -838,7 +815,7 @@ Crescendi and decrescendi are started with the commands @code{\<} and
 is attached to:
 @quotation
 @lilypond[verbatim,relative 1]
-c2-\<  c2-\!-\ff  c2-\>  c2-\!
+c2\<  c2\!\ff  c2\>  c2\!
 @end lilypond
 @end quotation
 @separate
@@ -853,7 +830,7 @@ A slur is drawn across many notes, and indicates bound articulation
 
 @quotation
 @lilypond[fragment,relative 1, verbatim]
-d4-( c16-)-( cis d e c cis d e-)-( d4-)
+d4( c16)( cis d e c cis d e)( d4)
 @end lilypond
 @end quotation
 @separate
@@ -863,7 +840,7 @@ sound longer, and can only be used on pairs of notes with the same
 pitch. Slurs indicate the articulations of notes, and can be used on
 larger groups of notes. Slurs and ties are also nested in practice:
 @lilypond[fragment, relative=1]
-c2-~-( c8 fis fis4 ~ fis2 g2-)
+c2-~( c8 fis fis4 ~ fis2 g2)
 @end lilypond
 
 @cindex phrasing slurs
@@ -871,6 +848,13 @@ If you need two slurs at the same time (one for articulation, one for
 phrasing), you can also make a phrasing slur with @code{\(} and
 @code{\)}.
 
+@quotation
+@lilypond[fragment,relative 1, verbatim]
+a8(\( ais b  c) cis2 b'2 a4 cis,  c\)
+@end lilypond
+@end quotation
+
+
 More information on fingering, articulation, slurs, phrasing slurs,
 and dynamics can be found in @ref{Fingering instructions},
 @ref{Articulations}, @ref{Slurs}, @ref{Phrasing slurs}, and @ref{Dynamics},
@@ -894,17 +878,17 @@ You can combine beams and ties with chords.  Beam and tie markings
 must be placed outside the chord markers:
 @quotation
 @lilypond[relative 0, fragment,verbatim]
-r4 <<c e g>>8-[ <<c f a>>-]-~ <<c f a>>
+r4 <<c e g>>8[ <<c f a>>]-~ <<c f a>>
 @end lilypond
 @end quotation
 
 @quotation
 @example
-r4 <<c e g>>8-\>-( <<c e g>> <<c e g>>  <<c f a>>8-\!-)
+r4 <<c e g>>8\>( <<c e g>> <<c e g>>  <<c f a>>8\!)
 @end example
 @lilypond[relative 0, fragment]
 \slurUp
-r4 <<c e g>>8-\>-( <<c e g>> <<c e g>>  <<c f a>>8-\!-)
+r4 <<c e g>>8\>( <<c e g>> <<c e g>>  <<c f a>>8\!)
 @end lilypond
 @end quotation
 @separate
@@ -948,8 +932,8 @@ of music is multiplied by the fraction.  Triplets make notes occupy
 Grace notes are also made by prefixing a note, or a set of notes with
 a keyword. In this case, the keyword is @code{\grace}:
 @lilypond[relative 1, verbatim,fragment]
-  c4 \grace b16-( c4-)
-  \grace { d16-( e } d4-)
+  c4 \grace b16( c4)
+  \grace { d16( e } d4)
 @end lilypond
 
 @noindent
@@ -1011,7 +995,7 @@ The melody for this song is as follows:
 @lilypond[fragment,relative=1]
    \partial 8
      c8
-   \times 2/3 {  f4 g g } \times 2/3 { g4-( a2-) }
+   \times 2/3 {  f4 g g } \times 2/3 { g4( a2) }
 @end lilypond
 
 The lyrics can be set to these notes, combining both with the
@@ -1030,7 +1014,7 @@ The final result is
    \relative c' {
      \partial 8
      c8
-     \times 2/3 { f g g } \times 2/3 { g4-( a2-) }
+     \times 2/3 { f g g } \times 2/3 { g4( a2) }
    }
    \context Lyrics  \lyrics { I want to break free }
  }
@@ -1054,7 +1038,7 @@ line}. It is entered as two underscores, i.e.
    \relative c' {
    \partial 8
      c8
-     \times 2/3 { f g g } \times 2/3 { g4-( a2-) }
+     \times 2/3 { f g g } \times 2/3 { g4( a2) }
 
      %% ugh, this is to deal with bugs in the extender implementation
      \hideNotes
@@ -1148,7 +1132,7 @@ a lead sheet, for example,
     \notes \relative c' {
      \partial 8
      c8
-     \times 2/3 { f g g } \times 2/3 { g4-( a2-) } }
+     \times 2/3 { f g g } \times 2/3 { g4( a2) } }
    \context Lyrics  \lyrics { I want to break free __ }
   >
  \paper{ raggedright = ##t }
@@ -1174,7 +1158,7 @@ accidentals that were mistyped, stand out very much when listening to
 the musical transcription.
 
 @code{\midi} can be used in similarly to @code{\paper @{ @}}, for
-example
+example,
 @example 
 \score @{
     @var{..music..}
@@ -1215,8 +1199,8 @@ example,
 
 When the file is processed by @code{ly2dvi}, the title and composer
 specified are printed above the music. The `tagline' is a short line
-printed at bottom of the last page, which normally says ``Lily was
-here, version @dots{}''. In the example above, it is replaced by the
+printed at bottom of the last page, which normally says ``Engraved
+by LilyPond, version @dots{}''. In the example above, it is replaced by the
 line ``small is beautiful''.
 
 Normally, the @code{\header} is put at the top of the file. However,
@@ -1289,11 +1273,11 @@ Again, these expressions can be nested arbitrarily:
 
 @lilypond[fragment]
 <
- \context Staff = staffA 
+ \new Staff 
   \relative c''
     < { a4 g2 f4-~ f4 } \\
       { s4 g4 f2 f4 } >
- \context Staff = staffB 
+ \new Staff 
   <  { \clef bass <<c g>>1  } \\
      { f4 d e2 }
   >
@@ -1304,19 +1288,19 @@ Again, these expressions can be nested arbitrarily:
 More features of polyphonic typesetting are in the notation manual
 in @ref{Polyphony}.
 
-@node Piano staffs
-@section Piano staffs
+@node Piano staves
+@section Piano staves
 
 @cindex staff switch, manual
 @cindex cross staff voice, manual
 @cindex @code{\translator}
 
-Piano music is always typeset in two staffs connected by a brace.
+Piano music is always typeset in two staves connected by a brace.
 Printing such a staff is done similar to the polyphonic example in
 @ref{Combining music into compound expressions}:
 @example
- < \context Staff = up @{ @dots{} @}
-   \context Staff = down @{ @dots{} @}
+ < \new Staff @{ @dots{} @}
+   \new Staff @{ @dots{} @}
  >
 @end example
 but now this entire expression must be interpreted as a
@@ -1329,9 +1313,9 @@ Here is a full-fledged example:
 
 @lilypond[relative 0,fragment]
 \context PianoStaff
- < \context Staff = up { \time 2/4
+ < \new Staff { \time 2/4
      c4 c g' g  }
-   \context Staff = down {
+   \new Staff {
      \clef bass c,, c' e c }
  >
 @end lilypond
@@ -1465,8 +1449,8 @@ object. However, many layout objects share properties, which can be
 used to apply generic tweaks.  We mention a couple of these:
 
 @itemize @bullet
-@cindex @code{extra-offset}
 @item The @code{extra-offset} property, which
+@cindex @code{extra-offset}
 has a pair of numbers as value, moves around objects in the printout.
 The first number controls left-right movement; a positive number will
 move the object to the right.  The second number controls up-down
@@ -1507,21 +1491,22 @@ in that voice, the tie appears to cross voices:
       \once \property Voice.Stem \set #'transparent = ##t
       b8~ b8
   } \\ {
-       b-[ g8-]
+       b[ g8]
   } >
 @end lilypond
 
 @item
 The @code{padding} property for objects with
+@cindex @code{padding}
 @code{side-position-interface} can be set to increase distance between
 symbols that are printed above or below notes. We only give an
 example; a more elaborate explanation is in @ref{Constructing a
 tweak}:
 
 @lilypond[relative 1]
-  c2-\fermata
+  c2\fermata
   \property Voice.Script \set #'padding = #3
-  b2-\fermata
+  b2\fermata
 @end lilypond
 
 @end itemize
@@ -1617,15 +1602,15 @@ Then, an individual part is made by putting the following in a file:
 @end example
 The @code{\include} command substitutes the contents of the file at
 this position in the file, so that @code{hornNotes} is defined
-afterwards.  Since the horn is tuned in F, the @code{\transpose}
-command is used. The code @code{\transpose c' f} indicates that the
+afterwards.  The code @code{\transpose f c'} indicates that the
 argument, being @code{\hornNotes}, should be transposed by a fifth
-downwards: the @code{c'} becomes a @code{f}. The transposition can be
-seen in the following output:
+downwards: sounding @code{f} is denoted by notated @code{c'}, which
+corresponds with tuning of a normal French Horn in F. The
+transposition can be seen in the following output:
 
 @lilypond[singleline]
 \score {
-  \notes \transpose c' f  \notes \relative c' {
+  \notes \transpose f c' \notes \relative c {
   \time 2/4
   r4 f8 a cis4 f e d
 }
@@ -1652,7 +1637,7 @@ Prepending the rest and the property setting above, leads to the
 following result:
 
 @lilypond[singleline]
-\score {\notes { \transpose c' f \relative c' { \time 2/4
+\score {\notes { \transpose f c' \relative c { \time 2/4
 \property Score.skipBars = ##t 
         R2*3
     r4 f8 a cis4 f e d } }}
@@ -1667,8 +1652,8 @@ file @file{bassoon-music.ly}:
 
 \score @{
   \simultaneous @{
-    \context Staff = hornStaff \hornNotes
-    \context Staff = bsnStaff \bassoonNotes
+    \new Staff \hornNotes
+    \new Staff \bassoonNotes
   @} @}
 @end example
 
@@ -1677,10 +1662,10 @@ This would lead to the simple score depicted below:
 @lilypond[singleline]
 \score {
   \notes \relative c \simultaneous {
-    \context Staff = hornStaff { \time 2/4
+    \new Staff { \time 2/4
         R2*3
     r4 f8 a cis4 f e d }
-    \context Staff = fagStaff { \clef bass
+    \new Staff { \clef bass
       r4 d,8 f | gis4 c |  b bes |
       a8 e f4 |  g d | gis f }
   } }