Loading Wavs into plugin while its processing


I built a simple convolution plugin, but I’m trying to change the impulse response (that is in a wav file) while it its running. But I’m having synchronization issues between the processor thread and the editor, I’m opening a file chooser in the editor thread and calling a function in the processor to load the new impulse. What is the best way to do this? I tried using locks and flags without success.


You will have to do this on a background thread. Prepare everything in memory, until it is ready to use. Then you set a flag for the processor, which can then hot-swap in processBlock from the old to the new convolution.
It’s best to write it a way, that you can apply the old and the new convolution separately, so you can crossfade the old and the new signal.


Thanks!!! it worked like a charm.