问题
I already implemented Ksoji's 'jfugue-android' library (https://github.com/kshoji/JFugue-for-Android/tree/master/jfugue-android) in my project, but I can't do anything with it, for example initialize it by typing:
MidiSystem.initialize(this);
since Eclipse doesn't seem to know what MidiSystem is at all and I can't fix the problem. Should I import anything else to my project in order to be able to play some simple patterns on an Android device?
回答1:
Kshoji's Project doesn't provide the sound playback.To play MIDI notes on application, The USB MIDI devices or BLE MIDI devices will be needed. In case you want to do that, I recommend you build your project using Android Studio instead of Eclipse.
I did a Library that is kind of a solution to have Music Strings played on Android, check it out: https://github.com/ziad-halabi9/AlgorithmicMusicPlayer
It basically takes a musical strings such as "A5s B5q E6h" and converts it into a wav file of a certain instrument. It can also handle multiple instruments at the same time.
回答2:
You have to chose between BLE or USB interfacing
And write the type of code consequently, for example USB
UsbMidiSystem usbMidiSystem = new UsbMidiSystem(this);
usbMidiSystem.initialize();
来源:https://stackoverflow.com/questions/27782301/jfugue-java-music-api-implementation-in-android