Try it on this image
@lilypond[fragment,quote,raggedright,relative=2]
- c-\markup { \bold \huge { Click here. } }
+c-\markup { \bold \huge { Click here. } }
@end lilypond
@end ifhtml
@samp{a} through @samp{g}. So, if you enter
@example
- c d e f g a b
+c d e f g a b
@end example
@noindent
the result looks like this
@lilypond[fragment,quote,notime,relative=1]
- c d e f g a b
+c d e f g a b
@end lilypond
The duration of a note is specified by a number after the note name.
@c FIXME: have NOTIME also remove Score.timing?
@lilypond[fragment,quote,notime,relative=2]
- \set Score.timing = ##f
- \set Staff.autoBeaming = ##f
- { a1 a2 a4 a16 a32 s16_" " }
+\set Score.timing = ##f
+\set Staff.autoBeaming = ##f
+{ a1 a2 a4 a16 a32 s16_" " }
@end lilypond
If you do not specify a @rglos{duration}, the duration last entered is
defaults to a quarter
@example
- a a8 a a2 a
+a a8 a a2 a
@end example
@lilypond[fragment,quote,notime,relative=2]
- \set Score.timing = ##f
- { a a8 a a2 a s16_" " }
+\set Score.timing = ##f
+{ a a8 a a2 a s16_" " }
@end lilypond
@cindex rests
@example
- r2 r4 r8 r16
+r2 r4 r8 r16
@end example
@lilypond[fragment,quote,notime]
- \set Score.timing = ##f
- r2 r4 r8 r16 s16_" "
+\set Score.timing = ##f
+r2 r4 r8 r16 s16_" "
@end lilypond
Add a dot @samp{.} after the duration to get a @rglos{dotted note}
@example
- a2. a4 a8. a16
+a2. a4 a8. a16
@end example
@lilypond[fragment,quote,notime,relative=1]
- \set Score.timing = ##f
- { a2. a4 a8. a16 s16_" " }
+\set Score.timing = ##f
+{ a2. a4 a8. a16 s16_" " }
@end lilypond
The @rglos{meter} (or @rglos{time signature}) can be set with the
@code{\time} command
@example
- \time 3/4
- \time 6/8
- \time 4/4
+\time 3/4
+\time 6/8
+\time 4/4
@end example
@c A clef here may lead to confusion, remove it.
@lilypond[fragment,quote]
- \override Staff.Clef #'transparent = ##t
- \time 3/4
- s4_" "
- \time 6/8
- s4_" "
- \time 4/4
- s16_" "
+\override Staff.Clef #'transparent = ##t
+\time 3/4
+s4_" "
+\time 6/8
+s4_" "
+\time 4/4
+s16_" "
@end lilypond
The @rglos{clef} can be set using the @code{\clef} command
@example
- \clef treble
- \clef bass
- \clef alto
- \clef tenor
+\clef treble
+\clef bass
+\clef alto
+\clef tenor
@end example
@lilypond[fragment,quote,notime]
- \set Score.timing = ##f
- \clef treble
- s4_" "
- \clef bass
- s4_" "
- \clef alto
- s4_" "
- \clef tenor
- s16_" "
+\set Score.timing = ##f
+\clef treble
+s4_" "
+\clef bass
+s4_" "
+\clef alto
+s4_" "
+\clef tenor
+s16_" "
@end lilypond
@code{@{@tie{}@dots{}@tie{}@}} to convert it to printable output.
@lilypond[fragment,quote,noindent,linewidth=55\staffspace]
- \time 3/4
- \clef bass
- c2 e4 g2.
- f4 e d c2 r4
+\time 3/4
+\clef bass
+c2 e4 g2.
+f4 e d c2 r4
@end lilypond
For more elaborate information on
input and save the file as @file{test.ly}
@example
- @{ c'4 e' g' @}
+@{ c'4 e' g' @}
@end example
@noindent
} which you can print or with the standard facilities of your
operating system.@footnote{If your system does not have any tools
installed, you can try
-@uref{http://www.cs.wisc.edu/~ghost/,Ghostscript}, a freely available
-package for viewing and printing PDF and PostScript files.}
+@uref{http://@/www@/.cs@/.wisc@/.edu/@/~ghost/,Ghostscript}, a freely
+available package for viewing and printing PDF and PostScript files.}
On Windows, start up a text-editor@footnote{Any simple or
programmer-oriented editor will do, for example Notepad. Do not use a
LilyPond.} and enter
@example
- @{ c'4 e' g' @}
+@{ c'4 e' g' @}
@end example
Save it on the desktop as @file{test.ly} and make sure that it is not
like German and Dutch.}
@example
- cis1 ees fisis aeses
+cis1 ees fisis aeses
@end example
@lilypond[fragment,quote,notime]
- \set Score.timing = ##f
- \transpose c c' { cis1 ees fisis aeses s16_" " }
+\set Score.timing = ##f
+\transpose c c' { cis1 ees fisis aeses s16_" " }
@end lilypond
@cindex key signature, setting
a pitch and @code{\major} or @code{\minor}
@example
- \key d \major
- g1
- \key c \minor
- g
+\key d \major
+g1
+\key c \minor
+g
@end example
@lilypond[fragment,quote,notime,fragment]
- \key d \major
- g'1
- \key c \minor
- g'
+\key d \major
+g'1
+\key c \minor
+g'
@end lilypond
@noindent
In this example
@lilypond[quote,notime,fragment]
- \key d \major
- d' cis' fis'
+\key d \major
+d' cis' fis'
@end lilypond
@noindent
no note has an explicit accidental, but you still must enter
@example
- \key d \major
- d cis fis
+\key d \major
+d cis fis
@end example
@noindent
of A-flat major, it does get an accidental
@lilypond[quote,notime,fragment,relative=1,verbatim]
- \key as \major
- d
+\key as \major
+d
@end lilypond
Adding all alterations explicitly might require a little more effort
being tied
@lilypond[quote,notime,fragment,verbatim,relative=3]
- g4~ g a2~ a4
+g4~ g a2~ a4
@end lilypond
For more information on Ties see @ref{Ties}.
Beams are drawn automatically
@lilypond[quote,fragment,relative=2,verbatim]
- a8 ais d es r d
+a8 ais d es r d
@end lilypond
@noindent
with @samp{]}.
@lilypond[quote,fragment,relative=2,verbatim]
- a8[ ais] d[ es r d]
+a8[ ais] d[ es r d]
@end lilypond
For more information on beams, see @ref{Beaming}.
An example of the use of quotes is in the following Mozart fragment
@lilypond[quote,raggedright,fragment,verbatim]
- \key a \major
- \time 6/8
- cis''8. d''16 cis''8 e''4 e''8
- b'8. cis''16 b'8 d''4 d''8
+\key a \major
+\time 6/8
+cis''8. d''16 cis''8 e''4 e''8
+b'8. cis''16 b'8 d''4 d''8
@end lilypond
@noindent
a single note is a music expression
@lilypond[fragment,quote,verbatim,relative=3]
- a4
+a4
@end lilypond
Enclosing group of notes in braces creates a new music
expression
@lilypond[fragment,quote,verbatim,relative=3]
- { a4 g4 }
+{ a4 g4 }
@end lilypond
Putting a bunch of music expressions (notes) in braces, means that
notes
@lilypond[fragment,quote,verbatim,relative=3]
- { { a4 g } f g }
+{ { a4 g } f g }
@end lilypond
This technique is useful for non-monophonic music. To enter music
single character
@lilypond[fragment,quote,verbatim,relative=2]
- c-. c-- c-> c-^ c-+ c-_
+c-. c-- c-> c-^ c-+ c-_
@end lilypond
@cindex fingering
(@samp{-}) and the digit to be printed
@lilypond[fragment,quote,verbatim,relative=2]
- c-3 e-5 b-2 a-1
+c-3 e-5 b-2 a-1
@end lilypond
Articulations and fingerings are usually placed automatically, but you
best to let LilyPond determine the articulation directions.
@lilypond[fragment,quote,verbatim,relative=2]
- c_-^1 d^. f^4_2-> e^-_+
+c_-^1 d^. f^4_2-> e^-_+
@end lilypond
Dynamic signs are made by adding the markings (with a backslash) to
the note
@lilypond[fragment,quote,verbatim,relative=2]
- c\ff c\mf
+c\ff c\mf
@end lilypond
@cindex dynamics
crescendo, or the command @code{\!} can be used
@lilypond[fragment,quote,verbatim,relative=2]
- c2\< c2\ff\> c2 c2\!
+c2\< c2\ff\> c2 c2\!
@end lilypond
@samp{(} and @samp{)}, respectively
@lilypond[fragment,quote,fragment,relative=2,verbatim]
- d4( c16) cis( d e c cis d) e( d4)
+d4( c16) cis( d e c cis d) e( d4)
@end lilypond
@cindex slurs versus ties
nested
@lilypond[quote,fragment,relative=2]
- c2~( c8 fis fis4 ~ fis2 g2)
+c2~( c8 fis fis4 ~ fis2 g2)
@end lilypond
@cindex phrasing slurs
same time.
@lilypond[quote,fragment,relative=2,verbatim]
- a8(\( ais b c) cis2 b'2 a4 cis, c\)
+a8(\( ais b c) cis2 b'2 a4 cis, c\)
@end lilypond
Angle brackets are the symbols @samp{<} and @samp{>}.
@lilypond[quote,relative=1,fragment,verbatim]
- r4 <c e g>4 <c f a>8
+r4 <c e g>4 <c f a>8
@end lilypond
be placed outside the angled brackets
@lilypond[quote,relative=1,fragment,verbatim]
- r4 <c e g>8[ <c f a>]~ <c f a>
+r4 <c e g>8[ <c f a>]~ <c f a>
@end lilypond
@example
- r4 <c e g>8\>( <c e g> <c e g> <c f a>\!)
+r4 <c e g>8\>( <c e g> <c e g> <c f a>\!)
@end example
@lilypond[quote,relative=1,fragment]
- \slurUp
- r4 <c e g>8\>( <c e g> <c e g> <c f a>\!)
+\slurUp
+r4 <c e g>8\>( <c e g> <c e g> <c f a>\!)
@end lilypond
and @code{\partial 8} an eighth note
@lilypond[quote,relative=2,verbatim,fragment]
- \partial 8
- f8 c2 d e
+\partial 8
+f8 c2 d e
@end lilypond
@cindex tuplets
2/3 of their notated duration, so a triplet has 2/3 as its fraction
@lilypond[quote,relative=1,verbatim,fragment]
- \times 2/3 { f8 g a }
- \times 2/3 { c r c }
+\times 2/3 { f8 g a }
+\times 2/3 { c r c }
@end lilypond
@cindex grace notes
@cindex acciaccatura
@lilypond[quote,relative=2,verbatim,fragment]
- c4 \appoggiatura b16 c4
- c4 \acciaccatura b16 c4
+c4 \appoggiatura b16 c4
+c4 \acciaccatura b16 c4
@end lilypond
@noindent
To mark a file for version 2.4.0, use
@example
- \version "2.4.0"
+\version "2.4.0"
@end example
@noindent
Such chords can be entered like notes,
@lilypond[quote,verbatim,raggedright]
- \chordmode { c2 f4. g8 }
+\chordmode { c2 f4. g8 }
@end lilypond
@noindent
following example shows a few common modifiers
@lilypond[quote,verbatim,raggedright]
- \chordmode { c2 f4:m g4:maj7 gis1:dim7 }
+\chordmode { c2 f4:m g4:maj7 gis1:dim7 }
@end lilypond
For lead sheets, chords are not printed on staves, but as names on a
following result.
@lilypond[quote,verbatim,raggedright]
- \chords { c2 f4.:m g4.:maj7 gis8:dim7 }
+\chords { c2 f4.:m g4.:maj7 gis8:dim7 }
@end lilypond
@cindex lead sheet
@code{PianoStaff}
@example
- \new PianoStaff << \new Staff @dots{} >>
+\new PianoStaff << \new Staff @dots{} >>
@end example
Here is a small example
up complex music expressions. An identifier is assigned as follows
@example
- namedMusic = @{ @dots{} @}
+namedMusic = @{ @dots{} @}
@end example
@noindent
input. For example,
@example
- width = 4.5\cm
- name = "Wendy"
- aFivePaper = \paper @{ paperheight = 21.0 \cm @}
+width = 4.5\cm
+name = "Wendy"
+aFivePaper = \paper @{ paperheight = 21.0 \cm @}
@end example
Depending on its contents, the identifier can be used in different
places. The following example uses the above variables
@example
- \paper @{
- \aFivePaper
- linewidth = \width
- @}
- @{ c4^\name @}
+\paper @{
+ \aFivePaper
+ linewidth = \width
+@}
+@{ c4^\name @}
@end example
More information on the possible uses of identifiers is in the
It is convenient to define the notes in a special file. For example,
suppose that the file @file{horn-music.ly} contains the following part
-of a horn/bassoon duo
+of a horn/@/bassoon duo
@example
hornNotes = \relative c @{
in the following output
@lilypond[quote,raggedright]
- \transpose f c' \relative c {
- \time 2/4
- r4 f8 a cis4 f e d
- }
+\transpose f c' \relative c {
+ \time 2/4
+ r4 f8 a cis4 f e d
+}
@end lilypond
In ensemble pieces, one of the voices often does not play for many
takes 3@tie{}measures in 2/4 time
@example
- R2*3
+R2*3
@end example
When printing the part, multi-rests
must be condensed. This is done by setting a run-time variable
@example
- \set Score.skipBars = ##t
+\set Score.skipBars = ##t
@end example
@noindent
leading to
@lilypond[quote,raggedright]
- \relative c <<
- \new Staff {
- \time 2/4 R2*3
- r4 f8 a cis4 f e d
- }
- \new Staff {
- \clef bass
- r4 d,8 f | gis4 c | b bes |
- a8 e f4 | g d | gis f
- }
- >>
+\relative c <<
+ \new Staff {
+ \time 2/4 R2*3
+ r4 f8 a cis4 f e d
+ }
+ \new Staff {
+ \clef bass
+ r4 d,8 f | gis4 c | b bes |
+ a8 e f4 | g d | gis f
+ }
+>>
@end lilypond
More in-depth information on preparing parts and scores can be found