1 \input texinfo @c -*-texinfo-*-
2 @setfilename mudela-book.info
3 @settitle mudela-book Manual
6 @title mudela-book Manual
7 @subtitle Integrating mudela with La@TeX{} and TeXinfo
8 @author Tom Cato Amundsen and Han-Wen Nienhuys
10 Copyright @copyright{} 1999 by the authors
12 @vskip 0pt plus 1filll
14 Permission is granted to make and distribute verbatim
15 copies of this manual provided the copyright notice and
16 this permission notice are preserved on all copies.
18 Permission is granted to copy and distribute modified
19 versions of this manual under the conditions for
20 verbatim copying, provided also that the sections
21 entitled ``Copying'' and ``GNU General Public License''
22 are included exactly as in the original, and provided
23 that the entire resulting derived work is distributed
24 under the terms of a permission notice identical to this
27 Permission is granted to copy and distribute
28 translations of this manual into another language,
29 under the above conditions for modified versions,
30 except that this permission notice may be stated in a
31 translation approved by the Free Software Foundation.
36 This file documents GNU LilyPond.
38 Copyright 1999 Tom Cato Amundsen and Han-Wen Nienhuys
41 Permission is granted to make and distribute verbatim
42 copies of this manual provided the copyright notice and
43 this permission notice are preserved on all copies.
46 Permission is granted to process this file through TeX
47 and print the results, provided the printed document
48 carries a copying permission notice identical to this
49 one except for the removal of this paragraph (this
50 paragraph not being relevant to the printed manual).
54 Permission is granted to copy and distribute modified
55 versions of this manual under the conditions for
56 verbatim copying, provided also that the sections
57 entitled ``Copying'' and ``GNU General Public License''
58 are included exactly as in the original, and provided
59 that the entire resulting derived work is distributed
60 under the terms of a permission notice identical to this
63 Permission is granted to copy and distribute
64 translations of this manual into another language,
65 under the above conditions for modified versions,
66 except that this permission notice may be stated in a
67 translation approved by the Free Software Foundation.
71 \def\preMudelaExample{\vspace{0.5cm}}
82 [TODO: THIS MANUAL IS NOT FINISHED YET. FIXME.]
85 Mudela-book is a script that process your La@TeX{} file and with great
86 help from GNU LilyPond it translates blocks of mudela code it finds
87 inside @code{mudela} environments to tex or eps graphics. It then
88 creates a new file that can be sent through La@TeX{} to create a
89 @file{.dvi} file with lines of music integrated with text.
91 Mudela-book will do its best to try to align the music to the left and
92 right margins. Currently the most used papersizes and one- and
93 twocolumn mode is supported, but if you use the geometry-package from
94 La@TeX{} or change the margins things will break.
96 This document assumes you have basic knowledge of GNU LilyPond and
99 So what does this look like? Well, here is an example:
100 @mudela[veryverbatim, intertext="produces this music:"]
104 [e16( g b c a g][e a b d] | )e2 d,8 |
105 [e16( g b c a g][e a b d] | )b2 [a16( f] |
106 [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
107 [f( a b d b a][f a b d] | )e2
111 If you are lucky, the above example show a nice feature of LilyPond
112 and La@TeX{}. Since LilyPond can output the music as @TeX{} graphics,
113 La@TeX{} can insert pagebreaks between the lines of music.
115 Notice that there is no @code{\paper} statement in the example
116 above. Mudela-book will insert some code for you that defines the
117 linewidth and the font to use. If you don't want to change the default,
118 there is no need to put an empty @code{\paper@{@}} inside the @code{\score}.
119 In the example above, something like
120 this might be inserted before your code:
122 \include "paper16.ly"
123 \paper@{ \paper_sixteen
125 castingalgorithm = \Gourlay;
128 The actual values for linewidth will differ depending on papersize and
129 number of columns. Also, if you use a different fontsize for the
130 music, another file than @code{paper16.ly} will be included.
132 If you want to make the music not so wide, you can insert a
133 @code{\paper} statement that set the linewidth:
135 @mudela[veryverbatim, intertext="produces this music:"]
139 [e16( g b c a g][e a b d] | )e2 d,8 |
140 [e16( g b c a g][e a b d] | )b2 [a16( f] |
141 [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
142 [f( a b d b a][f a b d] | )e2
144 \paper{linewidth = 10.\cm;}
148 Very often, if you mix music and text, the music is often only a
149 few notes or at most a few bars. This music should be as short as
150 possible and not stretched to be aligned to the right margin.
152 If you only write voice-contents in the mudela block, mudela-book
153 will set the @code{linewidth} variable to -1, so Lilypond
154 will make the music as short as possible but without breaking the
155 line. Here is a well know harmonic progression:
156 @mudela[veryverbatim, intertext="produce a well known harmonic progression:"]
157 \context Voice { <c' e g> <b d g> <c2 e g> }
160 If you want to place music examples in the text,
162 \context Voice { <c' e g> <b d g> <c2 e g>}
164 , you can use the @code{eps} option. This will create the music as
165 eps graphics and include it into the document with the
166 @code{\includegraphics} command.
168 The code used look like this:
171 \context Voice { <c' e g> <b d g> <c2 e g> }
175 You can also use the @code{eps} option if the block is a complete
176 mudela source. This 5 cm long empty line,
180 \paper{ linewidth = 5.\cm;}
183 was created with this code:
188 \paper@{ linewidth = 5.\cm;@}
193 To avoid that La@TeX{} places the music on a line of its one, there should
194 be no empty lines between the normal text and the mudela
197 You can also use @code{mudelafile} (on a separate line, FIXME), to
198 include another file.
200 @section Fontsize options You can use all lilypond fontsizes in
201 mudela-book. The default 16pt fontsize is probably to big to be
202 included in the middle of the text, 11pt or 13pt is probably better.
204 The code can look like this:
211 The following options set the fontsize:
216 r16 [c d e][f d e c] [g'8 c][b-\prall c] |
217 [d16 g, a b][c a b g][d'8 g f-\prall g]
223 r16 [c d e][f d e c] [g'8 c][b-\prall c] |
224 [d16 g, a b][c a b g][d'8 g f-\prall g]
230 r16 [c d e][f d e c] [g'8 c][b-\prall c] |
231 [d16 g, a b][c a b g][d'8 g f-\prall g]
237 r16 [c d e][f d e c] [g'8 c][b-\prall c] |
238 [d16 g, a b][c a b g][d'8 g f-\prall g]
244 r16 [c d e][f d e c] [g'8 c][b-\prall c] |
245 [d16 g, a b][c a b g][d'8 g f-\prall g]
251 @section More options
253 @item The @code{singleline} option set @code{linewidth} to -1.0.
254 @item The @code{multiline} option set @code{linewidth} to a value letting
255 the music be aligned to the right margin. The music can span several
259 @section Just in case...
260 The options @code{fragment} and @code{nonfragment} will override
261 mudela-book when it scans the mudela code to see if it is voice
262 contents or complete code. This might be useful if mudela-book choose
265 Since there is no finder's fee which doubles every year, there is no
266 need to wait for the price money to grow. So send a bug report today
267 if you need this one of these options.
271 This was all options to @code{\begin}. The rest of the mudela
272 document will show some ways you can use mudela in
273 La@TeX{} documents. It will also act as a simple test-suite for
274 mudela-book. You can place @code{eps} mudela in and marginspars just
275 as any other included eps graphics.
281 r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
282 [f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata |
284 r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata
286 \paper{linewidth = 7.\cm;}
291 To the right you can see some bars from the trumpet fanfara from the
292 beginning of the fantastic street opera ``Houdini the Great'', by the
293 Danish composer Andy Pape. The music is put inside a
294 @code{floatingfigure} environment, and the music will be aligned by
295 the right marging if you set floatingfigure width and mudela linewidth
296 to the same value. The code looks like this:
302 r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
303 [f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata |
305 r4.-\fermata [cis,16 cis g'8 f16 f b8]
306 [g16 g f8 b16 b] dis4.-\fermata
308 \paper{linewidth = 7.\cm;}
312 If you have a lot of small music examples like this in the middle of
313 your text, you might get a nicer look by using ``double'' line
314 spacing. Put the @code{\linespread@{1.6@}} command into the preamble of
315 your document. Then the line spacing will not be increased between the
316 lines where you have music printed with the smallest font size.
318 Mudela-book does know about @code{\onecolumn} and @code{\twocolumn}.
319 So the music will be adjusted to the new linewith:
321 Verbatim environments will also ignore the page margins. That is
322 a feature of La@TeX{}. (But you usually put things inside a verbatim
323 environment when you don't want La@TeX{} to do any linebreaking)
326 @section Texinfo behavior
332 @file{mudela-book} is a script that helps integrating mudela and
333 La@TeX{}. mudela-book runs LilyPond on fragments of mudela in your
334 source file, and includes the results into document that can be
335 processed with La@TeX{}. The result is a text document with formatted
338 Lilypond will by default create all output files in directory @file{out}.
339 The file to give to latex has ext @file{.latex}.
341 @strong{About the input}
343 If the file contains the ``block''
353 then LilyPond is run on CONTENTS. mudela-book puts the result back,
354 surrounded by @code{\preMudelaExample} and @code{\postMudelaExample}
355 commands. @code{\preMudelaExample} and @code{posMudelaExample} is
356 defined to nothing by default, and the user can redefine them
357 to whatever he wants.
359 @code{\begin} takes the following options:
363 @subsection Command line options
368 Specify the document type to process, @code{latex} or @code{texi}.
369 @file{mudela-book} usually figure out this automatically.
370 @item --default-music-fontsize=??pt
371 Set the fontsize to use for mudela if no fontsize is given
373 @item --force-music-fontsize=??pt
374 Force all mudela to use this fontsize, overriding options
375 given to \begin@{mudela@}
376 @item -I DIR, --include=DIR
378 @item -M, --dependencies
379 Write dependencies to out-www/filename.dep
380 @item --dep-prefix=PREF
381 prepend PREF before each -M dependency
385 don't generate pictures
387 don't write ly files. This way you can do
389 mudela-book file.tely
391 mudela-book --read-lys
394 The name of La@TeX{} file to output. If this option is not given,
395 the output name derived from the input name.
397 where to place generated files
399 print version information
401 Print a short help message
406 @file{mudela-book} is written in python 1.5, so you have to install
407 @uref{http://www.python.org,python}.
413 The La@TeX{} \includeonly@{...@} command is ignored.
415 Ignores almost all La@TeX{} commands that changes margins and linewidths.
417 La@TeX{} comments can confuse mudela-book:
419 % this music will be displayed: \mudela@{c d e@}
424 @email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}, @uref{http://www.cs.uu.nl/people/hanwen}
426 @email{tca@@gnu.org, Tom Cato Amundsen}