KyoSherlock/MidiDriver

How to play .mid file?

ghopretz opened this issue · 2 comments

How to play .mid file with this library?

Hi! I was trying to undestand it...

You need to add the MidiDevice to MidiSystem....
Next.. load a Secuence and put it into a Secuencer.....

Using the synth of the example module:

MidiSystem.addMidiDevice(synth); 

InputStream is = context.getAssets().open("midi file dir here!");
StandardMidiFileReader fileReader = new StandardMidiFileReader();
Sequence s = fileReader.getSequence(is);
Sequencer sequencer = MidiSystem.getSequencer();
sequencer.open();
sequencer.setSequence(s);
sequencer.start();

o, this way can't working