Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to play .mid file? #4

Open
ghopretz opened this issue Sep 12, 2018 · 2 comments
Open

How to play .mid file? #4

ghopretz opened this issue Sep 12, 2018 · 2 comments

Comments

@ghopretz
Copy link

How to play .mid file with this library?

@francollamas
Copy link

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();

@zhiqinliao
Copy link

o, this way can't working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants