]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/tex/mudela-book-doc.doc
8edaf969c65a7be568b9d6742ee78fac0b5ac5fc
[lilypond.git] / Documentation / tex / mudela-book-doc.doc
1 \documentclass[a4paper, 12pt, oneside]{article}
2
3 \usepackage{t1enc,isolatin1}
4 \usepackage{graphics}
5 %\usepackage{showframe}
6 \sloppy
7 \def\postMudelaExample{}
8 \begin{document}
9 %\printparam
10
11 Mudela-book is a script that process your \LaTeX ~file and
12 with great help from GNU LilyPond
13 translates blocks of mudela code it finds inside \verb|mudela|
14 environment to tex or eps graphics. It then creates a new
15 file that can be sent through \LaTeX~ to create a document with
16 lines of music integrated with text.
17
18 So what does this look like? Well, here is a really
19 simple example:
20
21 \begin{mudela}[fragment, verbatim]
22     \relative c'{c4 d e f | g2 g}
23 \end{mudela}
24
25 As you can see the mudela code is put inside a environment
26 called \verb|mudela|, shouldn't be too difficult to remember.
27 If you have never heard about \LaTeX, Mudela or that stuff 
28 about environment, you should probably read some other manuals
29 before this.
30
31 The code above produces this music:
32
33 \begin{mudela}[fragment]
34     \relative c' {c4 d e f | g2 g }
35 \end{mudela}
36
37 The parameter \verb|fragment| means that mudela-book will insert
38 some red tape for you. There are one thing to remember. Currently
39 \verb|fragment|s don't know about margins and line width, so if 
40 you type more than a few bars and want a line break, you can not
41 use \verb|fragment|. The \verb|verbatim| parameter is used to
42 make mudela-book print the mudela source instead of the
43 music. The parameter will probably not be visible in later versions
44 of mudela-book.
45
46 There are some conventions to follow to make the music respect 
47 margins. You have to use \verb|\default_paper| as your paper, 
48 to make mudela-book adjust the music to reach from the 
49 left to the right margin.
50
51 The following code
52 \begin{mudela}[verbatim]
53 \score{
54     \notes\relative c'{c d e f | g2 g | a4 a a a | g1 |
55          f4 f f f | e2 e | d4 d d d | c1}
56     \paper{}
57 }
58 \end{mudela}
59 gives this music:
60 \begin{mudela}
61 \score{
62     \notes\relative c'{c d e f | g2 g | a4 a a a | g1 |
63          f4 f f f | e2 e | d4 d d d | c1}
64     \paper{}
65 }
66 \end{mudela}
67
68 On my Debian 2.0 with LilyPond 1.0.17, teTex 0.9,
69 a4 paper and default line widht, the music is printet with
70 7 bars on the first line and 1 bars on the second.
71
72 This does not look to well, but you can fix it by setting
73 the \verb|linewidth| variable to, let's say 8 cm. The paper
74 definition
75 \begin{verbatim}
76 \paper{
77 linewidth=8.\cm;}
78 \end{verbatim}
79 makes this score:
80
81 \begin{mudela}
82 \score{
83     \notes\relative c'{c d e f | g2 g | a4 a a a | g1 |
84          f4 f f f | e2 e | d4 d d d | c1}
85     \paper{
86            linewidth=8.\cm;}
87 }
88 \end{mudela}
89
90 The \verb|linewidth| variable is a LilyPond paper variable.
91 It is not spesific to mudela-book. See LilyPond tutorial and
92 reference manual for other variables.
93
94 You can also,
95 \begin{mudela}[fragment, floating]
96   \relative c'{c c g' g | a a g2}
97 \end{mudela} 
98 , include music in the middle of your text. Just give the option
99 \verb|floating| to \verb|\begin{mudela}|
100
101 Oh, you think the notes are to big to be in the middle of all those
102 small characters, that something like this,
103 \begin{mudela}[fragment, floating, 11pt]
104   \relative c'{c c g' g | a a g2}
105 \end{mudela}
106 , is better? If you have a lot of small music examples like this
107 in the middle of your text, you might get a nicer look by using
108 ``double'' line spacing. Put the \verb|\linespread{1.6}| command
109 into the preamble of your document. Then the line spacing will not
110 be increased between the lines where you have music printed with the
111 smalles font size.
112
113
114 To change font size is easy, just give the fontsize as a parameter to
115 \verb|\begin{mudela}|. The last piece of music was created with this
116 code:
117 \begin{mudela}[fragment, floating, 11pt, verbatim]
118   \relative c'{c c g' g | a a g2}
119 \end{mudela}
120
121 You can use the following font sizes:
122 \begin{itemize}
123 \item 11 pt
124 \begin{mudela}[11pt, fragment, floating]
125   \relative c'{
126     r16 [c d e][f d e c] [g'8 c][b-\prall c] |
127     [d16 g, a b][c a b g][d'8 g f-\prall g]
128   }
129 \end{mudela}
130 \item 13 pt
131 \begin{mudela}[13pt, fragment, floating]
132   \relative c'{
133     r16 [c d e][f d e c] [g'8 c][b-\prall c] |
134     [d16 g, a b][c a b g][d'8 g f-\prall g]
135   }
136 \end{mudela}
137 \item 16 pt
138 \begin{mudela}[16pt, fragment, floating]
139   \relative c'{
140     r16 [c d e][f d e c] [g'8 c][b-\prall c] |
141     [d16 g, a b][c a b g][d'8 g f-\prall g]
142   }
143 \end{mudela}
144 \item 20 pt
145 \begin{mudela}[20pt, fragment, floating]
146   \relative c'{
147     r16 [c d e][f d e c] [g'8 c][b-\prall c] |
148     [d16 g, a b][c a b g][d'8 g f-\prall g]
149   }
150 \end{mudela}
151 \item 26 pt
152 \begin{mudela}[26pt, fragment, floating]
153   \relative c'{
154     r16 [c d e][f d e c] [g'8 c][b-\prall c] |
155     [d16 g, a b][c a b g][d'8 g f-\prall g]
156   }
157 \end{mudela}
158 \end{itemize}
159
160 As\marginpar{
161 marginpar!
162 \begin{mudela}[11pt, fragment, floating]
163         \relative c''{\key es; r8 [g g g] es2}
164 \end{mudela}
165 }
166 you can see, \verb|floating| mudela don't know about margins.
167 Remember that to place the music anywhere\footnote{
168 footnote!
169 \begin{mudela}[11pt, fragment, floating]
170         \relative c''{\key es; r8 [g g g] es2}
171 \end{mudela}
172 }
173  else than at the left margin you must use the option \verb|floating|.
174
175 \twocolumn[\Large The following is written in two columns \normalsize]
176 Sinse the version number is quite low, 0.4.0 last I checked, you
177 should be careful not to mix braces that belongs to mudela-book and
178 \LaTeX ~on the same line. The following code will probably break:
179
180 \verb|\footnote{\be|\verb|gin{mudela}|
181
182 \verb|\relative c''{ \key es; r8 [g g g] es2} |
183
184 \verb|\e|\verb|nd{mudela}}|
185
186 Mudela-book does know about \verb|\onecolumn| and \verb|\twocolumn|. 
187 So the music will be adjusted to the new linewith:
188 \begin{mudela}[verbatim]
189 \score{
190     \notes\relative c'{c d e f | g2 g | a4 a a a | g1 |
191          f4 f f f | e2 e | d4 d d d | c1}
192     \paper{}
193 }
194 \end{mudela}
195 produces
196 \begin{mudela}
197 \score{
198     \notes\relative c'{c d e f | g2 g | a4 a a a | g1 |
199          f4 f f f | e2 e | d4 d d d | c1}
200     \paper{}
201 }
202 \end{mudela}
203
204 As in one column mode, \verb|fragment|s don't know about 
205 the line width:
206 \begin{mudela}[fragment]
207   \relative c'{[c8 e][d f][e g][f a] | [g b][a c][b d] c4 |
208         [e8 c][d b][c a][b g] | [a f][g e][f d] c4 }
209 \end{mudela}
210 Verbatim environments will also ignore the page margins. That is
211 a feature of \LaTeX.
212 \end{document}