3 % this document should be run through the mudela-book script after lilypond
4 % has been installed. The rules have been precooked into the
5 % Documentation/Rules.make file; do
7 % make out/introduction.dvi
11 % mudela-book --outdir=out/ --outname=introduction.mudtex introduction.doc
12 % latex '\nonstopmode \input out/introduction.mudtex'
14 % Hoi Tim, hier staan wat 'enge' commando's (die dingen met een '\'
15 % zoals \documentclass en \def\mudela...).
16 % Daar moet je je niets van aantrekken, ga gewoon naar Introduction
19 \documentclass{article}
21 \title{Introduction to GNU LilyPond}
22 \author{Jan Nieuwenhuizen}
25 \def\file#1{\verb+#1+}
27 % ugh: trick to get examples not generate par
29 \def\mudelapaperlinewidth{-28.452756}%
30 \def\mudelapaperindent{28.452756}%
31 \def\mudelapaperrulethickness{0.400000}%
32 \def\mudelapaperbarsize{16.000000}%
33 \def\mudelapaperinterline{4.000000}%
34 \def\mudelapapernotewidth{5.930000}%
35 \def\mudelapaperwholewidth{8.640000}%
36 \def\mudelapaperunitspace{22.000000}%
37 \def\mudelapaperbasicspace{4.000000}%
38 \def\mudelapapergeometric{0.000000}%
39 \def\mudelapaperarithmetic_basicspace{2.000000}%
40 \def\mudelapaperarithmetic_multiplier{4.800000}%
41 \def\mudelapaperinterbeam{3.140000}%
42 \def\mudelapapergourlay_energybound{100000.000000}%
43 \def\mudelapapergourlay_maxmeasures{14.000000}%
45 % \def\exampleheight{2\mudelapaperbarsize pt}
46 \def\exampleheight{2cm}
48 % ful of pars, needs the above
52 \def\musixsixteendefs{}
55 \def\turnOnPostScript{}
63 %\def\interexample{\hskip15mm$\Longrightarrow$\hskip15mm}
64 %\def\interexample{\hbox to10mm{\hfill\hbox to0pt{\hss\vbox to\exampleheight{\vss$\Longrightarrow$\vss}\hss}\hfill}}
67 \def\postexample{\par\medskip}
69 \def\file#1{{\texttt{#1}}}
70 \setcounter{secnumdepth}{-1}
72 \emph{\Large ***Under construction***}
74 \section{Introduction}
75 This document should provide a gentle introduction to
76 LilyPond's input language, Mudela.
77 For completeness and nifty features see
80 \file{lily/parser.y}, \file{lily/lexer.l}.
81 By tradition, Mudela files have the extension \file{.ly}.
83 Mudela is an ascii script language
84 that is especially designed
85 to be easy to read and write.
86 In the following sections
87 the basic elements of Mudela are presented
88 in a series of simple examples.
90 a verbatim snippet of Mudela%
91 % a snippet of Mudela as it's typed-in%
93 In an effort not to bore you too much with details,
94 we leave-out some red tape
95 that's needed for a valid piece of Mudela.
96 Therefore, before you try-out any of the examples,
97 be sure to read the section `A complete example'.}
99 and the resulting fragment of music on the right
100 as it was produced by LilyPond.
104 Let's start with a single note, a quarter C
106 \begin[fragment,verbatim,center]{mudela}
110 Now that was easy and entering a scale is not much harder
112 %\subsection{Pitches}
114 \begin[fragment,verbatim,center]{mudela}
118 % \subsection{Durations}
120 However, having only quarter notes may get a bit dull.
121 Durations are entered as their reciproce values
122 % a1 a2 a4 a a8 a a16 a a32 a a64 a a a a
123 \begin[fragment,verbatim,center]{mudela}
124 a1 a2 a4 a a8 a a16 a32 a64
126 note that you only have to specify
127 the duration when it changes:
128 Lily assumes a note has the same duration as the previous one.
130 Now we can already write a little tune
131 \begin[fragment,verbatim,center]{mudela}
132 c d e c | c d e c | e f g2
134 As you'll probably have guessed,
135 the vertical bar (pipe) \verb+|+ may be used to mark
138 In the scale shown above
139 we left-out the last c note of the next octave.
140 Postfixing the pitch with a quote \verb+'+
141 produces a note by one octave higher
142 \begin[fragment,verbatim,center]{mudela}
146 Prefixing the pitch with a quote \verb+'+
147 produces a note by one octave lower
148 \begin[fragment,verbatim,center]{mudela}
152 \section{Slurs and Ties}
154 A tie connects two adjacent noteheads
156 \begin[fragment,verbatim,center]{mudela}
160 Whereas a slur rather connects `chords',
161 and tries to avoid crossing stems
163 \begin[fragment,verbatim,center]{mudela}
167 And of course, such a (legato) slur can span several notes
168 \begin[fragment,verbatim,center]{mudela}
172 \section{Beams and Plets}
175 \begin[fragment,verbatim,center]{mudela}
179 Here's a beamed triplet
180 \begin[fragment,verbatim,center]{mudela}
184 a triplet without a beam
185 \begin[fragment,verbatim,center]{mudela}
190 \begin[fragment,verbatim,center]{mudela}
195 \begin[fragment,verbatim,center]{mudela}
199 \begin[fragment,verbatim,center]{mudela}
205 Lily has predefined sets of notenames
206 for various languages%
207 \footnote{These are Dutch, English, German, Italian and Swedish.
208 Simply include the language specific init file \file{<language.ly>}.}.
209 The default set are the ones we like best are the Dutch notenames.
211 A sharp is formed by adding \verb+is+
212 \begin[fragment,verbatim,center]{mudela}
213 cis dis eis fis gis ais bis
216 and a flat is formed by adding \verb+es+%
217 %\footnote{Exceptions: \verb+es+ and \verb+as+.}
218 \footnote{Exceptions: {\tt es} and {\tt as}.}
219 \begin[fragment,verbatim,center]{mudela}
220 ces des es fes ges as bes
223 With the obvious names for double sharps
224 \begin[fragment,verbatim,center]{mudela}
225 cisis disis eisis fisis gisis aisis bisis
229 \begin[fragment,verbatim,center]{mudela}
230 ceses deses eses feses geses ases beses
234 There are two special `notenames', the rest
235 \begin[fragment,verbatim,center]{mudela}
240 \begin[fragment,verbatim,center]{mudela}
241 a2 s-"diminuendo" | a
247 \begin[fragment,verbatim,center]{mudela}
252 \begin[fragment,verbatim,center]{mudela}
253 \clef "violin"; f' e' \clef "alto"; d' c'
256 \begin[fragment,verbatim,center]{mudela}
260 \begin[fragment,verbatim,center]{mudela}
262 'g 'a 'b cis d e fis g'
264 Note how Mudela allows you to
265 convey a musical message
266 rather than forces you to produce a list of typesetting commands.
267 If the music a \verb+cis+, you type a \verb+cis+.
268 Depending on the key and context of the note
269 Lily will determine what accidentals to typeset.
271 A reminder accidental can be forced by
272 using an exclamation mark \verb+!+
273 on a pitch a reminder accidental
274 \begin[fragment,verbatim,center]{mudela}
275 cis d e cis | c! d e c |
278 \begin[fragment,verbatim,center]{mudela}
280 \bar "|:"; c c \bar ":|:"; c c \bar ":|"; c c \bar "|.";
285 Staccato may be abbreviated
286 \begin[fragment,verbatim,center]{mudela}
291 \begin[fragment,verbatim,center]{mudela}
296 \begin[fragment,verbatim,center]{mudela}
303 \begin[fragment,verbatim,center]{mudela}
307 \begin[fragment,verbatim,center]{mudela}
311 \begin[fragment,verbatim,center]{mudela}
315 Dynamics from pianississimo upto mezzopiano
316 \begin[fragment,verbatim,center]{mudela}
320 from fortississimo downto mezzoforte
321 \begin[fragment,verbatim,center]{mudela}
325 sforzando, sforzato and rinforzato
328 \begin[fragment,verbatim,center]{mudela}
333 \begin[fragment,verbatim,center]{mudela}
334 [e8-1 c'-5 g-3 f-2] a''-\flageolet
338 \begin[fragment,verbatim,center]{mudela}
343 \begin[fragment,verbatim,center]{mudela}
344 \clef "bass"; \octave c;
345 'b4.-\lheel [cis8-\ltoe dis8-\rtoe e8-\rheel]
348 \section{Chords and Voices}
350 Here's a simple chord
351 \begin[fragment,verbatim,center]{mudela}
356 \begin[fragment,verbatim,center]{mudela}
365 \begin[fragment,verbatim,center]{mudela}
367 { \voiceone c g c g }
368 { \voicetwo 'c2 'g2 }
373 \section{A complete example}
376 A Mudela file needs some red tape
378 \begin[verbatim,center]{mudela}
391 \begin[verbatim,center]{mudela}
414 Check-out this handy little script
415 that not only may save you quite some keystrokes,
416 but produces titles and takes care of
417 margins and (hopefully) papersizes.
418 See \file{ly2dvi (1)}.