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