/*
* Copyright (c) 2009 by Naohide Sano, All rights reserved.
*
* Programmed by Naohide Sano
*/
import java.io.File;
import javax.sound.midi.MidiFileFormat;
import javax.sound.midi.MidiSystem;
import vavi.sound.mfi.MfiSystem;
import vavi.sound.mfi.vavi.VaviMfiFileFormat;
/**
* Midi2Mfi.
*
* @author <a href="mailto:vavivavi@yahoo.co.jp">Naohide Sano</a> (nsano)
* @version 0.00 090109 nsano initial version <br>
*/
public class Midi2Mfi {
/**
*
* @param args 0: in midi, 1: out MFi
*/
public static void main(String[] args) throws Exception {
File inFile = new File(args[0]);
javax.sound.midi.Sequence midiSequence = MidiSystem.getSequence(inFile);
MidiFileFormat midiFileFormat = MidiSystem.getMidiFileFormat(inFile);
int type = midiFileFormat.getType();
vavi.sound.mfi.Sequence mfiSequence = MfiSystem.toMfiSequence(midiSequence, type);
File outFile = new File(args[1]);
MfiSystem.write(mfiSequence, VaviMfiFileFormat.FILE_TYPE, outFile);
}
}
/* */