JFugue-for-Android icon indicating copy to clipboard operation
JFugue-for-Android copied to clipboard

Can I save a midi file?

Open benClar opened this issue 4 years ago • 2 comments

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.

benClar avatar Nov 12 '20 18:11 benClar

For anyone else reading, i could not get this work and sadly had to abandon using jFugue on android.

benClar avatar Nov 17 '20 22:11 benClar

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.

Aedus62 avatar Feb 10 '21 11:02 Aedus62