JFugue-for-Android
JFugue-for-Android copied to clipboard
Bug in Chord Parser
There appears to be a bug in the chord parsing process (latest build, but I haven't used it before so I don't know if it was there before) which creates notes for chords sequentially. The track beat time appears to be OK, but the note off messages are written before the note on of subsequent notes in the chord. This means that when the StandardMidiFileWriter writeTrack method tries to evaluate the variableLengthIntLength, the value it is passed is negative, and it loops forever.
As a temporary fix for my build, I have amended the MidiFileManager save method to sort the events in the tracks using the Track.TrackUtils.sortEvents that is already there, which also consequently rebuilds the EOT markers.
This appears to work OK for now.
I know you're going to tell me there is a flag somewhere, but I couldn't find anything.
Hope it helps.