Closed victorsalle closed 8 years ago
Sorry for late reply.
I've modified MidiSystem.addMidiDevice(MidiDevice)
to public method.
This makes enable to append custom MidiDevice
instance that provides Receiver
.
At first, add a class that imprements jp.kshoji.javax.sound.midi.MidiDevice
.
Then implement getReceivers
, getReceiver
and getMaxReceivers
methods.
Resulting, the code will be like this:
MidiSystem.addMidiDevice(new MyMidiDevice());
Sequence sequence = MidiSystem.getSequence(getResources().openRawResource(R.raw.my_midi));
midiSequencer = MidiSystem.getSequencer();
midiSequencer.open();
midiSequencer.setSequence(sequence);
midiSequencer.start();
To try this fix, check out this branch. https://github.com/kshoji/javax.sound.midi-for-Android/tree/feature/fix_for_issue_2
Regards, Kaoru
I've tested with some SMF files. And merged into develop branch.
Hi,
I'm trying to retrieve the "transmitter" in order to assign it my own "receiver" (to handle every
MidiMessage
).From here
midiSequencer.getTransmitter()
returns null. Please note the same piece of code using thejavax.sound.midi
API works well.PS: I don't use USB/BLE features. I also tried with and without calling
MidiSystem.initialize()
/MidiSystem.terminate()
, and the result is the same.Thanks, Victor