简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM