|
|
GNU LilyPondWelcome to the home of the GNU Music Typesetter |
||||||||||
|
Node:First steps, Next:Simple legend, Up:Tutorial First stepsThis section shows how easy writing music with LilyPond actually is. If you have not seen LilyPond input source before, this section is for you. The next section has a table (see Simple legend) of all symbols that are introduced here, you may want to keep an eye on that. Writing music with LilyPond is explained below by a number of small examples. Each example has a small piece of text; the LilyPond input that you should type, with the resulting music printed below it. You get a simple note by typing its note name, from c d e f g a b The length of a note is specified by adding a number, " a1 a2 a4 a16 a32 If you don't specify a duration, the previous duration is used: a a a2 a A sharp (#) is made by adding " cis1 ees fisis aeses Add a dot " a2. a4 a8. a16 The meter (or time signature) can be set with the " \time 3/4 \time 6/8 \time 4/4 The clef can be set using the " \clef violin \clef bass \clef alto \clef tenor From these commands and notes, a piece of music can be formed. A piece
of music is made by enclosing it in "
At this point, the piece of music is ready to be printed. This is done by combining the music with a printing command. The printing command is the so-called "
We continue with the introduction of the remaining musical constructs. Rests are entered just like notes with the name " r2 r4 r8 r16 To raise a note by an octave, add a high quote c'4 c'' c''' \clef bass c c, A tie is created by entering a tilde " g'4 ~ g' a'2 ~ a'4 The key signature is set with the command " \key d \major g'1 \key c \minor g' This example shows notes, ties, octave marks, and rests in action. Don't worry about all the quotes.
There are some interesting points to note in this example. Firstly, accidentals (sharps and flats) don't have to be marked explicitly: you just enter the note name, and LilyPond determines whether or not to print an accidental. Secondly, bar lines and beams are drawn automatically. Thirdly, LilyPond calculates line breaks for you; it doesn't matter where you make new lines in the source file. The example also indicates that a piece of music written in a high register needs lots of quotes. This makes the input a bit unreadable, and is therefore also a potential source of errors. The solution is to use "relative octave" mode. In practice, most music is entered using this mode. To use relative mode, add If you type no octaviation quotes, relative mode chooses the note that
is closest to the previous one, which is often just the one you need.
For example:
You can make a large interval by adding octaviation quotes. Note that
quotes or commas do not determine the absolute height of a note;
the height of a note is relative to the previous one.
For example:
A slur is drawn across many notes, and indicates bound articulation
(legato). The starting note and ending note are marked with a
" d4( )c16( cis d e c cis d )e( )d4 If you need two slurs at the same time (one for articulation, one for
phrasing), you can also make a phrasing slur with a8(\( ais b ) c cis2 b'2 a4 cis, \) c Beams are drawn automatically, but if you don't like the choices, you
can enter beams by hand. Surround the notes to be grouped with [a8 ais] [d es r d] To print more than one staff, each piece of music that makes up a staff
is marked by adding
In this example, We can typeset a melody with two staffs now:
Notice that the time signature is specified in one melody staff only (the top staff), but is printed on both. LilyPond knows that the time signature should be the same for all staffs. Common accents can be added to a note using c-. c-- c-> Dynamic signs are made by adding the markings to the note: c-\ff c-\mf Crescendi are started with the commands c2\< \!c2-\ff \>c2 \!c2 Chords can be made by surrounding notes with r4 <c e g> <c f a> Of course, you can combine beams and ties with chords. Notice that beam and tie markings are placed outside the chord markers: r4 [<c8 e g> <c8 f a>] ~ <c8 f a> When you want to combine chords with slurs and dynamics, an annoying
technical detail crops up: you have type these commands next to the
notes, which means that they have to be inside the r4 <c8 e g \> ( > <c e g> <c e g> < ) \! c8 f a> A nasty technical detail also crops up when you start a score with a chord:
The program can not guess that you want the notes on only one staff. To
force the chord on a staff, add
This is the end of the simple tutorial. You know the basic ingredients of a music file, so this is the right moment to try your at hand at doing it yourself: try to type some simple examples, and experiment a little. When you're comfortable with the basics, then you might want to read the rest of this chapter. It also a manual in tutorial-style, but it is much more in-depth. It will also be very intimidating if you're not familiar with the basics. It deals with some of the more advanced features of LilyPond. Topics include lyrics, chords, orchestral scores and parts, fine tuning output, polyphonic music, and integrating text and music. |
||||||||||
|
Go back to index of LilyPond.
Please send GNU LilyPond questions and comments to lilypond-user@gnu.org. Please send comments on these web pages to lilypond@packages.debian.org Copyright (c) 1997--2001 Han-Wen Nienhuys and Jan Nieuwenhuizen. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. |
|||||||||||
This page was built from LilyPond-1.4.12 (stable-branch) by