2

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?

user102
  • 35
  • 6

3 Answers3

3

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.

Ziad Halabi
  • 964
  • 11
  • 31
  • This is what I am looking for. However, AlgorithmicMusicPlayer project isn't working in AndroidStudio. When I run it, it doesn't produce the song.wav file. Can you fix it please? – inder Mar 13 '16 at 23:33
  • @inder saw your issue on github regarding missing music notes files. Will fix it today. Let me know if you need anything else. Thanks! – Ziad Halabi Mar 14 '16 at 08:48
  • @inder I updated the link, you can download the files now. Im sorry for being late. If you find the project to be useful, please upvote my answer. Thanks! – Ziad Halabi Apr 05 '16 at 09:56
0

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();
arnaud ruant
  • 391
  • 3
  • 5
0

If you just want your android application to play JFugue strings, you can give try to JFugue4A library (https://sourceforge.net/projects/jfugue4a/). It allows you to use JFugue-2.1 API, like this code to play C-major scale:

Player player = new Player();
player.play("C D E F G A B"); 
Nephew
  • 21
  • 3
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/30676035) – Sergio Dec 26 '21 at 20:17