End of track should count in midi length
Context:
To repeat the experiment from https://github.com/sinshu/meltysynth/issues/55, I wrote a very quick tool to render a midi both with rustysynth and fluidsynth.
https://github.com/sevonj/rustyfluidcomp
Problem:
- ~Rustysynth does not include end of track message in the midi file length.~
end_of_sequence()doesn't account for note release duration.
The latter is less important, but still nice to have. Both of these count when rendering with fluidsynth:
screenshot
Proposed changes:
Provide method to check if Synthesizer still has a voice playing.
RustySynth's MIDI parser says that an EoT message is inserted at the 4-second mark (a channel number of 255 is interpreted as EoT), but does that mean it is incorrect? 🤔
Below is the list of events when the MIDI file is loaded using the current MIDI parser in RustySynth:
Message { channel: 0, command: 144, data1: 69, data2: 96 }, time=0.625
Message { channel: 0, command: 128, data1: 69, data2: 0 }, time=2.5
Message { channel: 255, command: 0, data1: 0, data2: 0 }, time=4.0
It appears that I didn't pay attention and made a mistake. Removing the release reduced the length of FS render to 6s, and and I assumed that this was where left the end mark.