[ << Common notation ] | [Top][Contents][Index][ ? ] | [ Fundamental concepts >> ] | ||
[ < Bar checks ] | [ Up : Single staff notation ] | [ Pitch alterations > ] |
2.1.2 Pitches and key signatures
Pitch alterations | ||
Key signatures | ||
Warning: key signatures and pitches |
Note: New users often misunderstand how LilyPond uses the key signature – please read the warning at the bottom of this page.
[ << Common notation ] | [Top][Contents][Index][ ? ] | [ Fundamental concepts >> ] | ||
[ < Pitches and key signatures ] | [ Up : Pitches and key signatures ] | [ Key signatures > ] |
Pitch alterations
Music Glossary: sharp, flat, double sharp, double flat, accidental.
Note-names in LilyPond identify pitches. For example, c
always means C-natural, regardless of the key signature.
A sharp pitch is made by adding is
to the name,
and a flat pitch by adding es
. As you might
expect, a double sharp or double flat is
made by adding isis
or eses
. This syntax is derived
from note naming conventions in Nordic and Germanic languages,
like German and Dutch. To use other names for
alterations, see
Note names in other languages.
\relative { cis''4 ees fisis, aeses }
[ << Common notation ] | [Top][Contents][Index][ ? ] | [ Fundamental concepts >> ] | ||
[ < Pitch alterations ] | [ Up : Pitches and key signatures ] | [ Warning key signatures and pitches > ] |
Key signatures
Music Glossary: key signature, major, minor.
The key signature is set with the command \key
followed by a pitch and \major
or \minor
.
\relative { \key d \major d'4 fis a c | \bar "||" \key c \minor c,4 ees g b | }
[ << Common notation ] | [Top][Contents][Index][ ? ] | [ Fundamental concepts >> ] | ||
[ < Key signatures ] | [ Up : Pitches and key signatures ] | [ Ties and slurs > ] |
Warning: key signatures and pitches
Music Glossary: accidental, key signature, pitch, flat, natural, sharp, transposition, Pitch names.
LilyPond makes a distinction between musical content and
its printed representation. Input such as d4 e fis2
defines the pitches and durations of notes, which is musical
content. The 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
accidental.
The command \key
sets the key signature, which
affects the printed representation, but does not change
the pitch assigned to a note such as c
in the input.
In this example:
\relative { \key d \major cis''4 d e fis }
No note has a printed accidental, but you must still add
is
and type cis
and fis
in the input file.
The code b
does not mean “print a black dot just on
the middle line of the staff.” Rather, it means “there is a
note with pitch B-natural.” In the key of A-flat major, it
does get an accidental:
\relative { \key aes \major aes'4 c b c }
Whenever you enter a pitch that is a black key on the piano, you
must add -is
or -es
to the note name.
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. For some examples of how accidentals can be printed according to different rules, see Automatic accidentals.
See also
Notation Reference: Note names in other languages, Accidentals, Automatic accidentals, Key signature.
[ << Common notation ] | [Top][Contents][Index][ ? ] | [ Fundamental concepts >> ] | ||
[ < Key signatures ] | [ Up : Pitches and key signatures ] | [ Ties and slurs > ] |
Other languages: deutsch, español, français, magyar, italiano, 日本語.
About automatic language selection.