![]() |
GNU LilyPond-- -- |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
More basicsWe continue with the introduction of the remaining musical constructs.
Normal 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 adding a tilde " g'4-~ g' a'2-~ a'4 A tie is different from a slur. A tie simply makes the first note sound longer, and can only be used on pairs of notes with the same pitch. Slurs indicate the articulations of notes, and can be used on larger groups of notes. Slurs and ties are also nested in practice: 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. \score { \notes { \time 4/4 \key d \minor \clef violin r4 r8 d''8 cis''4 e'' d''8 a'4.-~ a' b'8 cis''4 cis''8 cis'' bis'4 d''8 cis''-~ cis''2 r2 } \paper { } } There are some interesting points to note in this example. 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. Bar lines and beams are drawn automatically. LilyPond calculates line breaks for you; it doesn't matter where you make new lines in the source file. Finally, the order of time, key and clef changes is not relevant: lilypond will use standard notation conventions for ordering these items. The example also indicates that a piece of music written in a high register needs lots of quotes. This makes the input less readable, and is also a potential source of errors. The solution is to use "relative octave" mode. In practice, this is
the most convenient way to copy existing music. To use relative mode,
add \relative c'' { c f c g c } You can make larger intervals by adding octavation 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: \relative c'' { c f, f c' c g' c, } Here's an example of the difference between relative mode and "normal" (non-relative) mode: \relative a { \clef bass a d a e d c' d' } \clef bass a d a e d c' d' SUMMARY The following table summarizes the syntax learned so far in this section.
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. Mark the first note to be beamed 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 < \context Staff = staffA { \clef violin c'' } \context Staff = staffB { \clef bass c } > In this example, We can now typeset a melody with two staves: \score { \notes < \context Staff = staffA { \time 3/4 \clef violin \relative c'' { e2-( d4 c2 b4 a8-[ a-] b-[ b-] g-[ g-] a2.-) } } \context Staff = staffB { \clef bass c2 e4 g2. f4 e d c2. } > \paper {} } 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 staves. 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 and decrescendi are started with the commands c2-\< c2-\!-\ff c2-\> c2-\! Chords can be made by surrounding notes with r4 <<c e g>>4 <<c f a>>8 You can combine beams and ties with chords. Beam and tie markings must be placed outside the chord markers: r4 <<c e g>>8-[ <<c f a>>-]-~ <<c f a>> r4 <<c e g>>8-\>-( <<c e g>> <<c e g>> <<c f a>>8-\!-\) SUMMARY
Now 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 typing some simple examples, and experiment a little. When you're comfortable with the basics, you might want to read the rest of this chapter. It continues in tutorial-style, but it is much more in-depth, dealing with more advanced topics such as lyrics, chords, orchestral scores and parts, fine tuning of 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 (address unknown) Copyright (c) 1997--2002 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.7.14 (development-branch) by