Package

Source Code of Midi2Mfi

/*
* 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);
    }
}

/* */ 
TOP

Related Classes of Midi2Mfi

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.