Hi fluidsynth devs,
I've noticed a problem when using the fluidsynth command line to render MIDI files. For some files, the time of note events seems to get less accurate the farther along in the file the event occurs.
If I render the file with wildmidi, the final note is at 95 seconds as expected. I'm also able to render the file correctly by loading it into pretty_midi (
https://github.com/craffel/pretty-midi) and having it render the file using the fluidsynth library.
However, if I use the fluidsynth command line, trying to replicate the settings that pretty_midi uses, the final note occurs about 230ms too late. Here's the command:
fluidsynth -F test_fluidsynth_95s_note.wav -r 16000 -K 256 -L 1 -g .2 -v ~/pretty-midi/pretty_midi/TimGM6mb.sf2 test_with_95s_note.mid
fluidsynth -F test_fluidsynth_95s_note.wav -r 44100 -K 256 -L 1 -g .2 -v ~/m/pretty-midi/pretty_midi/TimGM6mb.sf2 test_with_95s_note.mid
And here are the final lines of output:
fluidsynth: noteon 2 64 100 00523 95.163 0.741 0.000 0
fluidsynth: noteoff 2 64 0 00523 0.747 1
From that output, it looks like fluidsynth has misinterpreted the start time of the final note as 95.163 seconds, and if I open the resulting wav file in Audacity, the final note does come 163ms too late.
It's particularly odd that the magnitude of the timing error seems dependent on the output sample rate (163ms for 44.1khz, 230ms for 16khz).
Is this a known issue? Do you have any tips for a workaround?
Thanks!
-Fjord