I’d like to ask what the best practice is for updating a large number of AudioParameters.
Is it acceptable to do this in the processBlock method, or is it too expensive (we’re talking about around 2000 parameters at 64 samples)? When I’ve tried updating the parameters outside of processBlock, I’ve encountered crashes and/or interruptions in the audio thread. To mitigate this, I moved the loop into a MessageManager::callAsync, but even so, the app occasionally (though rarely) crashes.
Do you have any suggestions on how to handle this safely and efficiently?
I think the above code is safe on the message thread. But I am not sure whether it is a good idea to let message thread handles something like 2000 parameter changes pre 64 samples. And during offline rendering (even during online playback) you may lose some updates.
It’s hard to imagine those 2000 parameters are individually meaningful, so I’d think there’s probably some structure to them (like arrays or matrices). In that case making individual parameters for each element is probably overkill. Rather use a custom data structure to hold those in a way that makes sense for the DSP part and use e.g. some double buffering mechanism or similar to communicate it safely from GUI to DSP?