]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/notation.itely
* lily/ledger-line-engraver.cc: new file.
[lilypond.git] / Documentation / user / notation.itely
index e14580f87f5bcff7758aef9e8d5666068fe9d201..ebd2d1fdd39897927ce1dbab90c9ffa0077644b0 100644 (file)
@@ -107,7 +107,7 @@ Half-flats and half-sharps are formed by adding @code{-eh} and
 @cindex quarter tones
 @cindex semi-flats, semi-sharps
 
-@lilypond[quote,verbatim,relative=3]
+@lilypond[fragment,quote,verbatim,relative=3]
 ceses4
 ceseh
 ces
@@ -206,7 +206,7 @@ A chord is formed by a enclosing a set of pitches in @code{<} and
 @code{>}. A chord may be followed by  a duration, and a set of
 articulations, just like simple notes.
 
-@lilypond[quote,relative=1]
+@lilypond[fragment,quote,relative=1]
 <c e g>4 <c>8 <>8 
 @end lilypond
 
@@ -219,7 +219,7 @@ articulations, just like simple notes.
 
 Rests are entered like notes, with the note name @code{r}
 
-@lilypond[quote,raggedright,verbatim]
+@lilypond[fragment,quote,raggedright,verbatim]
 r1 r2 r4 r8
 @end lilypond
 
@@ -233,7 +233,9 @@ note with the @code{\rest} keyword appended. This makes manual
 formatting in polyphonic music easier.  Rest collision testing will
 leave these rests alone
 
-@lilypond[quote,raggedright,verbatim]
+@cindex @code{\rest}
+@lilypond[fragment,quote,raggedright,verbatim]
 a'4\rest d'4\rest
 @end lilypond
 
@@ -252,7 +254,7 @@ Program reference: @internalsref{RestEvent}, and @internalsref{Rest}.
 An invisible rest (also called a `skip') can be entered like a note
 with note name `@code{s}' or with @code{\skip @var{duration}}
 
-@lilypond[quote,raggedright,verbatim]
+@lilypond[fragment,quote,raggedright,verbatim]
 a2 s4 a4 \skip 1 a4 
 @end lilypond
 
@@ -292,6 +294,9 @@ Program reference: @internalsref{SkipEvent}, @internalsref{SkipMusic}.
 
 
 @cindex duration
+@cindex @code{\longa}
+@cindex @code{\breve}
+@cindex @code{\maxima}
 
 
 In Note, Chord, and Lyrics mode, durations are designated by numbers
@@ -1086,6 +1091,8 @@ indicating how much of the measure has passed at this point.
 @node Unmetered music
 @subsection Unmetered music
 
+@cindex @code{\bar}
+
 Bar lines and bar numbers are calculated automatically. For unmetered
 music (e.g. cadenzas), this is not desirable.  By setting
 @code{Score.timing} to false, this automatic timing can be switched
@@ -1099,7 +1106,6 @@ off. Empty bar lines,
 indicate where line breaks can occur.
 
 
-
 @refcommands
 
 @cindex @code{\cadenzaOn}
@@ -1175,7 +1181,7 @@ The command @code{\bar }@var{bartype} is a short cut for doing
 is set to a string, a bar line of that type is created.
 
 @cindex whichBar
-@cindex repeatCommands
+@cindex @code{repeatCommands}
 @cindex defaultBarType
 
 You are encouraged to use @code{\repeat} for repetitions.  See
@@ -1211,6 +1217,8 @@ The easiest way to enter fragments with more than one voice on a staff
 is to split chords using the separator @code{\\}.  You can use it for
 small, short-lived voices or for single chords
 
+@cindex @code{\\}
+
 @lilypond[quote,verbatim,fragment]
 \context Staff \relative c'' {
   c4 << { f d e  } \\ { b c2 } >>
@@ -1268,8 +1276,8 @@ Similarly, you can merge half note heads with eighth notes, by setting
 c8 c4. } \\ { c2 c2 } >>
 @end lilypond
 
-LilyPond also vertically shifts rests that are opposite of a stem
-
+LilyPond also vertically shifts rests that are opposite of a stem,
+for example
 
 @lilypond[quote,raggedright,fragment,verbatim]
 \context Voice << c''4 \\  r4 >>
@@ -1409,7 +1417,7 @@ all 16th or shorter beams at beat positions, as defined by the
 @code{beatLength} property.
 
 
-@lilypond[quote,relative=2,verbatim,noindent]
+@lilypond[fragment,quote,relative=2,verbatim,noindent]
 c16[ c c c c c c c]
 \set subdivideBeams = ##t
 c16[ c c c c c c c]
@@ -1745,36 +1753,23 @@ f( g)( a) a8 b( a4 g2 f4)
 <c e>2( <b d>2)
 @end lilypond
 
+The direction of a slur can be set with the
+generic commands
 
-@c TODO: should explain that ^( and _( set directions
-@c should set attachments with ^ and _ ?  
-
-Slurs avoid crossing stems, and are generally attached to note heads.
-However, in some situations with beams, slurs may be attached to stem
-ends.  If you want to override this layout you can do this through the
-object property @code{attachment} of @internalsref{Slur}.  Its value
-is a pair of symbols, specifying the attachment type of the left and
-right end points
-
-@lilypond[quote,fragment,relative=1,verbatim]
-\slurUp
-\override Stem #'length = #5.5
-g'8(g g4)
-\override Slur #'attachment = #'(stem . stem)
-g8( g g4)
-@end lilypond
+@example
+  \override Slur #'direction = #UP
+  \slurUp     % shortcut for the previous line 
+@end example
 
-If a slur would strike through a stem or beam, the slur will be moved
-away upward or downward. If this happens, attaching the slur to the
-stems might look better
+@noindent
+However, there is a convenient shorthand for forcing slur
+directions. By adding @code{_} or @code{^} before the opening
+parentheses, the direction is also set. For example,  
 
-@lilypond[quote,fragment,relative=1,verbatim]
-\stemUp \slurUp
-d32( d'4 d8..)
-\override Slur #'attachment = #'(stem . stem)
-d,32( d'4 d8..)
+@lilypond[relative=2,fragment]
+   c4_( c)   c^( c)
 @end lilypond
-
 @refcommands
 
 
@@ -1794,12 +1789,6 @@ d,32( d'4 d8..)
 Program reference: @seeinternals{Slur}, and @internalsref{SlurEvent}.
 
 
-@refbugs
-
-Producing nice slurs is a difficult problem, and LilyPond 
-uses a simple, empiric method to produce slurs. In some cases, its
-results are ugly.
-
 
 @cindex Adjusting slurs
 
@@ -1842,8 +1831,7 @@ Program reference: see also @internalsref{PhrasingSlur}, and
 
 @refbugs
 
-Phrasing slurs have the same limitations in their formatting as normal
-slurs. Putting phrasing slurs over rests leads to spurious warnings.
+Putting phrasing slurs over rests leads to spurious warnings.
 
 @node Breath marks
 @subsection Breath marks
@@ -2538,6 +2526,13 @@ c1
 }
 @end lilypond
 
+@seealso
+
+Brackets for the repeat are normally only printed over the topmost
+staff. This can be adjusted by setting the @code{voltaOnThisStaff}
+property @inputfileref{input/regression,volta-multi-staff.ly},
+@inputfileref{input/regression,volta-chord-names.ly}
+
 @refbugs
 
 A nested repeat like
@@ -2555,6 +2550,16 @@ having the @code{\alternative} belong to the inner @code{\repeat}.
 For clarity, it is advisable to use braces in such situations.
 @cindex ambiguity
 
+
+
+Timing information is not remembered at the start of an alternative,
+so after a repeat timing information must be reset by hand, for
+example by setting @code{Score.measurePosition} or entering
+@code{\partial}.  Similarly, slurs or ties are also not repeated.
+
+
+
+
 @node Repeats and MIDI
 @subsection Repeats and MIDI
 
@@ -2564,13 +2569,6 @@ For instructions on how to expand repeats for MIDI output, see the
 example file @inputfileref{input/test,unfold-all-repeats.ly}.
 
 
-@refbugs
-
-Timing information is not remembered at the start of an alternative,
-so after a repeat timing information must be reset by hand, for
-example by setting @code{Score.measurePosition} or entering
-@code{\partial}.  Similarly, slurs or ties are also not repeated.
-
 
 @node Manual repeat commands
 @subsection Manual repeat commands
@@ -3297,9 +3295,42 @@ The associated object is @internalsref{VoiceFollower}.
 @node Vocal music
 @section Vocal music
 
-This section discusses how to enter and print lyrics.
+
+The easiest way to add lyrics to a melody, is by appending
+
+
+@cindex \newlyrics
+@example
+  \newlyrics @{ @var{the lyrics} @} 
+@end example
+
+to a melody. Here is an example,
+
+@lilypond[raggedright,verbatim]
+  \relative { \time 3/4 c2 e4 g2. }
+  \newlyrics { play the game } 
+@end lilypond
+
+More stanzas can be added by adding more
+@code{\newlyrics} sections 
+
+@lilypond[raggedright,verbatim]
+  \relative { \time 3/4 c2 e4 g2. }
+  \newlyrics { play the game } 
+  \newlyrics { speel het spel } 
+  \newlyrics { joue le jeu } 
+@end lilypond
+
+The @code{\newlyrics} keyword has three functions: it interprets the
+following words as texts instead of notes, it sets up a context for
+printing texts (the @code{Lyrics} context), and it couples the melody
+with the lyrics, so the durations of both are aligned.
+
+These three functions can be controlled separately, and that is what
+the following sections are about.
 
 @menu
+* Easy lyrics entry
 * Entering lyrics::             
 * The Lyrics context::          
 * More stanzas::                
@@ -3315,9 +3346,9 @@ This section discusses how to enter and print lyrics.
 @cindex punctuation
 
 Lyrics are entered in a special input mode. This mode is is introduced
-by the keyword @code{\lyrics}.  In this mode you can enter lyrics, with
-punctuation and accents without any hassle.  Syllables are entered like
-notes, but with pitches replaced by text.  For example,
+by the keyword @code{\lyrics}.  In this mode you can enter lyrics,
+with punctuation and accents without any hassle.  Syllables are
+entered like notes, but with pitches replaced by text.  For example,
 @example
   \lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @}
 @end example
@@ -3352,16 +3383,18 @@ property commands
 Any @code{_} character which appears in an unquoted word is converted
 to a space.  This provides a mechanism for introducing spaces into words
 without using quotes.  Quoted words can also be used in Lyrics mode to
-specify words that cannot be written with the above rules
+specify words that cannot be written with the above rules. The
+following example incorporates double quotes
 
 @example
   \lyrics @{ He said: "\"Let" my peo ple "go\"" @}
 @end example
-However, at least for english texts, you should use 
+
+This example is slightly academic, since it gives better looking
+results to use matched single quotes, @code{``} and @code{''}
 @example
   \lyrics @{ He said: ``Let my peo ple go'' @}
 @end example
-to get the correct shape of the starting and ending quote.
 
 @cindex hyphens
 
@@ -3396,8 +3429,6 @@ The definition of lyrics mode is too complex.
 @subsection  The Lyrics context
 
 
-@c TODO: document \newlyrics
-
 Lyrics are printed by interpreting them in a @internalsref{Lyrics} context
 @example
  \context Lyrics \lyrics @dots{}
@@ -3629,24 +3660,6 @@ Program reference: Layout objects @internalsref{LyricText} and
 @internalsref{VocalName}.  Music expressions
 @internalsref{LyricEvent}.
 
-@refbugs
-
-@cindex ambiguity
-
-Input for lyrics introduces a syntactical ambiguity
-@example 
-foo = bar 
-@end example 
-
-@noindent
-is interpreted as assigning a string identifier @code{\foo} such that
-it contains @code{"bar"}.  However, it could also be interpreted as
-making or a music identifier @code{\foo} containing the syllable
-`bar'.  The force the latter interpretation, use
-@example
-foo = \lyrics bar4
-@end example
 
 
 @node Ambitus
@@ -3720,6 +3733,9 @@ ambitus.
 @node Tablatures
 @section Tablatures
 
+@cindex tablature
+@cindex guitar tablature
+
 Tablature notation is used for notating music for plucked string
 instruments.  It notates pitches not by using note heads, but by
 indicating on which string and fret a note must be played.  LilyPond
@@ -3749,6 +3765,7 @@ are printed as tablature, by using @internalsref{TabStaff} and
 @end lilypond
 
 @cindex minimumFret
+@cindex fret
 
 When no string is specified, the first string that does not give a
 fret number less than @code{minimumFret} is selected. The default
@@ -4301,7 +4318,7 @@ and @internalsref{Staff}.@code{instr}. This will print a string before
 the start of the staff. For the first start, @code{instrument} is
 used, for the next ones @code{instr} is used.
 
-@lilypond[quote,verbatim,raggedright,relative=1]
+@lilypond[quote,verbatim,raggedright,relative=1,fragment]
 \set Staff.instrument = "Ploink "
 \set Staff.instr = "Plk "
 c1
@@ -4321,6 +4338,9 @@ names, for example
 }
 @end lilypond
 
+For longer instrument names, it may be useful to increase the
+@code{indent} setting in the @code{\paper} block.
+
 @seealso
 
 Program reference: @internalsref{InstrumentName}.
@@ -5005,7 +5025,7 @@ with respect to that clef.
 modern style mensural C clef @tab
 @code{neo_mensural_c1}, @code{neo_mensural_c2},
 @code{neo_mensural_c3}, @code{neo_mensural_c4} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "neo_mensural_c2" c
 @end lilypond
@@ -5029,7 +5049,7 @@ petrucci style mensural C clefs, for use  on different  staff lines
 @code{petrucci_c5}
 
 @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "petrucci_c2" c
 @end lilypond
@@ -5038,7 +5058,7 @@ petrucci style mensural C clefs, for use  on different  staff lines
 @code{clefs-petrucci_f} @tab
 petrucci style mensural F clef @tab
 @code{petrucci_f} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "petrucci_f" c
 @end lilypond
@@ -5047,7 +5067,7 @@ petrucci style mensural F clef @tab
 @code{clefs-petrucci_g} @tab
 petrucci style mensural G clef @tab
 @code{petrucci_g} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "petrucci_g" c
 @end lilypond
@@ -5057,7 +5077,7 @@ petrucci style mensural G clef @tab
 historic style mensural C clef @tab
 @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3},
 @code{mensural_c4} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "mensural_c2" c
 @end lilypond
@@ -5066,7 +5086,7 @@ historic style mensural C clef @tab
 @code{clefs-mensural_f} @tab
 historic style mensural F clef @tab
 @code{mensural_f} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "mensural_f" c
 @end lilypond
@@ -5075,7 +5095,7 @@ historic style mensural F clef @tab
 @code{clefs-mensural_g} @tab
 historic style mensural G clef @tab
 @code{mensural_g} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "mensural_g" c
 @end lilypond
@@ -5084,7 +5104,7 @@ historic style mensural G clef @tab
 @code{clefs-vaticana_do} @tab
 Editio Vaticana style do clef @tab
 @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
     \override Staff.StaffSymbol   #'line-count = #4
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "vaticana_do2" c
@@ -5094,7 +5114,7 @@ Editio Vaticana style do clef @tab
 @code{clefs-vaticana_fa} @tab
 Editio Vaticana style fa clef @tab
 @code{vaticana_fa1}, @code{vaticana_fa2} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[quote,relative=1,notime,fragment]
     \override Staff.StaffSymbol   #'line-count = #4
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "vaticana_fa2" c
@@ -5104,7 +5124,7 @@ Editio Vaticana style fa clef @tab
 @code{clefs-medicaea_do} @tab
 Editio Medicaea style do clef @tab
 @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
     \override Staff.StaffSymbol   #'line-count = #4
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "medicaea_do2" c
@@ -5114,7 +5134,7 @@ Editio Medicaea style do clef @tab
 @code{clefs-medicaea_fa} @tab
 Editio Medicaea style fa clef @tab
 @code{medicaea_fa1}, @code{medicaea_fa2} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
     \override Staff.StaffSymbol   #'line-count = #4
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "medicaea_fa2" c
@@ -5124,7 +5144,7 @@ Editio Medicaea style fa clef @tab
 @code{clefs-hufnagel_do} @tab
 historic style hufnagel do clef @tab
 @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
     \override Staff.StaffSymbol   #'line-count = #4
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "hufnagel_do2" c
@@ -5134,7 +5154,7 @@ historic style hufnagel do clef @tab
 @code{clefs-hufnagel_fa} @tab
 historic style hufnagel fa clef @tab
 @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
     \override Staff.StaffSymbol   #'line-count = #4
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "hufnagel_fa2" c
@@ -5144,7 +5164,7 @@ historic style hufnagel fa clef @tab
 @code{clefs-hufnagel_do_fa} @tab
 historic style hufnagel combined do/fa clef @tab
 @code{hufnagel_do_fa} @tab
-@lilypond[quote,relative=1,notime]
+@lilypond[fragment,quote,relative=1,notime]
 \override Staff.TimeSignature   #'transparent = ##t
 \clef "hufnagel_do_fa" c
 @end lilypond
@@ -7504,7 +7524,7 @@ Examples: @inputfileref{input/regression,balloon.ly}.
 The `easy play' note head includes a  name inside the head.  It is
 used in music for beginners
 
-@lilypond[quote,raggedright,verbatim,staffsize=26]
+@lilypond[quote,raggedright,verbatim,fragment,staffsize=26]
 \setEasyHeads
 c'2 e'4 f' | g'1
 @end lilypond
@@ -7553,6 +7573,10 @@ The MIDI output allocates a channel for each Staff, and one for global
 settings.  Hence, the MIDI file should not have more than 15 staves
 (or 14 if you do not use drums). Other staves will remain silent.
 
+Not all MIDI players correctly handle tempo change in the MIDI
+output. Players that are known to work include
+@uref{timidity,http://timidity.sourceforge.net/}
+
 
 @menu
 * MIDI block::