Running TEXmuse

August 29, 2005

Installation

Place the files texmuse.tex, texmuse.mf, and txmfont.mf where TEX and

can find them. (The document’s own folder is such a place, if you don’t know of a better option.)

Running

A run of TEXmuse (with L^{A}TEX) will eventually typeset the musical material using a new font. Previous to the (first) run, the font does not exist. And this can mean some problems, because, in principle, TEX won’t find the tfm file(s) that it needs—and, later, the previewer won’t find the pk’s. So, in principle, error messages stemming form that are normal, and do not mean the program is not running.

Automatic font generation

In any case, with today’s implementations of TEX, error messages are unlikely to occur (unless of course there’s a mistake in the input, or a genuine bug in the program). Most implementations (I’m basing this on my experience with Windows MikTEX) today will generate the fonts automatically. So, if everything goes well, the first run will be a success. (If you don’t have an implementation that handles fonts automatically, see below.)

But there is a problem later on. The first time the file was typeset, the fonts did not exist, and that’s why there was font generation in the first place. But the second time the font files (created in the first run) will be there, and the program will not regenerate them. That means that any changes to the input file will not be reflected in the output. You need to delete the automatically-generated files before the second run.

Those files are usually put in the local branch of the TEX Directory Structure: folder \localtexmf. Usually, in \localtex\fonts. But beyond that, the placement of the new files depends on circumstances. So, you have to search \localtex\fonts for the files and delete them. For a document called foo.tex, the files to find and delete will be foo1.tfm and foo1.pk, foo2.tfm and foo2.pk, etc.

So, if there were changes to the music of foo.tex, you should find and delete all these files before typesetting. Since the files will usually be put in the same subdirectory every time, you can automate the procedure into a batch file that looks something like

del c:\localtexmf\fonts\pk\ljfour\monotype\abadi\dpi600\%1*.pk
del c:\localtexmf\fonts\tfm\monotype\abadi\%1*.tfm
texify %1.tex
pause
yap -1 %1.dvi

(where texify and yap are L^{A}TEX’s and the previewers executables).

It is the portion ‘\monotype\abadi’ that changes from document to document, and it is the same for both tfm and pk’s (the latter, of course, adding ‘\dpi600’ or equivalent). So it’s a good idea to make a note of this portion in the input file. Thus, when you come back to it after worked on other TEXmuse files, you can change the batch accordingly.

Manual font generation

If your implementation does not generate the fonts by itself, you will have to do it manually. The first run will give an error message: tfm file not found. Just press enter, letting the run end. There will be mf files anyway. Run on them:

    mf foo1.mf

(and the same for the rest of the files). You might have to try things like

    mf \mode:=cx; input foo1.mf

where cx can be changed into ljfour, for example. This depends on your local settings (and I assume if your implementation doesn’t do this automatically, it’s because you know all about this kind of procedures).

That creates gf files. From them you have to create the pk files:

    gftopk foo1.1200gf,

or whatever is appropriate.

After getting the tfm’s and pk’s, you can run L^{A}TEX again, and it will produce the document.

For any changes to the music to actually show up, you have to make sure that the tfm’s and pk’s were produced from the last mf’s (those that were created in the last L^{A}TEX run).

Syntax conventions

You use TEXmuse in a L^{A}TEX document by saying

    \input texmuse.tex

in the preamble. Follow the samples to learn the (pretty easy) syntax.

Before declaring the existence of a bug in the program, please make sure your input follows all conventions. I know they are pretty uncomfortable right now—making recovery from errors a friendly activity with TEXmuse is something to do yet.

One thing you need to know is that TEXmuse needs \makeatletter to be on at all times. Make sure to type \makeatletter after \begin{document}.