document that can be processed with LaTeX. The result is a text
document with formatted music integrated.
-Lilypond will create a directory to put temporary files, the default
-dir name is file(out). When you run mudela on a file, like this:
-
-verb(mudelab-book myfile.tex)
-
-the a file file(out/myfile.latex) will be created. And to create
-the file(.dvi) file you should type:
-
-verb(latex out/myfile.latex)
-
-This will create file(myfile.dvi) in the current directory. Bad things
-will happen if you cd to file(out) and then runs verb(latex myfile.latex)
+Lilypond will by default create all output files in directory file(out).
+The file to give to latex has ext file(.latex).
bf(About the input)
code(\begin) takes the following options:
description(
-dit(floating)
- the created graphics can be inserted in the middle of a text line,
- not only as a separate paragraph
-dit(fragment)
- mudela-book adds some redtape. You
- can substitute voice-contents for CONTENTS in this case.
+dit(eps)
+ the music is created as eps graphics that can be inserted in
+ the middle of a text line, not only as a separate paragraph
dit(verbatim)
CONTENTS is copied into the TeX source enclosed in a verbatim block.
dit(11pt, 13pt, 16pt, 20pt, 26pt)
set the fontsize to use for the music
+dit(fragment)
+dit(nonfragment)
+ Override mudela-book autodetection of what type of code is in the
+ mudela block, voice contents or complete code.
)
startdit()
-dit(--mudela-fontsize)
+dit(--default-mudela-fontsize=??pt)
Set the fontsize to use for mudela if no fontsize is given
as option.
-dit(--force-mudela-fontsize)
+dit(--force-mudela-fontsize=??pt)
Force all mudela to use this fontsize, overriding options
given to \begin{mudela}
-dit(--outname)
+dit(--outname=FILE)
The name of LaTeX() file to output. If this option is not given,
the output name derived from the input name.
-dit(--outdir)
+dit(--outdir=DIRECTORY)
The directory to output lilypond output and input to.
dit(--help)
Print a short help message
Write dependencies to outdir/filename.dep
dit(--force-verbatim)
Make all mudela verbatim.
+dit(--initfile=FILE)
+ read command definitions from file(FILE)
enddit()
manpagefiles()
- You have to install LaTeX. file(mudela-book) is not tested on LaTeX 2.09
- and will probably fail on something else than LaTeX2e.
-
+ See file(Documentation/tex/out/mudela-book-doc.dvi) for more info.
+ You have to install LaTeX.
file(mudela-book) is written in python 1.5, so you have to install
url(python)(http://www.python.org).
music in \footnote{...} or \marginpar{...}.
Ignores almost all LaTeX commands that changes margins and linewidths.
-
+
+file(\begin{verbatim}) is ignored.
manpageauthor()
nemail(Han-Wen Nienhuys)(hanwen@cs.uu.nl), lurl(http://www.cs.uu.nl/people/hanwen)
\maketitle
%\printparam
+\section{Introduction}
+
Mudela-book is a script that process your \LaTeX~file and with great
help from GNU LilyPond it translates blocks of mudela code it finds
inside \verb|mudela| environments to tex or eps graphics. It then
be no empty lines between the normal text and the mudela
environment.
-There is an even shorter way to write small musical fragments. This
-triad, \mudela{<c' e' g'>}, was created with this code:
-\verb|\mudela{<c' e' g'>}|
-
-Mudela-book let you define your own commands, see the file
-\verb|mudela-book-defs.py|. In a later version, it will be possible to
-have your own file that defines new commands. To print small rhythms
-like this, \mudelaRhythm{c4 r8 [c16 c] c4 c}, the default
-\verb|mudela-book-defs.py| also defines a command \verb|mudelaRhythm|.
-The last music was created like this:
-\verb|\mudelaRhytm{c4 r8 [c16 c] c4 c}|. This feature is higly
-experimental, so Things Will Change.
-
-The last example show that we need options to change the
+\section{Fontsize options}
+You can use all lilypond fontsizes in mudela-book.
% LONG line just to test multiple mudela on one line
-fontsize of the music. 11pt, \mudela[11pt]{<c' e' g'>} or 13pt, \mudela[13pt]{<c' e' g'>} is probably a better fontsize
-if you include music in the middle of the text. The code looks like this:
-\verb|\mudela[11pt]{<c' e' g'>}|
-
-or
-\begin{mudela}[13pt, verbatim]
+The default 16pt fontsize, \mudela{<c' e' g'>}, is probably to big to be included in the middle of the text. 11pt, \mudela[11pt]{<c' e' g'>} or 13pt, \mudela[13pt]{<c' e' g'>} is probably better.
+The code can look like this:
+\begin{mudela}[13pt, eps, verbatim]
<c' e' g'>
\end{mudela}
\end{mudela}
\end{itemize}
+\section{User defined commands}
+There is an even shorter way to write small musical fragments. This
+triad, \mudela{<c' e' g'>}, was created with this code:
+\verb|\mudela{<c' e' g'>}|
+
+Mudela-book defines the \verb|\mudela| command, and let you define
+your own commands in a file specified by
+the command line option \verb|--initfile=filename|. The format for the
+file is a definition of a python dictionary:
+% mudela-book should really respect \begin{verbatim}
+
+\verb|{ 'mudela': r"""|
+
+\verb|\begin|\verb|{mudela}[eps \fontoptions]|
+
+\verb| \maininput|
+
+\verb|\end|\verb|{mudela}|
+
+\verb|""",|
+
+\verb| 'mudelaRhythm': r"""|
+
+\verb|\begin|\verb|{mudela}[eps \fontoptions]|
+\begin{verbatim}
+\score{
+ \type RhythmicStaff{
+ \notes{\stemup \maininput}
+ }
+ \paper{linewidth = -1.\cm;}
+}
+\end{verbatim}
+\verb|\end|\verb|{mudela}|
+
+\verb|"""|
+
+\verb|}|
+
+The above code show how \verb|\mudela| could have been defined, and
+also defines a new command \verb|mudelaRhythm|. Notice that you can
+send fontsize options to the defined commands.
+\verb|\mudelaRhytm[11pt]{c4 c8 [c16 c] c4 c}| produce this music:
+\begin{mudela}[eps, 11pt]
+\score{
+ \type RhythmicStaff{
+ \notes{ \stemup c4 r8 [c16 c] c4 c }
+ }
+ \paper{linewidth = -1.\cm;}
+}
+\end{mudela}
+
+\section{Just in case...}
+The options \verb|fragment| and \verb|nonfragment| will override
+mudela-book when it scans the mudela code to see if it is staff
+contents or complete code. This might be useful if mudela-book choose
+wrong.
+
+Since there is no finder's fee which doubles every year, there is no
+need to wait for the price money to grow. So send a bug report today
+if you need this one of this options.
+
+\section{Examples}
This was all options to \verb|\begin{mudela}|. The rest of the
document will show some ways you can use mudela in
\LaTeX~documents. It will also act as a simple test-suite for
r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
[f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata |
- r4.-\fermata [cis,16 cis g'8 f16 f b][g16 g f8 b16 b] dis4.-\fermata
+ r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata
}
\paper{linewidth = 7.\cm;}
}
To the right you can see some bars from the trumpet fanfara from the
beginning of the fantastic street opera ``Houdini the Great'', by the
-danish composer Andy Pape. The music is put inside a
+danish composer Andy Pape. The music is put inside a
\verb|floatingfigure| environment, and the music will be aligned by
the right marging if you set floatingfigure width and mudela linewidth
to the same value. The code looks like this:
r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
[f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata |
- r4.-\fermata [cis,16 cis g'8 f16 f b]
+ r4.-\fermata [cis,16 cis g'8 f16 f b8]
[g16 g f8 b16 b] dis4.-\fermata
}
\paper{linewidth = 7.\cm;}
# - mudela-book will scan the mudela code to find out if it has to add
# paper-definition and \score{\notes{...}}
# - possible to define commands that look like this: \mudela{ c d e }
+# 0.5.1:
+# - removed init/mudela-book-defs.py, \mudela is defined inside mudela-book
+# - fragment and nonfragment options will override autodetection of type of
+# in mudela-block (voice contents or complete code)
import os
import string
outdir = 'out'
initfile = ''
-program_version = '0.5'
+program_version = '0.5.1'
out_files = []
if outdir[-1:] != '/':
outdir = outdir + '/'
- std_init_filename = ''
- for p in string.split(os.environ['LILYINCLUDE'], ':'):
- try:
- std_init_filename = p+os.sep+'mudela-book-defs.py'
- break
- except:
- continue
- defined_mudela_cmd_re = {}
- try:
- f = open(std_init_filename)
- s = f.read()
- f.close()
- defined_mudela_cmd = eval(s) # UGH
- except IOError, w:
- sys.stderr.write("%s (`%s')\n" % (w[1], std_init_filename))
-# sys.exit(1)
-
-
+ defined_mudela_cmd = {'mudela': r"""
+\begin{mudela}[eps \fontoptions]
+ \maininput
+\end{mudela}
+"""}
if initfile != '':
f = open(initfile)
s = f.read()
for i in d.keys():
defined_mudela_cmd[i] = d[i]
del d
-
c = defined_mudela_cmd.keys()[0]
for x in defined_mudela_cmd.keys()[1:]:
c = c + '|'+x