@ignore
Tutorial guidelines:
- unless you have a really good reason, use either
- @l ilypond[quote,ragged-right,verbatim]
+ @l ilypond[verbatim,quote,ragged-right]
or
- @l ilypond[quote,ragged-right,verbatim,fragment,relative=2]
+ @l ilypond[verbatim,quote,ragged-right,fragment,relative=2]
(without spaces)
Don't use any other relative=X commands (make it a non-fragment
example), and don't use fragment without relative=2.
example, we have only specified four pitches, but LilyPond has
added a clef, time signature, and rhythms.
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
{
c' e' g' e'
}
current note is assumed to be within a @rglos{fourth}. We begin by
entering the most elementary piece of music, a @rglos{scale}.
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c' {
c d e f
g a b c
@samp{c} is the closest C to middle C. This is followed by the closest
D to the previous note. We can create melodies which have larger intervals:
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c' {
d f a g
c b f d
by adding a single quote @code{'} (or apostrophe) to the note name. We can
lower the octave by adding a comma @code{,} to the note name.
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
a a, c' f,
g g'' a,, f'
@samp{4} for a @rglos{quarter note} and so on. Beams are added
automatically.
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
a1
a2 a4 a8 a
To create @rglos{dotted note}s, add a dot @samp{.} to the duration number.
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
a a a4. a8
a8. a16 a a8. a8 a4.
A @rglos{rest} is entered just like a note with the name @samp{r}:
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
a r r2
r8 a r4 r4. r8
The @rglos{time signature}) can be set with the @code{\time} command:
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
\time 3/4
a4 a a
The @rglos{clef} can be set using the @code{\clef} command:
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c' {
\clef treble
c1
Here is a small example showing all these elements together:
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c, {
\time 3/4
\clef bass
begin at a C, then an F-sharp will be placed a higher than the C, while
a G-flat will be placed lower than the C.
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
c2 fis
c2 ges
@end lilypond
like German and Dutch. To use other names for accidentals, see
@ruser{Note names in other languages}.}
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
cis1 ees fisis, aeses
@end lilypond
The key signature is set with the command @code{\key} followed by
a pitch and @code{\major} or @code{\minor}.
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
\key d \major
a1
\key c \minor
In this example
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
\key d \major
d cis fis
@end lilypond
pitch E-natural.} In the key of A-flat major, it @emph{does} get an
accidental:
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
\key aes \major
e
@end lilypond
A @rglos{tie} is created by appending a tilde @samp{~} to the first
note being tied
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
g4~ g c2~
c4 ~ c8 a8 ~ a2
@end lilypond
A @rglos{slur} is a curve drawn across many notes. The starting note
and ending note are marked with @samp{(} and @samp{)} respectively.
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
d4( c16) cis( d e c cis d) e( d4)
@end lilypond
same time, but you cannot have simultaneous slurs or simultaneous
phrasing slurs.
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
a8(\( ais b c) cis2 b'2 a4 cis,\)
@end lilypond
of notes, and can be used on larger groups of notes. Slurs and ties
can be nested.
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
c2~( c8 fis fis4 ~ fis2 g2)
@end lilypond
Common @rglos{articulation}s can be added to a note using a dash @samp{-}
and a single character:
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
c-. c-- c-> c-^ c-+ c-_
@end lilypond
Similarly, fingering indications can be added to a note using a dash
(@samp{-}) and the digit to be printed:
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
c-3 e-5 b-2 a-1
@end lilypond
also use multiple articulations on the same note. However, in most cases
it is best to let LilyPond determine the articulation directions.
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
c_-^1 d^. f^4_2-> e^-_+
@end lilypond
Dynamic signs are made by adding the markings (with a backslash) to
the note
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
c\ff c\mf c\p c\pp
@end lilypond
@code{\>}. An ending dynamic, for example @code{\f}, will finish the
(de)crescendo, or the command @code{\!} can be used
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
c2\< c2\ff\> c2 c2\!
@end lilypond
@cindex beams, by hand
All @rglos{beam}s are drawn automatically:
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
a8 ais d ees r d c16 b a8
@end lilypond
manually. Mark the first note to be beamed with @samp{[} and the last one
with @samp{]}.
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
a8[ ais] d[ ees r d] a b
@end lilypond
@code{\partial}. It is followed by a duration: @code{\partial 4} is
a quarter note pickup and @code{\partial 8} an eighth note.
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
\partial 8
f8 c2 d
@end lilypond
of music is multiplied by the fraction. Triplets make notes occupy
2/3 of their notated duration, so a triplet has 2/3 as its fraction
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
\times 2/3 { f8 g a }
\times 2/3 { c r c }
\times 2/3 { f,8 g16[ a g a] }
can also be created by prefixing a music expression with the
keyword @code{\appoggiatura} or @code{\acciaccatura}
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
c2 \grace { a32[ b] } c2
c2 \appoggiatura b16 c2
c2 \acciaccatura b16 c2
expressions}. A single note is a music expression, although it is not
valid input all on its own.
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
a4
@end lilypond
Enclosing a group of notes in braces creates a new music expression:
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
{ a4 g4 }
@end lilypond
they are in sequence (i.e. each one follows the previous one). The result
is another music expression:
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
{ { a4 g } f g }
@end lilypond
@code{<<} and @code{>>}. In the following example, three sequences (all
containing two separate notes) are combined simultaneously:
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
<<
{ a4 g }
expression. If it is a single note, there is one staff; if there is a
simultaneous expression, there is more than one staff.
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
c2 <<c e>>
<< { e f } { c <<b d>> } >>
@code{Staff} elements are then combined in parallel with @code{<<} and
@code{>>}:
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
<<
\new Staff { \clef treble c }
the key signature of one staff does @emph{not} affect other
staves.
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
<<
\new Staff { \clef treble \time 3/4 c }
Here is a small example
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
\new PianoStaff <<
\new Staff { \time 2/4 c4 e g g, }
@code{@{...@}}) and combining these simultaneously, separating the
voices with @code{\\}
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
<<
{ a4 g2 f4~ f4 } \\
{ r4 g4 f2 f4 }
voices that temporarily do not play. Here is the same example with a
spacer rest (@samp{s}) instead of a normal rest (@samp{r}),
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
<<
{ a4 g2 f4~ f4 } \\
{ s4 g4 f2 f4 }
@cindex Songs
Consider a simple melody:
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\relative c'' {
a4 e c8 e r4
b2 c4( d)
@code{\addlyrics} keyword. Lyrics are entered by separating each
syllable with a space.
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
<<
\relative c'' {
a4 e c8 e r4
sung to more than one note. This is indicated with an @emph{extender
line}. It is entered as two underscores @code{__}:
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
<<
\relative c'' {
a4 e c8 e r4
In popular music it is common to denote accompaniment with chord names.
Such chords can be entered like notes,
-@lilypond[quote,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right]
\chordmode { c2 f4. g8 }
@end lilypond
created by adding modifiers after a colon. The
following example shows a few common modifiers:
-@lilypond[quote,verbatim,ragged-right]
+@lilypond[verbatim,quote,ragged-right]
\chordmode { c2 f4:m g4:maj7 gis1:dim7 }
@end lilypond
but renders the notes in a @code{ChordNames} context, with the
following result:
-@lilypond[quote,verbatim,ragged-right]
+@lilypond[verbatim,quote,ragged-right]
\chords { c2 f4.:m g4.:maj7 gis8:dim7 }
@end lilypond
When put together, chord names, lyrics and a melody form
a lead sheet,
-@lilypond[quote,verbatim,ragged-right]
+@lilypond[verbatim,quote,ragged-right]
<<
\chords { c2 g:sus4 f e }
\relative c'' {