XMidi

Author: Peter Arthur Loeb

2005-03-16

Version 1.4

The XMidi package contains two programs, MX, and XM, which allow conversion between the midi file format and an XML format which I call XMidi. I gave it the name XMidi for what I hope are obvious reasons, but in retrospect, it was probably a poor choice; the name has been used elsewhere for other purposes. My choice has caused a slight bit of confusion. Sorry.

In general, both programs may be executed from the command line, or from another Java program. In both cases, there are two kinds of arguments, options and non-options. Options are distinguished by their leading hyphen, may occur in any order, and may be interspersed with non-option arguments. Non-option arguments occur in order: input_file and output_file. For details about the command line, see {@link com.palserv.XMidi.Util#getCmdLine(String[]) Util.getCmdLine}. For details about execution from another program, see {@link com.palserv.XMidi.XM XM} and {@link com.palserv.XMidi.MX MX}.

For simple usage, both MX and XM take two arguments, an input file and an output file. MX takes a MIDI file and converts it to an XMidi file. XM takes an XMidi file and converts it to a MIDI file. The runMX.cmd and runXM.cmd files show how to invoke the programs in Windows, but these can be modified to include classpath, etc.

As an example, we will convert ex01.mid to ex01.xml in verbose mode, the default.

runMX ex01.mid ex01.xml

My intent is for this program to be "open source" in the sense of Open Source Initiative (OSI). I hope that explains it.

In the meantime, Mark Leicester has modified some of the code (from Version 1.3) so it could be used in the Apache Cocoon project. This is very gratifying to me. Thanks, Mark.

I would like to thank the author of http://www.borg.com/~jglatt/index.htm for the technical articles which helped me to learn enough about midi files so I could write these programs.

The earlier version (1.3) allowed -p and -q flags, which are no longer supported. However, they are no longer needed.

Any and all feedback should go to me.