A sharp (#) pitch is made by adding is
to
the name, a flat (b) pitch by adding es
. As
you might expect, a double sharp or double flat is
made by adding isis
or eses
:1
cis1 ees fisis aeses
The key signature is set with the command "\key
", followed by
a pitch and \major
or \minor
:
\key d \major g1 \key c \minor g
Key signatures together with the pitch (including alterations) are used together to determine when to print accidentals. This is a feature that often causes confusion to newcomers, so let us explain it in more detail:
LilyPond has a sharp distinction between musical content and layout. The alteration (flat, natural or sharp) of a note is part of the pitch, and is therefore musical content. Whether an accidental (a flat, natural or sharp sign) is a 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.
For example, in this example:
no note gets an explicit accidental, but still you enter
\key d \major d cis fis
The code d
does not mean "print a black dot just below the
staff." Rather, it means: "a note with pitch D-natural." In the key
of A-flat, it gets an accidental:
\key as \major d
Adding all alterations explicitly might require some more effort when typing, but the advantage is that transposing is easier, and music can be printed according to different conventions. See Accidentals for some examples how accidentals can be printed according to different rules.
A tie is created by adding a tilde "~
" to the first note
being tied:
g4~ g a2~ a4
This example shows the key signature, accidentals and ties in action:
\score { \notes { \time 4/4 \key g \minor \clef violin r4 r8 a8 gis4 b g8 d4.~ d e'8 fis4 fis8 fis8 eis4 a8 gis~ gis2 r2 } \paper { } }
There are some interesting points to note in this example. Bar lines and beams are drawn automatically. Line breaks are calculated automatically; it does not matter where the lines breaks are in the source file. Finally, the order of time, key and clef changes is not relevant: in the printout, these are ordered according to standard notation conventions.
Beams are drawn automatically, but if you do not like where they are
put, they can be entered by hand. Mark the first note to be beamed
with [
and the last one with ]
:
a8[ ais] d[ es r d]
For more information on
This syntax derived from note naming conventions in Nordic and Germanic languages, like German and Dutch.
This page is for LilyPond-2.0.0 (stable-branch).