]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/learning/common-notation.itely
Doc: Issue 4309: Clarify the warning about bare durations
[lilypond.git] / Documentation / learning / common-notation.itely
index 7b07c8e959fb6047acbfb238c1cf898e2236cafd..3b7d55e94eeea78b2f283bd3d3b907595d2ed4c1 100644 (file)
@@ -52,7 +52,7 @@ on one staff.
 
 @menu
 * Bar lines and bar checks::
-* Accidentals and key signatures::
+* Pitches and key signatures::
 * Ties and slurs::
 * Articulation and dynamics::
 * Adding text::
@@ -95,34 +95,49 @@ durations that make each measure add up to the correct
 length.  Bar checks also make your input code easier to
 read, since they help to keep things organized.
 
-@lilypond[verbatim,quote,relative=2]
-g1 | e1 | c2. c'4 | g4 c g e | c4 r r2 |
+@c This example deliberately produces a warning
+@lilypond[verbatim,quote]
+\relative g' {
+  g1 | e1 | c2. c' | g4 c g e | c4 r r2 |
+}
 @end lilypond
 
+If you compile the code in the example above, you should see a
+warning in the console output:
+
+@example
+warning: barcheck failed at: 1/2
+ g1 | e1 | c2. c'
+                  | g4 c g e | c4 r r2 |
+@end example
+
+Although the missing duration is clear in the musical output in this
+simple example, the warning in the console output is far more
+effective in drawing attention to the missing @code{4} in bar 3.
+
 @seealso
 Notation Reference:
 @ruser{Bar and bar number checks}.
 
 
-@node Accidentals and key signatures
-@subsection Accidentals and key signatures
+@node Pitches and key signatures
+@subsection Pitches and key signatures
 
 @menu
-* Accidentals::
+* Pitch alterations::
 * Key signatures::
 * Warning key signatures and pitches::
 @end menu
 
-@warning{New users are often confused by these -- please read the
-warning at the bottom of this page, especially if you are not
-familiar with music theory!}
+@warning{New users often misunderstand how LilyPond uses the key
+signature -- please read the warning at the bottom of this page.}
 
-@node Accidentals
-@unnumberedsubsubsec Accidentals
+@node Pitch alterations
+@unnumberedsubsubsec Pitch alterations
 
 
 @cindex accidentals
-@cindex accidentals and key signatures
+@cindex natural
 @cindex sharp
 @cindex double sharp
 @cindex sharp, double
@@ -138,13 +153,16 @@ familiar with music theory!}
 Music Glossary: @rglos{sharp}, @rglos{flat}, @rglos{double sharp},
 @rglos{double flat}, @rglos{accidental}.
 
+Note-names in LilyPond identify pitches.  For example, @code{c}
+always means C-natural, regardless of the key signature.
+
 A @notation{sharp} pitch is made by adding @code{is} to the name,
 and a @notation{flat} pitch by adding @code{es}.  As you might
 expect, a @notation{double sharp} or @notation{double flat} is
 made by adding @code{isis} or @code{eses}.  This syntax is derived
 from note naming conventions in Nordic and Germanic languages,
 like German and Dutch.  To use other names for
-@notation{accidentals}, see @ruser{Note names in other languages}.
+@notation{alterations}, see @ruser{Note names in other languages}.
 
 @lilypond[verbatim,quote,relative=2]
 cis4 ees fisis, aeses
@@ -176,11 +194,11 @@ Music Glossary: @rglos{key signature}, @rglos{major},
 The @notation{key signature} is set with the command @code{\key}
 followed by a pitch and @code{\major} or @code{\minor}.
 
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote,relative=1]
 \key d \major
-a1 |
-\key c \minor
-a1 |
+d4 fis a c |
+\bar "||" \key c \minor
+c,4 ees g b |
 @end lilypond
 
 @smallspace
@@ -193,22 +211,18 @@ Music Glossary: @rglos{accidental}, @rglos{key signature},
 @rglos{pitch}, @rglos{flat}, @rglos{natural}, @rglos{sharp},
 @rglos{transposition}, @rglos{Pitch names}.
 
-To determine whether to print an @notation{accidental}, LilyPond
-examines the pitches and the @notation{key signature}.  The key
-signature only affects the @emph{printed} accidentals, not the
-note's @notation{pitch}!  This is a feature that often causes
-confusion to newcomers, so let us explain it in more detail.
-
-LilyPond makes a clear distinction between musical content and
-layout.  The alteration (@notation{flat}, @notation{natural sign} or
-@notation{sharp}) of a note is part of the pitch, and is therefore
-musical content.  Whether an accidental (a @emph{printed} flat,
-natural or sharp sign) is printed in front of the corresponding
-note is a question of layout.  Layout is something that follows
-rules, so accidentals are printed automatically according to those
-rules.  The pitches in your music are works of art, so they will
-not be added automatically, and you must enter what you want to
-hear.
+LilyPond makes a distinction between musical content and
+its printed representation.  Input such as @code{d4 e fis2}
+defines the pitches and durations of notes, which is musical
+content.  The @notation{key signature} is part of the printed
+representation.  The key signature also sets rules for the
+printed representations of notes.  LilyPond compares each input
+pitch to the key signature to determine whether to print an
+@notation{accidental}.
+
+The command @code{\key} sets the @notation{key signature}, which
+affects the printed representation, but does @emph{not} change
+the pitch assigned to a note such as @code{c} in the input.
 
 In this example:
 
@@ -231,10 +245,8 @@ note with pitch B-natural.}  In the key of A-flat major, it
 aes4 c b c
 @end lilypond
 
-If the above seems confusing, consider this: if you were playing a
-piano, which key would you hit?  If you would press a black key,
-then you @emph{must} add @w{@code{-is}} or @w{@code{-es}} to the note
-name!
+Whenever you enter a pitch that is a black key on the piano, you
+@emph{must} add @w{@code{-is}} or @w{@code{-es}} to the note name.
 
 Adding all alterations explicitly might require a little more
 effort when typing, but the advantage is that
@@ -274,16 +286,31 @@ Notation Reference:
 @node Ties
 @unnumberedsubsubsec Ties
 
-
 Music Glossary: @rglos{tie}.
 
 A @notation{tie} is created by appending a tilde @code{~} to the
-first note being tied.
+first of the two notes being tied.
+
+@lilypond[verbatim,quote,relative=2]
+g4~ g c2~ | c4~ c8 a~ a2 |
+@end lilypond
+
+@cindex bare duration
+@cindex duration, bare
+
+When the pitch does not change, as is always the case with tied notes,
+subsequent pitches may be omitted, specifying just the bare duration:
 
 @lilypond[verbatim,quote,relative=2]
 g4~ 4 c2~ | 4~ 8 a~ 2 |
 @end lilypond
 
+This shorthand may be useful in other places where the rhythm changes
+with an unchanging pitch, but remember that a bare pitch followed by a
+space and a bare duration will be interpreted as a single note. In
+other words, @code{c4 a 8 8} would be interpreted as @code{c4 a8 a8},
+not as @code{c4 a4 a8 a8}.  Write instead @code{c4 a4 8 8 }.
+
 @node Slurs
 @unnumberedsubsubsec Slurs
 
@@ -1015,7 +1042,7 @@ separating each syllable with a space.
     d4 b8 c4 a8 | d4 b8 g4
   }
   \addlyrics {
-    Girls and boys come out to play,
+    Girls and boys come out to play,
   }
 >>
 @end lilypond
@@ -1050,26 +1077,13 @@ shine as bright as day}.  Let's extend it:
     a4 b8 c b a | d4 b8 g4. |
   }
   \addlyrics {
-    Girls and boys come out to play,
-    The | moon doth shine as | bright as day; |
+    Girls and boys come out to play,
+    The moon doth shine as bright as day;
   }
 >>
 @end lilypond
 
-If you compile the code in the example above, you should see some
-warnings in the console output:
-
-@example
-song.ly:12:29: warning: barcheck failed at: 5/8
-    The | moon doth shine as
-                             | bright as day; |
-song.ly:12:46: warning: barcheck failed at: 3/8
-    The | moon doth shine as | bright as day;
-                                              |
-@end example
-
-This is a good example of the usefulness of bar checks.  Now,
-looking at the music, we see that the extra lyrics do not align
+Looking at the music, we see that the extra lyrics do not align
 properly with the notes.  The word @notation{shine} should be sung
 on two notes, not one.  This is called a @notation{melisma}, a
 single syllable sung to more than one note.  There are several
@@ -1085,8 +1099,8 @@ to add a slur across them, for details, see @ref{Ties and slurs}:
     a4 b8 c( b) a | d4 b8 g4. |
   }
   \addlyrics {
-    Girls and boys come out to play,
-    The | moon doth shine as | bright as day; |
+    Girls and boys come out to play,
+    The moon doth shine as bright as day;
   }
 >>
 @end lilypond
@@ -1106,8 +1120,8 @@ manual beams}.
     a4 b8 c([ b]) a | d4 b8 g4. |
   }
   \addlyrics {
-    Girls and boys come out to play,
-    The | moon doth shine as | bright as day; |
+    Girls and boys come out to play,
+    The moon doth shine as bright as day;
   }
 >>
 @end lilypond
@@ -1125,8 +1139,8 @@ that should be included in the melisma:
     a4 b8 c[ b] a | d4 b8 g4. |
   }
   \addlyrics {
-    Girls and boys come out to play,
-    The | moon doth shine _ as | bright as day; |
+    Girls and boys come out to play,
+    The moon doth shine _ as bright as day;
   }
 >>
 @end lilypond
@@ -1147,8 +1161,8 @@ first three bars of @notation{Dido's Lament}, from Purcell's
     c4.( bes8 a4. g8 fis4.) g8 | fis1
   }
   \addlyrics {
-    When I am laid,
-    am | laid __ in | earth,
+    When I am laid,
+    am laid __ in earth,
   }
 >>
 @end lilypond
@@ -1172,8 +1186,8 @@ far about aligning lyrics to notes.
     d4 d e | c2
   }
   \addlyrics {
-    A -- | way in a __ | man -- ger,
-    no __ | crib for a | bed, __
+    A -- way in a __ man -- ger,
+    no __ crib for a bed,
   }
 >>
 @end lilypond
@@ -1197,7 +1211,7 @@ Here's an example from Rossini's @notation{Figaro}, where
     c4.~ 8 d b | c8([ d]) b c d b | c8
   }
   \addlyrics {
-    Lar -- go_al fac -- | to -- tum del -- la cit -- | tà
+    Lar -- go_al fac -- to -- tum del -- la cit -- tà
   }
 >>
 @end lilypond
@@ -1227,7 +1241,7 @@ example from Handel's @notation{Judas Maccabæus}:
     c8 | c8([ bes]) a a([ g]) f | f'4. b, | c4.~ 4
   }
   \addlyrics {
-    Let | flee -- cy flocks the | hills a -- | dorn, __
+    Let flee -- cy flocks the hills a -- dorn, __
   }
   \relative c' {
     \key f \major
@@ -1236,7 +1250,7 @@ example from Handel's @notation{Judas Maccabæus}:
     r8 | r4. r4 c8 | a'8([ g]) f f([ e]) d | e8([ d]) c bes'4
   }
   \addlyrics {
-    Let | flee -- cy flocks the | hills a -- dorn,
+    Let flee -- cy flocks the hills a -- dorn,
   }
 >>
 @end lilypond