JFugue-for-Android
JFugue-for-Android copied to clipboard
Can I save a midi file?
Seems that midi files that I generate from your lib are invalid. Should this work?
(I've tried both your JFugue 4 and JFugue5 implementations).
Version 5
Pattern pattern = new Pattern("C D E F G A B");
try {
MidiFileManager.savePatternToMidi(pattern, file);
} catch (IOException e) {
e.printStackTrace();
}
results in an exception
Caused by: java.lang.NullPointerException: Attempt to get length of null array at jp.kshoji.javax.sound.midi.MetaMessage.setMessage(MetaMessage.java:64)
Version 4
Player player = new Player();
Pattern pattern = new Pattern("C D E F G A B");
try {
player.saveMidi(pattern, file);
} catch (IOException e) {
e.printStackTrace();
}
creates unreadable midi files.
For anyone else reading, i could not get this work and sadly had to abandon using jFugue on android.
Hi I can confirm save pattern to midi works 100% here. I'm using Android 10 and jfugue android 5. The output midi file is valid and well played in android. Unfortunately the android library refers to version 5.0.1 and important classes added later are missing.