Description of command structure and options

A general call to MusicTEX  looks like this:

midi2tex inputfile [outputfile] [-option1 [-option2 [...]]]
The options are:


  -?xxxxxxxxxxx 
  -? 		 A help screen

-s#,#,... Skip tracks (default none)
-i#,#,... Combine tracks into one instrument (default none)
-b#,#,... Code staffs with bass clef (default violin)
-a1#,#,... Code staffs with alto 1 clef
-a2#,#,... Code staffs with alto 2 clef
-a3#,#,... Code staffs with alto 3 clef
-a4#,#,... Code staffs with alto 4 clef
-o#,#,... Order the tracks (default original order)
-q# Quantize (default off)
-p#,#,... Vertical part times (default type 4, quarter note)
-f#,#,... Force beams to zero slope
-h# Set horizontal size of music document
-v# Set vertical size of music document
-m# Set musicsize
-e# Set Elemskip size
-k# Set key sign
-x Enable batch processing (ST version only)
-dTYPE Generate debug information (default none)

The input file name is any valid DOS name. If the extension is omitted the default .MID is assumed. The output file name is optional. If omitted the input file name is used with extension .TEX. The options are described in more detail below.

-?, help screen
The program displays information on how to enter a correct command line and a listing of available options.

-s, skip tracks
Occasionally you might want to skip a track because you don't want any output from it to appear on your scores. You can suppress output from a track by including the -s option in your command line. The numbers of the tracks(s) you want to skip immediately follow the option. For instance if you want to skip a drumtrack on track 4 your command line should include: -s4.

The meta events in a skipped track ARE processed as they may contain information about timing or key signature.

The first track in a type 1 midi file is usually only used to store information about timing, key signature, etc. Therefore this track is skipped by default. If for any reason you want to prevent skipping of this track then include -s1 in the command line.

-i, instruments
In MusicTEX  it is possible to assign two or more staffs to one instrument. For example they can be the left and right hand of a piano piece. This option can be used to assign two or more tracks to one instrument. The tracks are entered as numbers directly after -i, separated by comma's. For instance if a piece contains 6 tracks and you want to assign track 2 and 4 to one instrument your command line must contain the option: -i2,4.

-b, bass clef
MusicTEX  enables coding of music using different clefs. Most used are the violin and bass clef. MIDI2TEX  enables the assignment of the bass clef to one or more tracks. If omitted, the default violin clef is used. For instance, to assign the bass clef to track 2 of a MIDI file include -b2 in the command line.

-a1..a4, alto clefs
Assign an alto clef to any of the tracks. For instance, to assign the alto 1 clef to track 3 of a MIDI file include -a13 in the command line.

-o, order track
The ordering of tracks in your MIDI file may not comply with the order you want the tracks to appear on the output. With this option you can redefine this order. Here is an example: consider a MIDI file containing 3 tracks. Normally the order of the tracks on your output will be 1, 2, 3. If you want to alter this order into 2, 3, 1 you must include the option -o2,3,1 in the command line. It is important that you include ALL TRACKS in this option. If there are 5 tracks in the MIDI file there must be 5 numbers in the option string. Don't forget to include the first track in the string. By default it is skipped in the output but you must include it in this command. If you forget one MIDI2TEX  will exit with an error. So, before using this command you must be sure how many tracks are included in the MIDI file. The best way to use this option is to first translate the MIDI file without this option. Examine the output and determine the order of the tracks that you want. Than retranslate the MIDI file with the -o option included.

-q, quantize
Quantizing involves the rounding of start times of notes. As stated in section [*] quantizing is a good tool for cleaning up the notes in your MIDI file. If you do not have this opportunity on your sequencer and your output comes out ugly with lots of rests inserted everywhere, try to use this option. The quantize option does two things: The number after the -q option determines the quantization time. Use table [*] to determine the quantization time:

Table: The quantization numbers
quant. note number

\begin{picture}(1,1.5)
\put(0,0){\mus \symbol{35}}
\end{picture}
1

\begin{picture}(1,1.5)
\put(0,0){\mus \symbol{34}}
\put(0.5,0){\line(0,1){1}}
\end{picture}
2

\begin{picture}(1,1.5)
\put(0,0){\mus \symbol{33}}
\put(0.5,0){\line(0,1){1}}
\end{picture}
4

\begin{picture}(1,1.5)
\put(0,0){\mus \symbol{33}}
\put(0.5,0){\line(0,1){1}}
\put(0.5,0){\mus \symbol{40}}
\end{picture}
8

\begin{picture}(1,1.5)
\put(0,0){\mus \symbol{33}}
\put(0.5,0){\line(0,1){1}}
\put(0.5,0){\mus \symbol{41}}
\end{picture}
16

\begin{picture}(1,1.5)
\put(0,0){\mus \symbol{33}}
\put(0.5,0){\line(0,1){1}}
\put(0.5,0){\mus \symbol{42}}
\end{picture}
32

\begin{picture}(1,1.5)
\put(0,0){\mus \symbol{33}}
\put(0.5,0){\line(0,1){1}}
\put(0.5,0){\mus \symbol{43}}
\end{picture}
64


-p, part time
MusicTEX  is designed to code notes in a vertical way. The notes at different tracks that start at the same time should be aligned to each other. Therefore in MusicTEX  you can split up a measure into separate parts. The starts of such parts are aligned above each other.

MIDI2TEX  follows this philosophy. By default it separates the measure into parts with a length of the denominator of the signature. If you want to change this part time use this option. Use table [*] to determine what number you should enter after the option. For instance if you want the separation time to be the length of an eighth note instead of a quarter note include -p8 in your command line.

-f, force zero slope
This option forces the slopes of the generated beams to be zero. The beams will be oriented horizontally.

-h, horizontal size
With this option a horizontal size can be set other than the default defined in MusicTEX  (160 mm). The parameter should be in 0.1mm. This option will output the proper sizing command in the source code. More important is that this command is used to append line and page breaking commands at the proper positions in the source file.

-v, vertical size
With this option a vertical size can be set other than the default defined in MusicTEX  (240 mm). See -h option for further details.

-m, musicsize
With this option a choice can be made between 20pt and 16pt. The parameter must be either 16 or 20.
As an example we might want to produce a music document with width 100 mm, height 200mm and 16 pt musicsize. The option string should than include: -h1000 -v2000 -m16.

-e. elemskip
Notes in MusicTEX are spaced by the (MusicTEX ) variable \elemskip. Default values are set during initialization of MusicTEX . In previous versions of MIDI2TE\autolines was used to alter the spacing of notes. Instead of using this macro in this version \elemskip is now altered directly. This only happens when the size of the document is changed in any way (-m,-v,-h,-e). If you're not satisfied with the spacing of the notes you may use this option to directly alter the value of \elemskip. The value should be in pt. Changing the value of \elemskip in this way does not corrupt line and page breaking. An example: When using musicsize 20 the elemskip is 10 by default. If you want to reduce the space between the notes you must include the option -e8 in your command string.

-k, key sign
This option sets the keysign of the total music piece. Presently MIDI2TEX does not allow to set a key sign for individual tracks. The parameter following the option denotes the number of flats (negative sign) or sharps (positive sign). For instance to code a piece with four flats the command line should include: -k-4

-x, batch proc.
This option is only available on the ST version. It skips the message: hit key to exit which appears after processing of a file. Including this option on the command line in a batch file which contains calls to MIDI2TEX enables continuous execution.

-d, debug info
This option generates debug information. There are three ways to output this info: screen, file or printer.This is the way to select the debug type:


  to printerxxx -dPRINTER
  to screen 		 -dSCREEN

to file -dFILE
to printer -dPRINTER
File output is written to a file with the name of the input file and extension .MLG. I do not believe that this option is of any use to anyone who is not familiar with the internal structure of the program. However, if for any reason the program should crash at least you know at what point this happened. In section [*] section [*] further suggestions for its use are given.
Warning: this option creates a huge amount of ASCII data. A single page of typeset music will generate about 65kB of debugging info depending on the number of notes in each measure.