Next: , Up: Tutorial


2.1 First steps

The first example demonstrates how to enter the most elementary piece of music, a scale. A note can be entered by typing its name, from `a' through `g'. So, if you enter

{
c d e f g a b
}

the result looks like this

[image of music]

Every piece of LilyPond input needs to have {curly braces} placed around the input. For the rest of this manual, most examples will omit these braces, but don't forget them in your own music!

In addition, many examples use relative mode. This is explained in Octave entry; for now simply be aware that some examples should be placed inside \relative { ...music... }. Many example have also been compressed horizontally to save space, using \paper { ragged-right = ##t }.

Finally, LilyPond input is case sensitive. { c d e } is valid input; { C D E } will produce an error message.

The duration of a note is specified by a number after the note name. `1' for a whole note, `2' for a half note, `4' for a quarter note and so on

a1 a2 a4 a16 a32

[image of music]

If you do not specify a duration, the duration last entered is used for the next notes. The duration of the first note in input defaults to a quarter

a a8 a a2 a

[image of music]

A rest is entered just like a note, but with the name `r'

r2 r4 r8 r16

[image of music]

Add a dot `.' after the duration to get a dotted note

a2. a4 a8. a16

[image of music]

The (or time signature) can be set with the \time command

\time 3/4
\time 6/8
\time 4/4

[image of music]

The clef can be set using the \clef command

\clef treble
\clef bass
\clef alto
\clef tenor

[image of music]

Remember to enclose the notes and commands in curly braces ... } to convert it to printable output.

     
     \time 3/4
     \clef bass
     c2 e4 g2.
     f4 e d c2 r4

[image of music]

For more information on

Entering pitches and durations
see Pitches, and Durations.
Clefs
see Clef.
Rests
see Rests.
Time signatures and other timing commands
see Time signature.

This page is for LilyPond-2.10.5 (stable-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.

Other languages: French.
Using automatic language selection.