\documentclass[12pt]{article}
\usepackage{times,mathptm}
\def\4{$\backslash$}

\begin{document}
\title{Installation of MusiX\TeX\ and Friends on Windows}
\author{Christof K.\ Biebricher (cbiebri@gwdg.de)}
\maketitle
\section{Tree structure}
You should separate
carefully a) program files you downloaded and installed,
b) local additions and macros and c) your own data files,
containing your manuscripts and typesets. I recommend using
two partitions, one (c:) containing the operating system and
the program files and another one (d:) containing local stuff
and data. If all fonts, macros
and executables are in their proper directories they will be
found automatically. Do NOT change the directory structure of
the programs unless you are an expert and know what you are doing.

The typesettings themselves should be in a subdirectory of your
home directory.

Most programs you need are found on a CTAN
(Comprehensive \TeX\ Archive Network) server, e.g.,
ftp.tex.ac.uk, ftp.dante.de or one of the numerous
mirror sites. You may download by FTP or by a browser.
Most executables are invoked from a DOS command line.
If you don't like that, look for a suitable frontend,
e.g.\ WinEdt, see section ``Editor''.

\section{Ghostscript and Ghostview}
These programs work together to enable you to view and print 
postscript and PDF files.  Ghostscript can be obtained from CTAN:\newline
CTAN\4nonfree$\backslash$support$\backslash$ghostscript$\backslash$AFPL \newline
or downloaded from http://www.cs.wisc.edu/$\sim$ghost. \newline
Download the newest version for win32, e.g., gs703w32.exe.
Run this file, it installs the fonts and ghostscript.
I would recommend to use for ghostscript, ghostview and some
other related files a directory c:\4gs.

The frontend for ghostscript is ghostview, found under \newline
CTAN\4nonfree\4support\4ghostscript\4ghostgum  \newline
or download from http://www.cs.wisc.edu/$\sim$ghost. \newline
Select the newest file for win32, e.g., gsview40w32.exe.
Run this file to install ghostview. gsview should be associated with
to the extension .ps and .eps so you can double-click these file types 
to view them.

You'll need a \%TEMP directory to write temporary data to (see below).
The first time you run gsview you should configure it.
You do that by pressing "Options" in the menu and filling in 
information about where to find the dll and font files. This is only
necessary if it hasn't been done by the installation procedure.
Go to the menu item "Media" and set the paper format you'll be
using.  Under "Media" go to "Display Settings" and 
adjust the bit settings until you have optimal sharpness
(In most cases you can set the bit values to the highest number).

\section{MiK\TeX}
You can install MiK\TeX\ from the following sources:\newline
\$CTAN\4systems\4win32\4miktex or from \newline
http://www.miktex.org. A MiK\TeX-CD is also available.
Make sure that there is enough room for the installation on your hard disk.

\begin{enumerate}
\item Download Setup.exe.

\item Run setup.exe. Follow the menu and click
`download'. You may select the size of your MiK\TeX\ installation.
If you only use MusiX\TeX, then `small' is sufficient. Select the
download site nearest to you and download. Finish setup.

\item Run setup.exe again. Click `install'. When following the
menu you can use the default values. It is safest to use the 
default tree directories. If you have more than one partition,
I would recommend using for the texmf tree c:\4texmf and for
the local texmf tree d:\4texmf. The local texmf tree must not be
a subdirectory of the texmf tree. You have then time to drink a cup of
coffee while the installation proceeds.

\item
Make a local directory \%LBIN for executables, if you do not have one already,
in my case d:\4ckb\4bin. Also make a directory to write temporary data to, e.g.,
c:\4temp.
You should then open c:\4autoexec.bat
with an editor and add the lines \newline
\texttt{SET LBIN=$<$your\_local\_binary\_dir$>$} \newline
\texttt{SET TEXBIN=c:\4texmf\4miktex\4bin} \newline
\texttt{SET PATH=\%LBIN;\%PATH;\%TEXBIN;C:\4GS\4GS7.03\4bin} \newline
\texttt{SET TEMP=C:\4temp}\newline
The changes are operational after the next run of autoexec.bat, e.g.\
by a reboot.

\item
Clean up by deleting the downloads that are no longer needed.

\end{enumerate}

MiK\TeX\ is already fully configured after the installation. You can
have a look into the configuration file \%TEXMF\4miktex\4config\4miktex.ini, but
do NOT change it unless you know exactly what you are doing. 
If you want to change,
copy it to \%LOCALTEXMF\4miktex\4config\4miktex.ini and make your changes in
the local file.
There is a doc directory containing many good instructions, the most
important being \%TEXMF\4doc\4miktex\4miktex.chm. Read it.

\section{MusiX\TeX}

Download from \$CTAN\4macros\4musixtex\4taupin\4musixtex.zip
or from \newline
http://icking-music-archive.sunsite.dk/software.

Unpack (\texttt{unzip -a musixtex.zip}, or if using WinZip, just 
double-click the .zip file) into a temporary directory. 
It contains the macro (Musix\TeX\ commands) and metafont 
(music font definition) files. From the icking-music-archive you can get
a batch file for the MusiX\TeX\ installation (musxnstl.bat) that
creates the necessary subdirectories and copies the files into the
proper subdirectories.  Run it from the temporary directory used for unpacking.
{\bf Caution:} Do not use the batch file without prior editing
for your settings for \%TEXMF, \%LOCALTEXMF and \%LBIN! If these variables are
already in your environment, you can delete the lines setting the variables.

If running this batch file makes you nervous, you may install the files 
by hand: Create a directory tree under
\%LOCALTEXMF exactly like in \%TEXMF with the subdirectories
\4doc, \4fonts, \4miktex, \4pdftex, \4tex, \4dvips etc. The directory \4fonts
should have at least the subdirectories \4pk, \4source, \4tfm, \4type1. In
particular, make the directories where the files should be moved to.
Go to the directory where you unpacked musixtex and type \newline
\tt
MOVE *.exe \%LBIN \newline
MOVE *.mf \%LOCALTEXMF\4fonts\4source\4public\4musixtex \newline
MOVE *.tfm \%LOCALTEXMF\4fonts\4tfm\4public\4musixtex \newline
MOVE musixdoc.* \%LOCALTEXMF\4doc\4musixtex \newline
MOVE *.tex \%LOCALTEXMF\4tex\4generic\4musixtex \newline
MOVE *.sty \%LOCALTEXMF\4tex\4generic\4musixtex \newline
\rm
You can of course also use Windows Explorer to create the directories 
and move the files by dragging them with the
mouse.

The remaining files in musixtex.zip are not required for running MiK\TeX; the
batch files added by Daniel Taupin are for em\TeX\ and are not suitable
for MiK\TeX.

To complete the MusiX\TeX\ installation you'll need to update the MiK\TeX\ 
database as described in the next section. 

\section{Type1 MusiX\TeX\ Fonts}
Download from http://icking-music-archive.sunsite.dk/software 
the newest type1 version of the musixtex fonts, musix\_ps.zip, to
a temporary directory. When unpacking you must preserve the directory
structure; with pkzip just type \texttt{unzip -a musix\_ps.zip}, 
or with 
WinZip, double-click and be sure to check "use folder names." 

Now you may use the batch file musixfnt.bat to create the required
directories, copy files, modify the font configuration files, and
update the MiK\TeX\ database.  
Again be sure edit the batch file first so it 
has the correct settings for \%TEXMF, \%LOCALTEXMF and \%LBIN, and run
it from the temporary directory you used for unpacking.

Alternatively, you may install by hand: \newline
Create the target directories that are needed in the next step.\newline
Run from a DOS command line:
\newline \texttt{MOVE .\4*.* \%LOCALTEXMF\4fonts\4type1\4musixtex} \newline
\texttt{MOVE .\4dvips\4musix.map \%TEXMF\4dvips\4config} \newline
\texttt{MOVE .\4dvipdfm\4musix.map \%TEXMF\4dvipdfm\4config} \newline
or perform the corresponding steps with the mouse in explorer.

The following steps (also done by musixfnt.bat) change the config files;
it is always a good idea to make a backup copy of the config
files before making changes. However, the danger of wrecking something
is very small, even multiple runs of the batch file don't hurt.

Add the line \newline
\texttt{ p +musix.map}\newline
to the files \%TEXMF\4dvips\4config\4config.ps and
\%TEXMF\4dvips\4config\4config.pdf.

Add the line \newline
\texttt{ f musix.map}\newline
to the file \%TEXMF\4dvipdfm\4config\4config.

Regenerate the MiK\TeX\ database by typing\newline
\texttt{initexmf -{}-verbose -{}-update-fndb=\%TEXMF} \newline 
\texttt{initexmf -{}-verbose -{}-update-fndb=\%LOCALTEXMF} \newline 
\texttt{initexmf -{}-verbose -{}-search -{}-mkpsres}\newline

Mkpsres does not make a new database but appends new font files
to the existing database. If type1 font files are moved or deleted,
the old database has to be deleted, otherwise MiK\TeX\ will complain
that it doesn't find the fonts in the expected locations! 

\section{Running MusiX\TeX}

Some people
make a special musixtex format. I do not recommend it; to process a TeX
file simply type tex $<$file.ext$>$. 

Do not write your music source files
in a subdirectory of \%TEXMF or \%LOCALTEXMF. For writing, you need an
ASCII editor, see last section.

While ordinary \TeX\ files only require a single pass through \TeX\, 
a MusiX\TeX\ run always requires three steps: \newline
\texttt{\%TEXBIN\4tex $<$file$>$.tex}\newline
\texttt{\%LBIN\4musixflx $<$file$>$}\newline
\texttt{\%TEXBIN\4tex $<$file$>$.tex}\newline
If \%TEXBIN and \%LBIN are in the path (as they should be), 
they need not to be typed.
On the first pass MusiX\TeX\ produces the file $<$file$>$.mx1. Musixflx
reads this and produces $<$file$>$.mx2, which in turn is read by
\TeX\ on the second pass. 
If you made a change in the source file and want to run \TeX\ again,
you usually should delete $<$file$>$.mx1 and $<$file$>$.mx2.

\section{Preprocessors}

Preprocessors not only effect an enormous save in time, they also
significantly simplify typesetting. If you are a newbie, I would
recommend starting typesetting instrumental pieces with PMX and
vocal pieces with M-Tx. Download the newest full release of PMX 
and M-Tx  from \newline
http://icking-music-archive.sunsite.dk/software/indexmt6.html\newline
and unpack. Move the *.exe files to your \%LBIN directory, the
documentation to \%LOCALTEXMF\4doc\4musixtex
and the (remaining) *.tex files to \newline
\%LOCALTEXMF\4tex\4generic\4musixtex.
Read the documentation. The documentation for M-Tx is best to start with.
Repeat updating your database as above. For creating .mtx or .pmx files,
you'll also need an ASCII editor.

\section{Editor}

Now you have the engine together, but not yet a fully functional
vehicle. You need an ASCII editor to typeset, and you may want a frontend 
that simplifies
all compilation steps required; otherwise you'll have to run all steps
from a DOS command line. This can be simplified by a batch file.
Unfortunately, it is nearly impossible to give a good recommendation;
there are so many different types of editors. Select an editor with
the possibility of writing macros. You find good editors and shells
for MiK\TeX\ at http://www.miktex.org/links.html, e.g. \newline
WinEdt (http://www.winedt.com) \newline
emacs (http://www.emacs.org; Installation notes by 
Claus Dethlefsen, \newline 
http://www.math.auc.dk/$\sim$dethlef/Tips/) \newline
vim (http://www.vim.org).\newline
I myself use THE (http://www.lightlink.com/hessling, free) with REXX as macro
language and have written my menus with a batch script processor from JPsoft
\newline (http://www.jpsoft.com).

\end{document}


