(SOLVED) Plugin LFO working correctly in Ableton, but not FL studio

Hey guys, I’m working on a tempo synced lfo class for a plugin I’m working on. It’s working 100% normal in ableton, but in FL studio it is running about 3/4 times too quickly.

For context there are several of these LFO running, one is processed in the buffer loop, the other once per process block. The lfo that is processed in the buffer loop runs correctly in fl studio, but the one that is processed once per process block is running fast. Both types of lfo are running correctly in ableton though.

I’ve confirmed that both ableton and fl are running at 44100 hz and 512 buffer size, but that shouldn’t even matter because my code is getting sample info from the host and nothing is hard coded.

Anyone have any thoughts on why this might be happening? I’m thinking it’s something to do with fl settings but I don’t know what.

I don’t know if you do, but you can not assume that the max buffer size you get in prepareToPlay() is the one you will always get in processBlock(). It’s just the max you’ll ever get. FL Studio is notorious for supplying varying buffer sizes, so if you use the max buffer size to calculate your LFO advance instead of the real buffer size in each process call, it will go faster than planned (and probably a bit shaky).

2 Likes

Yep, FL studio can go down to 1 sample sized blocks! Yes, 1 sample.
I find it best to treat processing like a continuous stream of data, so calculations are all based on sample counts, not blocks.

1 Like

Oh interesting, I was not aware of FL doing that. Thanks for the advice!

Update: I added an option for the LFO to use the actual buffer size which is provided from the function call in the processblock as a parameter, and it works!