mdvi version 0.4.1 Copyright 2003 Juergen Fleck, license: GPL mdvi stands for Music to DVI. Takes the name of an M-Tx source as parameter and produces selected output files, while correcting a MIDI output flaw in M-Tx/PMX. Invocation: mdvi [--help|--version] [-l] [-m ] [-o(i|s|f|a|h)] [-p ] filename[.[mtx]] The commandline parameters preceeding the filename may come in any amount and order, but the filename must be the last parameter, be it with or without filename extension. Short parameters (introduced by a single dash "-") may be grouped, i.e. "-l -of" is equal to "-lof". This is allowed as long as not more than one of them expects a parameter, such as -p and -m. After compilation, unneeded files from intermediate compilation stages will be removed. Overview of the compilation stages: foo.mtx -- M-Tx ------> foo.pmx foo.pmx -- PMX -------> foo.tex, foo.mid foo.tex -- MusiXTex --> foo.dvi foo.dvi -- dvips -----> foo.ps foo.dvi -- dvipdfm ---> foo.pdf filename.mtx will be preprocessed by M-Tx and PMX and finally TeXed. Note that all those voices in the resulting MIDI file will be octavated down for which the G8 clef is used. That is determined from the style definition and "Style:" selection in the preamble of the M-Tx source. It is realised by modifying the "Octave:" line in a temporary file. This works with the predefined Style SATB4 as well as with user defined styles. Of course, you need an "Octave:" line in your M-Tx source to get this working! Example: With SSATB: Voices S1, S2, A, T, B; Choral; Clefs G G G G8 F Style: SSATB Octave: 4 4 4 4 3 in the M-Tx preamble, the MIDI file will be produced with Octave: 4 4 4 3 3 because the last but one voice has a G8 clef. Dependencies: - gawk is used for temporary modifications on the M-Tx source. - M-Tx (prepmx) is used to produce the PMX source. For correct MIDI handling, M-Tx pre0.54a is required. - PMX (pmxab) is used to produce MIDI and TeX output. - A MusiXTeX installation is needed to process the resulting TeX file. - dvips is used to generate Postscript output. - dvipdfm is used to generate PDF output. Limitations: - The input file is expected in the current directory, absolute pathnames are very likely to break everything (untested). - The input filename should not contain spaces (untested). - Tested in a Linux environment with bash. Commandline parameters: --help prints this information --version just prints out the version and exits -l LaTeX will be used for compiling the filename.tex file instead of plain TeX. This option is very unlikely to be used because PMX produces plain TeX output, but maybe there are people who are able to change that. Anyway, mdvi does not check whether LaTeX is appropriate. You are on your own. -m If you want to switch easily between different MIDI instruments without changing the M-Tx source, mdvi gives you the convenience of choosing one of any predefined MIDI instrument set in your M-Tx source. Such a set is an M-Tx comment starting with the keyword "MIDI". If you make an invalid MIDI instrument set selection, you will be warned, and it will be ignored. The default MIDI instrument set can be defined via the environment variable MDVI_MIDI, see "Environment variables". Syntax of a MIDI instrument set in the M-Tx source: % MIDI Example excerpt from an M-Tx source: % The following one will be the default because it is the first one % without any special syntax. It will simply be passed to PMX. % The two lines following it define the MIDI sets vh and piano %% It100i36:100:12:100b40:56:72:88g20 % MIDI vh It120i36:100:12:100b40:56:72:88g20 % MIDI piano It100ipipipipib40:56:72:88g20 Selecting one of the sets by invoking mdvi: mdvi foo.mtx This will leave the "% MIDI" lines as they are, thus letting PMX ignore them. This results in the first PMX MIDI line being chosen: "It100i36..." mdvi -m vh foo.mtx This will change the "% MIDI vh It120..." line to "%% It120..." such that it will simply override the first line. mdvi -m piano foo.mtx This will make the "It100ipipi..." line active. -o(i|s|f|a|h) One or more of the suffix letters to -o may be specified. They select the requested output files: i DVI (default) s PS f PDF a all of the above h displays help regarding the -o parameter Mnemotechnic note: The letters chosen here correspond to the last letter of the output type: dvi: i, ps: s, pdf: f Non-selected output files will be deleted! Examples: -osf for PS and PDF; -oa for all: DVI, PS and PDF -o must be the last one in grouped short parameters because of its suffixes. You can choose a certain default output type by setting the environment variable MDVI_OUTPUT variable, see "Environment variables". -p Use as papersize. This will be passed to dvips and dvipdfm when PS and PDF output is produced. If this option is not given, mdvi will fall back to the environment variable MDVI_PAPERSIZE, then to the default papersize of dvips, and finally to a4, if none of the above is found at all, see "Environment variables". If you choose a papersize unknown to dvips resp. dvipdfm, mdvi will exit with an error message. Environment variables: mdvi uses the following environment variables: MDVI_MIDI Here you can define a default MIDI instrument set which will be chosen when parameter -m is not used in the command line. MDVI_OUTPUT This must be one of the letters known by the -o parameter which selects the output files produced. This variable will be consulted if parameter -o is not used in the command line. If MDVI_OUTPUT is not set either (or invalid), then i is used. MDVI_PAPERSIZE This should be something like letter or a4. This string is passed to dvips and dvipdfm as paper size when PS and PDF output is produced. If parameter -p is not used and this variable is not set, then mdvi will fall back to the default paper size used by dvips as specified in the config file /etc/texmf/config.ps which will be found in the location as seen above in Redhat and SuSE Linux installations. Finally, if nothing is found there, then a4 is used. Invocation examples: mdvi lechner1. produces lechner1.mid and lechner1.dvi from the source file lechner1.mtx, because the default output type is dvi (controlled by the environment variable MDVI_OUTPUT). mdvi -of -p a4 lechner1 produces lechner1.mid and a DIN A4 sized lechner1.pdf from the source file lechner1.mtx.