-
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
fluid_sequencer_set_time_scale causes timing problems #195
Comments
Yes, the smallest unit fluidsynth is able to render are 64 audio frames. Given a samplerate of 48kHz this makes about 1ms.
The logic behind that seems to be correct. To avoid misunderstandings: Even if you would change the scale to 1280 (or to 640 and halve the delays), wont give you any higher resolution (although
it will actually happen at 0ms, because being casted to int (yeah, it should probably happen at 1ms to reduce the error...). So as I understand this concept, using
From my understanding, timing problems might occur, because of double to int casts internally. Whether they're hearable or not probably depends a lot on the scale used (smaller scales make timing troubles more likely, right?). Also I dont see what could make notes to be eaten. But apparently this is the case, so this seems to be a bug. |
I looked into this issue a little further and found
First it gets the current tick into
If the time scale is decreased by |
Oh, nice spot, seems to be comprehensible. I however wont be able to have a closer look at this for the next days. Feel free to make a PR (maybe we should re-scale |
Yes, I think doing |
I'm using FluidSynth's sequencer and recently got a problem. I need to change the time scale several times and then send note events. I have noticed
fluid_sequencer_set_time_scale
limits scale<=1000, but I need to work on 1280 ticks/s. As a workaround, I reduced both the scale and the delays between events to one half, that is scale=640. So the situation is first I set the time scale to 960, then change it to 640, and finally play several notes. However, the timing is not correct and some of the notes seem to be eaten! I've no idea how this could happen.Here is the code which can reproduce the problem. Using
#define REMOVE_SCALE_LIMIT 0
will demostrate the problem. If the limit influid_sequencer_set_time_scale
is removed and#define REMOVE_SCALE_LIMIT 1
is used, there will be no such problem.play.zip
I've tested it on MSYS2 MinGW-w64 and Ubuntu 16.04 x86_64 using the 1.1.6 release and the latest commit on GitHub.
The text was updated successfully, but these errors were encountered: