Speed Demon
Speed Demon

Reputation: 691

Enable/Disable MIDI channel in android (java)

I am developing a simple application in android that does MIDI playback and thats fine. I was wondering if it is possible to enable/disable MIDI channels with the android/java built-in API, and if so how? I am struggling to implement this feature.

I found out on the internet that the java package "javax.sound(.midi)" was included in earlier version of the android system but was later removed. I can't seem to find any library on the internet that provides the functionality that I need. One library I came across allowed me to add and remove tracks from MIDI, but a track is different from channel.

I have a MediaPlayer object with midi file set as the data source and it does play the file, but I really want to implement a feature to enable/disable any of the 16 standard midi channels. It doesn't need to be in real-time, any solution is acceptable as long as it does not require server-side. Like if I need to modify the existing midi file, write it to disk and restart the playback its not a problem. Any suggestions/experience :\ !?

Thank you

Upvotes: 0

Views: 724

Answers (1)

LeffelMania
LeffelMania

Reputation: 12875

This library can do what you're asking: https://code.google.com/p/android-midi-lib/

Read the file. Iterate over events in each track, check the channel of the event, remove the ones on the specified channel. Write it out. Play it. Rejoice.

Upvotes: 1

Related Questions