Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I save a midi file? #9

Open
benClar opened this issue Nov 12, 2020 · 2 comments
Open

Can I save a midi file? #9

benClar opened this issue Nov 12, 2020 · 2 comments

Comments

@benClar
Copy link

benClar commented Nov 12, 2020

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
Copy link
Author

benClar commented Nov 17, 2020

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

@Aedus62
Copy link

Aedus62 commented Feb 10, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants