leomccormack / SPARTA

A collection of spatial audio related VST/LV2 plug-ins developed using JUCE and the Spatial_Audio_Framework
http://leomccormack.github.io/sparta-site/
GNU General Public License v3.0
558 stars 43 forks source link

Why need to set frame size to multiple of 128? #55

Open DBraun opened 2 years ago

DBraun commented 2 years ago

For ambiBIN, is it necessary to require the frame size to be a multiple of 128?

https://github.com/leomccormack/Spatial_Audio_Framework/blob/e32c6ec8f1e87fa6360aa75725b3073d02fef1c4/examples/src/ambi_bin/ambi_bin.c#L408 and https://github.com/leomccormack/SPARTA/blob/b696ecbd9c9323c47b61147e349a3f014afcf57b/audio_plugins/_SPARTA_ambiBIN_/src/PluginProcessor.cpp#L289

2022-03-02 11_01_41-

I'm trying to use the plugin in a real-time environment, and I think it has a fluctuating non-standard block size. If the audio rate is 44100, and the video rate of the environment is 60, then the requested number of samples is 735, and this is not a multiple of 128.

leomccormack commented 2 years ago

Hi, apologies for the delayed response. As the plugin is written now, the framesize of a multiple of 128 is strict.

Note that this isn't the case for all SPARTA plugins. E.g. the sparta_powermap will accept any block sizes by feeding/reading from FIFO buffers. However, this incurs some additional latency. For e.g. sparta_ambiBIN, responsiveness was deemed to be more important than having the flexibility of the FIFO buffers. Here, the input 128 sample frames and processed right-away. Any excess samples are instead zeroed.

However, having both options would be ideal.... However, I've not managed to get around to this yet, so actually if anyone is willing to give this a go, then I can offer some guidance along the way : )

DBraun commented 2 years ago

Thanks, just wanted to mention that implementing setNonRealtime() could help get the best of both worlds (FIFO when real-time mode and fixed block size when non-real-time).

mdedwards commented 10 months ago

Hello, I think I'm getting this error when using the Panner VST. I can't be sure as it only flashes up for a fraction of a second every so often. I don't see anywhere to set frame size. Best, Michael