]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/tutorial.itely
More simplification, fixes.
[lilypond.git] / Documentation / user / tutorial.itely
index e152f21a9478b7cce16a50ad3decc6cc255a5829..0171abcb5f21ac7dce1aa8ba3538a47a33bb5ccf 100644 (file)
@@ -58,7 +58,7 @@ Try it on this image
 By cutting and pasting everything in the @qq{ly snippet} section, you have a
 starting template for experiments.  If you like learning in this way,
 you will probably want to print out or bookmark the
-@ref{Cheat sheet}, which is a table listing of the most common
+@ruser{Cheat sheet}, which is a table listing of the most common
 commands for quick reference.
 @end ifhtml
 
@@ -114,8 +114,8 @@ line to avoid ambiguities.  These may be omitted in some examples in this
 manual, but don't forget them in your own music!
 
 @cindex Case sensitive
-In addition, LilyPond input is @strong{case sensitive}.  @code{ @{ c d e @} }
-is valid input; @code{ @{ C D E @} } will produce an error message.
+In addition, LilyPond input is @strong{case sensitive}.  @code{ @{c d e @}}
+is valid input; @code{@{ C D E @}} will produce an error message.
 
 @sp 1
 
@@ -126,7 +126,7 @@ and how to view or print the output.
 
 @subsubheading MacOS X
 
-If you double click LilyPond.app, it will open with an example
+If you double click @code{LilyPond.app}, it will open with an example
 file.  Save it, for example, to @file{test.ly} on your Desktop, and
 then process it with the menu command @samp{Compile > Typeset File}.
 The resulting PDF file will be displayed on your screen.
@@ -134,40 +134,32 @@ The resulting PDF file will be displayed on your screen.
 Be warned that the first time you ever run LilyPond, it will take a minute
 or two because all of the system fonts have to be analyzed first.
 
-For future use of LilyPond, you should begin by selecting @q{New}
-or "@q{Open}.  You must save your file before typesetting it.  If any errors
-occur in processing, please see the log window.
+For future use of LilyPond, you should begin by
+selecting @q{New} or @q{Open}.  You must save your file before
+typesetting it.  If any errors occur in processing, please see the log
+window.
 
 @subsubheading Windows
 
-On Windows, start up a text-editor@footnote{Any simple or
-programmer-oriented editor with UTF-8 support will do, for example
-Notepad.  Do not use a word processor, since these insert formatting
-codes that will confuse LilyPond.} and enter
-
-@verbatim
-{
-  c' e' g' e'
-}
-@end verbatim
-
-Save it on the desktop as @file{test.ly} and make sure that it is not
-called @file{test.ly.TXT}.  Double clicking @file{test.ly} will process
-the file and show the resulting PDF file.  To edit an existing
-@file{.ly} file, right-click on it and select @qq{Edit source}.
-
-If you double-click in the LilyPond icon on the Desktop, it will open
-a simple text editor with an example file.  Save it, for example, to
-@file{test.ly} on your Desktop, and then double-click on the file to
-process it.  After some seconds, you will get a file @file{test.pdf}
+On Windows, if you double-click in the LilyPond icon on the Desktop, it
+will open a simple text editor with an example file. Save it, for
+example, to @file{test.ly} on your Desktop and then double-click on the
+file to process it (the file icon looks like a note).  After some
+seconds, you will get a file @file{test.pdf} 
 on your desktop.  Double-click on this PDF file to view the typeset
 score.  An alternative method to process the @file{test.ly} file
 is to drag and drop it onto the LilyPond icon using your mouse pointer.
 
+To edit an existing @file{.ly} file, right-click on it and select
+@qq{Edit source}. To get an empty file to start from, run the editor
+as described above and use @qq{New} in the @qq{File} menu.
+
 Double-clicking the file does not only result in a PDF file, but also
 produces a @file{.log} file that contains some information on what LilyPond
 has done to the file.  If any errors occur, please examine this file.
 
+Note that there are several other text editors available, with better
+support for LilyPond, see @rprogram{Text editor support}, for more information.
 
 @subsubheading Unix
 
@@ -177,7 +169,7 @@ example, you could open an xterm and execute
 is a @code{LilyPond-mode} for Emacs addicts.  If they have not been
 installed already, refer to the file @file{INSTALL.txt}.  The
 easiest editing environment is @file{LilyPondTool}.  See
-@ref{Editor support} for more information.}.  In your
+@rprogram{Text editor support}, for more information.}.  In your
 text editor, enter the following input and save the file as
 @file{test.ly}
 
@@ -305,7 +297,7 @@ automatically.
 If you do not specify a duration, the previous duration is used
 for the next note.  The duration of the first note defaults to a quarter.
 
-To create @rglos{dotted notes}, add a dot @samp{.} to the duration number.
+To create @rglos{dotted note}s, add a dot @samp{.} to the duration number.
 
 @lilypond[quote,ragged-right,verbatim]
 \relative c'' {
@@ -374,17 +366,17 @@ Here is a small example showing all these elements together:
 }
 @end lilypond
 
-@moreinfo
+@seealso
 @quotation
 @table @asis
 @item Entering pitches and durations
-see @ref{Pitches} and @ref{Durations}.
+see @ruser{Pitches}, and @ruser{Durations}.
 @item Rests
-see @ref{Rests}.
+see @ruser{Rests}.
 @item Time signatures and other timing commands
-see @ref{Time signature}.
+see @ruser{Time signature}.
 @item Clefs
-see @ref{Clef}.
+see @ruser{Clef}.
 @end table
 @end quotation
 
@@ -392,10 +384,10 @@ see @ref{Clef}.
 @node Working on text files
 @subsection Working on text files
 
-LilyPond input files are treated like files in most programming languages:
-they are case sensitive, white-space insensitive, expressions are
+LilyPond input files are similar to source files in many common programming languages.
+They are case sensitive, and white-space is generally equivalent.  Expressions are
 formed with curly braces @{ @}, and comments are denoted with @code{%} or
-@code{%@{ .. %@}}.
+@code{%@{ ... %@}}.
 
 If the previous sentence sounds like nonsense, don't worry!  We'll explain
 what all these terms mean:
@@ -406,13 +398,13 @@ what all these terms mean:
 @item @strong{Case sensitive}:
 it matters whether you enter a letter
 in lower case (i.e. @code{a, b, s, t}) or upper case (i.e.
-@code{A, B, S, T}).  Notes are lower case: @code{ @{ c d e @} }
-is valid input; @code{ @{ C D E @} } will produce an error message.
+@code{A, B, S, T}).  Notes are lower case: @code{@{ c d e @}}
+is valid input; @code{@{ C D E @}} will produce an error message.
 
 @item @strong{Whitespace insensitive}:
 it does not matter how many
-spaces (or new lines) you add.  @code{ @{ c d e @}} means the same thing
-as @code{ @{ c @ @ @ @ @  d e @} } and
+spaces (or new lines) you add.  @code{@{ c d e @}} means the same thing
+as @code{@{ c @tie{} @tie{} @tie{} d e @}} and
 @example
           @{
 c                        d
@@ -436,7 +428,7 @@ parenthesis @samp{()} in mathematics.  The braces should
 be surrounded by a space unless they are at the beginning or end of a
 line to avoid ambiguities.
 
-A function (such as @code{\relative @{ @}} ) also counts as a single
+A function (such as @code{\relative @{ @}}) also counts as a single
 music expression.
 
 @cindex comments
@@ -449,7 +441,7 @@ There are two types of comments.  The percent symbol @samp{%}
 introduces a line comment; anything after @samp{%} on that line is
 ignored.  A block comment marks a whole section of music
 input as a comment.  Anything that is enclosed in @code{%@{} and @code{%@}} is
-ignored.  The following fragment shows possible uses for comments
+ignored.  (Comments do not nest.)  The following fragment shows possible uses for comments
 
 @example
 % notes for twinkle twinkle follow
@@ -467,13 +459,13 @@ ignored.  The following fragment shows possible uses for comments
 @end itemize
 
 There are more tips for constructing input files in
-@ref{Suggestions for writing LilyPond files}.
+@ruser{Suggestions for writing LilyPond files}.
 
 
 @node How to read the tutorial
 @subsection How to read the tutorial
 
-As we saw in @ref{Working on text files}, LilyPond input must be
+As we saw in @ruser{Working on text files}, LilyPond input must be
 surrounded by @{ @} marks or a @code{\relative c'' @{ ... @}}.  For the
 rest of this manual, most examples will omit this.
 
@@ -517,9 +509,9 @@ on one staff.
 @node Relative note names
 @subsection Relative note names
 
-As we saw in @ref{Simple notation}, LilyPond calculates the pitch of
+As we saw in @ruser{Simple notation}, LilyPond calculates the pitch of
 each note relative to the previous one@footnote{There is another mode of
-entering pitches, @ref{Absolute note names}, but in practice relative
+entering pitches, @ruser{Absolute note names}, but in practice relative
 mode is much easier and safer to use.}.  If no extra octave marks
 (@code{'} and @code{,}) are added, it assumes that each pitch is within
 a fourth of the previous note.
@@ -534,13 +526,13 @@ c2 fis
 c2 ges
 @end lilypond
 
-@moreinfo
+@seealso
 @quotation
 @table @asis
 @item Relative octaves
-see @ref{Relative octaves}.
+see @ruser{Relative octaves}.
 @item Octave check
-see @ref{Octave check}.
+see @ruser{Octave check}.
 @end table
 @end quotation
 
@@ -557,7 +549,7 @@ you might expect, a @rglos{double sharp} or @rglos{double flat} is
 made by adding @samp{isis} or @samp{eses}@footnote{This syntax
 derived from note naming conventions in Nordic and Germanic languages,
 like German and Dutch.  To use other names for accidentals, see
-@ref{Note names in other languages}.}
+@ruser{Note names in other languages}.}
 
 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
 cis1 ees fisis, aeses
@@ -581,7 +573,7 @@ a
 @subheading Warning: key signatures and pitches
 
 To determine whether to print an accidental, LilyPond examines the
-pitches and the key signature.  The key signature only effects
+pitches and the key signature.  The key signature only affects
 the @emph{printed} accidentals, not the actual pitches!  This is a
 feature that often causes confusion to newcomers, so let us explain it
 in more detail.
@@ -619,16 +611,16 @@ e
 Adding all alterations explicitly might require a little more effort
 when typing, but the advantage is that transposing is easier, and
 accidentals can be printed according to different conventions.  See
-@ref{Automatic accidentals} for some examples how accidentals can be printed
+@ruser{Automatic accidentals}, for some examples how accidentals can be printed
 according to different rules.
 
-@moreinfo
+@seealso
 @quotation
 @table @asis
 @item Accidentals
-see @ref{Accidentals} and @ref{Automatic accidentals}.
+see @ruser{Accidentals}, and @ruser{Automatic accidentals}.
 @item Key signature
-see @ref{Key signature}.
+see @ruser{Key signature}.
 @end table
 @end quotation
 
@@ -660,7 +652,6 @@ d4( c16) cis( d e c cis d) e( d4)
 @cindex phrasing slurs
 @subheading Phrasing slurs
 
-@cindex phrasing slurs
 Slurs to indicate longer phrasing can be entered with @code{\(} and
 @code{\)}.  You can have both legato slurs and phrasing slurs at the
 same time, but you cannot have simultaneous slurs or simultaneous
@@ -685,15 +676,15 @@ can be nested.
 c2~( c8 fis fis4 ~ fis2 g2)
 @end lilypond
 
-@moreinfo
+@seealso
 @quotation
 @table @asis
 @item Ties
-see @ref{Ties}.
+see @ruser{Ties}.
 @item Slurs
-see @ref{Slurs}.
+see @ruser{Slurs}.
 @item Phrasing slurs
-see @ref{Phrasing slurs}.
+see @ruser{Phrasing slurs}.
 @end table
 @end quotation
 
@@ -706,7 +697,7 @@ see @ref{Phrasing slurs}.
 @cindex staccato
 @subheading Articulations
 
-Common @rglos{articulations} can be added to a note using a dash @samp{-}
+Common @rglos{articulation}s can be added to a note using a dash @samp{-}
 and a single character:
 
 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
@@ -751,15 +742,15 @@ Crescendi and decrescendi are started with the commands @code{\<} and
 c2\< c2\ff\> c2 c2\!
 @end lilypond
 
-@moreinfo
+@seealso
 @quotation
 @table @asis
 @item Articulations
-see @ref{Articulations}.
+see @ruser{Articulations}.
 @item Fingering
-see @ref{Fingering instructions}.
+see @ruser{Fingering instructions}.
 @item Dynamics
-see @ref{Dynamics}.
+see @ruser{Dynamics}.
 @end table
 @end quotation
 
@@ -783,13 +774,13 @@ with @samp{]}.
 a8[ ais] d[ ees r d] a b
 @end lilypond
 
-@moreinfo
+@seealso
 @quotation
 @table @asis
 @item Automatic beams
-see @ref{Automatic beams}.
+see @ruser{Automatic beams}.
 @item Manual beams
-see @ref{Manual beams}.
+see @ruser{Manual beams}.
 @end table
 @end quotation
 
@@ -842,15 +833,15 @@ c2 \appoggiatura b16 c2
 c2 \acciaccatura b16 c2
 @end lilypond
 
-@moreinfo
+@seealso
 @quotation
 @table @asis
 @item Grace notes
-see @ref{Grace notes},
+see @ruser{Grace notes},
 @item Tuplets
-see @ref{Tuplets},
+see @ruser{Tuplets},
 @item Pickups
-see @ref{Partial measures}.
+see @ruser{Partial measures}.
 @end table
 @end quotation
 
@@ -870,8 +861,8 @@ one voice on the same staff.
 * Music expressions explained::  
 * Multiple staves::             
 * Piano staves::                
-* Single staff polyphony::      
 * Combining notes into chords::  
+* Single staff polyphony::      
 @end menu
 
 
@@ -973,7 +964,7 @@ for complex music like polyphonic scores.
 @node Multiple staves
 @subsection Multiple staves
 
-As we saw in @ref{Music expressions explained}, LilyPond input files
+As we saw in @ruser{Music expressions explained}, LilyPond input files
 are constructed out of music expressions.  If the score begins with
 simultaneous music expressions, LilyPond creates multiples staves.  However,
 it is easier to see what happens if we create each staff explicitly.
@@ -1007,10 +998,11 @@ creates a bigger music expression.  In this way it resembles the minus
 sign in mathematics.  The formula @math{(4+5)} is an expression, so
 @math{-(4+5)} is a bigger expression.
 
-Time signatures entered in one staff affects all other staves, but
-the key signature of one staff does @emph{not} affect other
+Time signatures entered in one staff affects all other 
 staves@footnote{This behavior may be changed if desired; see
-@ref{Changing defaults} for details.}.
+@ruser{Polymetric notation}, for details.}. On the other hand, 
+the key signature of one staff does @emph{not} affect other
+staves.
 
 @lilypond[quote,ragged-right,verbatim]
 \relative c'' {
@@ -1030,7 +1022,7 @@ staves@footnote{This behavior may be changed if desired; see
 @cindex staff switch, manual
 @cindex cross staff voice, manual
 Piano music is typeset in two staves connected by a brace.  Printing
-such a staff is similar to the polyphonic example in @ref{Multiple staves},
+such a staff is similar to the polyphonic example in @ruser{Multiple staves},
 but now this entire expression is inserted inside a @code{PianoStaff}:
 
 @example
@@ -1051,12 +1043,35 @@ Here is a small example
 }
 @end lilypond
 
-@moreinfo
+@seealso
 @quotation
-See @ref{Piano music}.
+See @ruser{Piano music}.
 @end quotation
 
 
+@node Combining notes into chords
+@subsection Combining notes into chords
+
+@cindex chords
+Chords can be made by surrounding pitches with single angle brackets.  Angle
+brackets are the symbols @samp{<} and @samp{>}.
+
+@lilypond[quote,fragment,verbatim,relative=2,fragment]
+r4 <c e g>4 <c f a>2
+@end lilypond
+
+You can combine markings like beams and ties with chords.  They must
+be placed outside the angle brackets
+
+@lilypond[quote,fragment,verbatim,relative=2,fragment]
+r4 <c e g>8[ <c f a>]~ <c f a>2
+@end lilypond
+
+@lilypond[quote,fragment,verbatim,relative=2,fragment]
+r4 <c e g>8\>( <c e g> <c e g>4 <c f a>\!)
+@end lilypond
+
+
 @node Single staff polyphony
 @subsection Single staff polyphony
 
@@ -1108,35 +1123,12 @@ Again, these expressions can be nested arbitrarily.
 >>
 @end lilypond
 
-@moreinfo
+@seealso
 @quotation
-See @ref{Basic polyphony}.
+See @ruser{Basic polyphony}.
 @end quotation
 
 
-@node Combining notes into chords
-@subsection Combining notes into chords
-
-@cindex chords
-Chords can be made by surrounding pitches with single angle brackets.  Angle
-brackets are the symbols @samp{<} and @samp{>}.
-
-@lilypond[quote,fragment,verbatim,relative=2,fragment]
-r4 <c e g>4 <c f a>2
-@end lilypond
-
-You can combine markings like beams and ties with chords.  They must
-be placed outside the angle brackets
-
-@lilypond[quote,fragment,verbatim,relative=2,fragment]
-r4 <c e g>8[ <c f a>]~ <c f a>2
-@end lilypond
-
-@lilypond[quote,fragment,verbatim,relative=2,fragment]
-r4 <c e g>8\>( <c e g> <c e g>4 <c f a>\!)
-@end lilypond
-
-
 @node Songs
 @section Songs
 
@@ -1206,10 +1198,10 @@ resulting in a centered hyphen between two syllables
 >>
 @end lilypond
 
-@moreinfo
+@seealso
 @quotation
 More options, such as putting multiple stanzas below a melody, are
-discussed in @ref{Vocal music}.
+discussed in @ruser{Vocal music}.
 @end quotation
 
 
@@ -1262,10 +1254,10 @@ a lead sheet,
 @end lilypond
 
 
-@moreinfo
+@seealso
 @quotation
 A complete list of modifiers and other options for layout can be found
-in @ref{Chords}.
+in @ruser{Chords}.
 @end quotation
 
 
@@ -1290,20 +1282,20 @@ of the manual.
 @subsection Version number
 
 @cindex versioning
-The @code{\version} statement marks for which version of LilyPond the file
-was written.  To mark a file for version 2.10.1, place
+The @code{\version} statement records the version of LilyPond that was
+used to write the file:
 
 @example
-\version "2.11.15"
+\version "2.11.23"
 @end example
 
 @noindent
-at the top of your LilyPond file.
+by convention, this is placed at the top of your LilyPond file.
 
-These annotations make future upgrades of LilyPond go more
-smoothly.  Changes in the syntax are handled with a special program,
-@file{convert-ly} (see @ref{Updating files with convert-ly}), and it uses
-@code{\version} to determine what rules to apply.
+These annotations make future upgrades of LilyPond go more smoothly.
+Changes in the syntax are handled with a special program,
+@file{convert-ly} (see @rprogram{Updating files with convert-ly}), and
+it uses @code{\version} to determine what rules to apply.
 
 
 @node Adding titles
@@ -1312,10 +1304,10 @@ smoothly.  Changes in the syntax are handled with a special program,
 The title, composer, opus number, and similar information are entered
 in the @code{\header} block.  This exists outside of the main
 music expression; the @code{\header} block is usually placed underneath
-the @ref{Version number}.
+the @ruser{Version number}.
 
 @example
-\version "2.11.15"
+\version "2.11.23"
 \header @{
   title = "Symphony"
   composer = "Me"
@@ -1328,7 +1320,7 @@ the @ref{Version number}.
 @end example
 
 When the file is processed, the title and composer are printed above
-the music.  More information on titling can be found in @ref{Creating
+the music.  More information on titling can be found in @ruser{Creating
 titles}.
 
 
@@ -1468,16 +1460,16 @@ places.  The following example uses the above variables:
 @subsection After the tutorial
 
 After finishing the tutorial, you should probably try writing a
-piece or two.  Start with one of the @ref{Templates} and
+piece or two.  Start with one of the @ruser{Templates}, and
 add notes.  If you need any notation that was not covered in the
 tutorial, look at the Notation Reference, starting with
-@ref{Basic notation}.  If you want to write for an instrument
-ensemble which is not covered in the templates,
-take a look at @ref{Extending the templates}.
+@ruser{Basic notation}.  If you want to write for an instrument
+ensemble that is not covered in the templates,
+take a look at @ruser{Extending the templates}.
 
 Once you have written a few short pieces, read the rest of
 the Learning Manual (chapters 3-5).  There's nothing wrong
-with reading them now, of course!  However, the rest of the
+with reading it now, of course!  However, the rest of the
 Learning Manual assumes that you are familiar with
 LilyPond input.  You may wish to skim these chapters right
 now, and come back to them after you have more experience.
@@ -1486,21 +1478,24 @@ now, and come back to them after you have more experience.
 @node How to read the manual
 @subsection How to read the manual
 
-As we saw in @ref{How to read the tutorial}, many examples in the
+As we saw in @ruser{How to read the tutorial}, many examples in the
 tutorial omitted a @code{\relative c'' @{ ... @}} around the printed
 example.
 
 In the rest of the manual, we are much more lax about the
 printed examples: sometimes they may have omitted a
-@code{\relative c'' @{ ... @}}, but in other times a different initial
+@code{\relative c'' @{ ... @}}, but other times a different initial
 pitch may be used (such as @code{c'} or @code{c,,}), and in some cases
 the whole example is in absolute note mode!  However, ambiguities like
 this only exist where the pitches are not important.  In any example
-where the pitch matters, we have explicitly stated our @code{\relative}
-our our absolute-mode @code{@{ @}}.
+where the pitch matters, we have explicitly stated @code{\relative}
+or absolute-mode @code{@{ @}}.
 
 If you are still confused about the exact LilyPond input that was
 used in an example, read the HTML version (if you are not already doing
 so) and click on the picture of the music.  This will display the exact
 input that LilyPond used to generate this manual.
 
+For information about the structure of the rest of the manual, see
+@ruser{About this manual}.
+