File file = new File(args[1]);
vavi.sound.mfi.Sequence mfiSequence = MfiSystem.getSequence(file);
Sequence midiSequence = MfiSystem.toMidiSequence(mfiSequence);
Sequencer midiSequencer = MidiSystem.getSequencer();
Debug.println("midiSequencer: " + midiSequencer);
midiSequencer.open();
midiSequencer.setSequence(midiSequence);
if (play) {
midiSequencer.start();
while (midiSequencer.isRunning()) {
try { Thread.sleep(100); } catch (Exception e) {}
}
midiSequencer.stop();
}
midiSequencer.close();
if (convert) {
int ts[] = MidiSystem.getMidiFileTypes(midiSequence);
Debug.println("types: " + ts.length);
if (ts.length == 0) {