-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Weird tempo issues when writing to buffer #192
Comments
At least it works with the fluidsynth exec:
Have to figure out why though... |
Found the difference: the fluidsynth exec always requests 64 frames from |
Ok, I think I found the problem and pushed a commit. Not quite sure if this is the right place to fix it, but it seems to work. If you want to try it, clone the timing branch and build it. Once built |
It works! Thank you so much! |
Sadly d313db5 doesnt really fix it. Found a midi that still has timing problems and running out of polyphony. Again it sound absolutely perfect rendering it with the fluidsynth exec. Need to investigate further. |
when processing multiple blocks and rendering them by one single call to fluid_rvoice_mixer_render()
This bug seems to be design made. fluidsynth pretty much relies on the fact to process all events for one single block and then render whatever we just processed. Processing more blocks means processing more events, esp. noteons. But once a note was fluid_synth_noteon() there is no tracking of where this note was turned on within the current block. One single block is just small enough that you cant hear the difference. You will however hear it pretty soon (depending on the MIDI) when processing a couple of blocks. 6b0c8e7 poorly attempts to fix this. However a proper fix will probably require a bit of rewriting the synth and rvoice implementation, and I'm not willing to do this, sry. For now fa3894c just makes it work, though not in a nice way. |
Apparently fa3894c causes glitchy audio with
Not sure what's wrong. I think there's trouble within @sudgy The best what you can do for now is to continiously call |
Why not edit |
Still hoping to avoid such a hack... |
I'm just thinking it might be useful to put in 1.1.7. You could actually fix it later. It's just an idea. |
@sudgy I updated the timing branch, feel free to test. It basically makes sure that fluidsynth is always threadsafe, so that events are always enqueued internally, which seems to be pretty much what the current implementation expects. If you test, make sure you listen to the rendered sound for at least a minute. Previously it started out perfectly and got glitchy after 50s. |
Did not experienced this problem again and merged #193 into master. So we should at least have a workaround for this in 1.1.7 release. Let me know if you're having trouble. |
There still seems to be some problem with the timing; I have tried version 1.1.10, 1.1.11 and 2.0.1 with |
I've been having weird tempo issues with fluidsynth when writing to a buffer with
fluid_synth_write_s16
. I was wanting to use fluidsynth to write to a buffer and then use that buffer with another library. However, for some midis, the timing seems to be off. Here's code that can reproduce the issue:I have attached a few extra files. 001-Battle01.mid works perfectly. However, 015-Theme04.mid gets messed up. I've converted the output of this program with that midi to an ogg and attached that as sound.ogg.
Here's a few things I've managed to figure out myself:
This bug makes fluidsynth unusable for what I'm trying to do. Any help would be greatly appreciated. Thank you!
prog.zip
EDIT: I forgot to mention I'm using fluidsynth 1.1.6.
The text was updated successfully, but these errors were encountered: