We start off by showing how very simple music is entered in LilyPond:
you get a note simply by typing its note name, from a
through g
. So if you enter
c d e f g a b
then the result looks like this:
The length of a note is specified by adding a number, 1
for a
whole note, 2
for a half note, and so on:
a1 a2 a4 a16 a32
If you do not specify a duration, the previous one is used:
a4 a a2 a
Rests are entered just like notes, but with the name "r
":
r2 r4 r8 r16
Add a dot .
after the duration to get a dotted note:
a2. a4 a8. a16
The meter (or time signature) can be set with the
\time
command:
\time 3/4 \time 6/8 \time 4/4
The clef can be set using the \clef
command:
\clef treble \clef bass \clef alto \clef tenor
Notes and commands like \clef
and \time
, are enclosed
in \notes {...}
. This indicates that music (as opposed
to lyrics) follows:
\notes { \time 3/4 \clef bass c2 e4 g2. f4 e d c2 r4 }Now the piece of music is almost ready to be printed. The final step is to combine the music with a printing command.
The printing command is the so-called \paper
block:
\paper { }
The \paper
block is used to customize printing specifics. The
customization commands go between {
and }
, but for
now, we accept the defaults. The music and the \paper
block
are combined by enclosing them in \score { ... }
, so the
following is a complete and valid input file:
\score { \notes { \time 3/4 \clef bass c2 e4 g2. f4 e d c2 r4 } \paper { } }
In the rest of the tutorial we will often leave out \score
and \paper
for clarity. However, both must be present when
feeding the file to LilyPond.
For more elaborate information on
This page is for LilyPond-2.0.0 (stable-branch).