3 @c TODO: LilyPond Lilypond lilypond
8 The music is described in a text file, using a simple music language.
9 LilyPond reads that text file and generates music that you can print or
12 Therefore, creating music notation with LilyPond is done in two steps.
13 Using a text editor, you write down the notes to print. Then, you run
14 LilyPond to get your printed output.
17 This tutorial starts with a small introduction to the LilyPond music
18 language. After this first contact, we will show you how to produce
19 printed output; you should then be able to create your first sheets of
22 The tutorial continues with a bit more elaborate example of real music.
23 This piece introduces and explains some finer details of LilyPond.
24 Then, a number of more complex examples follow, that will help you to
25 produce most complex music with LilyPond.
29 * Music language of LilyPond:: First contact
30 * Running LilyPond toet::
35 @node Music language of LilyPond
36 @section Music language of LilyPond
38 This section shows how easy making music with LilyPond actually is. If
39 you have not used LilyPond before, this section is for you.
42 You get a simple note by typing its name, from @code{a} through @code{g}:
44 @lilypond[verbatim, relative 1]
50 A are sharp is made by adding @code{is}, a flat by adding @code{es}:
52 @lilypond[verbatim, relative 0]
58 The length of a note is specified by adding a number, @code{1} for a
59 whole note, @code{2} for a halve note:
61 @lilypond[verbatim, relative 1]
62 a1 a2 a8 a4 a16 a8. a16
67 Adding a high quote @code{'}, raises the pitch by one octave, adding a
68 ``low quote'' @code{,} (a comma), lowers the pitch one octave:
70 @lilypond[verbatim, relative 1]
76 If you type no octaviation quotes, LilyPond chooses the note that is
77 closest to the previous one, which is often just the one you need. For
78 example, @code{c f} goes up, and @code{c g} goes down:
80 @lilypond[verbatim, relative 1]
86 You can make a large interval by adding octaviation quotes. For example,
87 @code{c f,} goes down, and @code{c g'} goes up:
89 @lilypond[verbatim, relative 1]
95 To get a rest you use note name @code{r}, to skip a note use note name
98 @lilypond[verbatim, relative 1]
104 The meter can be specified using @code{\time}:
107 @lilypond[verbatim, relative 1]
108 \time 3/4 c c c | R1 * 3/4
113 The key is specified using @code{\key}:
115 @lilypond[verbatim, relative 0]
116 \key f \major es as bes
121 Slurs are printed using parenthesis @code{()}, for phrasing slurs use
122 @code{\(} and @code{\)}. You get a tie using @code{~}:
124 @lilypond[verbatim, relative 1]
130 A chord is made using angle brackets @code{<} and @code{>}:
132 @lilypond[verbatim, relative 1]
133 \oneVoice <a c> <b d> <c e>
138 suddenly lilypond bit really difficult:
139 [explain about score -> \score and \notes]
141 long chords; simultaneous music
143 \paper { linewidth = -1.0 }
145 \context Staff \notes \relative c'' <
155 \paper { linewidth = -1.0 }
157 \context GrandStaff \notes \relative c' <
158 \context Staff=one { a' b c }
159 \context Staff=two { \clef bass c,, d e }
165 @node Running LilyPond toet
166 @section Running LilyPond toet
168 This section shows how to view and print music with LilyPond. If you
169 want to test your setup of LilyPond, or try to run an example file
170 yourself, then read this section.
172 The first step is to create an text file with some music. Using your
173 favorite text-editor, create @file{test.ly} containing
177 NOTE: if you're reading this, ie, the Texinfo source itself, test.ly
178 should of course contain:
188 \notes @{ c'4 e' g' @}
192 @unnumberedsubsec Running LilyPond on Unix
193 @cindex Unix, Running lilypond on
196 To run LilyPond, you invoke ly2dvi to compile your LilyPond source file:
204 You will see the following on your screen:
209 Now processing: `/home/fred/ly/test.ly'
211 Interpreting music...[1]
212 @emph{ ... some more text ... }
213 PS output to test.ps...
214 DVI output to test.dvi...
218 The results are a ``DeVice Independent'' file
219 (@file{test.dvi}) and a PostScript file (@file{test.ps}).
223 @cindex Viewing music
227 To view the @code{test.dvi} output, run Xdvi:
235 @c FIXME: should we say anything on xdvi-gs interaction?
237 You should see the following in your main Xdvi window:
244 When you're satisfied with the result, you can print the
252 If this does not make your printer produce a page of music, you should
253 look into installing and configuring ghostscript. Refer to
254 GhostScript's website at @uref{http://www.ghostscript.com}.
257 @cindex Printing output
263 @unnumberedsubsec Running LilyPond on Windows
266 On windows, you open a LilyPond shell, and then you invoke ly2dvi
267 compile your LilyPond source file, just like on Unix:
274 You will see the following on your screen:
276 @c FIXME: leave this out, just refer to unix section?
277 @c FIXME: commands run in dos shell: we can't redirect output
281 Now processing: `/home/tim/ly/test.ly'
283 Interpreting music...[1]
284 @emph{ ... some more text ... }
285 PS output to test.ps...
286 DVI output to test.dvi...
290 To view the @code{test.dvi} output, run Yap
297 You should see the following in your Yap window
304 @c FIXME: talk about newer Yap versions, proper gs installation?
305 When you're satisfied with the result, you can print from within Yap
306 (File/Print). Note that Yap may not display embedded PostScript symbols
307 such as beams and slurs. Don't worry, they'll be printed anyway.
309 You can also print the PostScript file directly from the
310 command line using GSview: