@menu
* Bar lines and bar checks::
-* Accidentals and key signatures::
+* Pitches and key signatures::
* Ties and slurs::
* Articulation and dynamics::
* Adding text::
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
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
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
@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:
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
d4 b8 c4 a8 | d4 b8 g4
}
\addlyrics {
- Girls and boys come | out to play,
+ Girls and boys come out to play,
}
>>
@end lilypond
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
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
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
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
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
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
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
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
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