Midifile generatePatternSeqs

Hey! I am having problems understanding how to generate patterns form a Midifile. I have been using the method generatePatternSeqs, but it seems like that it is not reading the very last Information of the Midifile.

(
p = "file.mid".pathMatch;
~m = SimpleMIDIFile.read(p.choose);
~midiseqs = ~m.generatePatternSeqs;
~mididur = ~midiseqs.flatten.collect({ arg item; item[1] });
)
// these are the results:
~midiseqs.value = [ [ [ 60, 1.0 ], [ rest, 3.0 ], [ 60, 1.0 ], [ rest, 3.0 ], [ 60, 1.0 ] ] ]
~mididur.value = [ 1.0, 3.0, 1.0, 3.0, 1.0 ] // this is not equal with the total length of the midi file, a 3.0 at the end is missing

I am using a midifile with three notes, but I am only getting five values, shouldn’t it be six? So I think a [rest, 3.0] at the end is missing. Any idea on how to fix this and read the whole midifile until the end?
Thank you! :slight_smile: