When exporting MIDI files, the rest at the end are being ignored
When exporting MIDI files, the rest at the very end of sheet are being ignored. That is, the MIDI file ended at the offset of last non-resting note, the rest note at the end were "cutted off".
This bug might sounds trivial, but the real problem is, if the last non-resting note is short, and user try to synthesize the midi file, there will be a clipping effect at the end of audio, which is very annoying.
Two samples are uploaded, I believe it is a 100% reproduction. I noticed aforementioned clipping effect when syncing the midi output of sample 2 by fluidsynth.
I noticed that a duplicate was already here(https://musescore.org/en/node/148311), but I cannot reopen that issue so I have to submit a seperated one.