Hi folks. I’m working on implementing auxiliary outputs into my plug-in.
Just to give a brief overview, my plug-in is delay/loop-based and has a number of AudioSampleBuffers under the hood. What I’m trying to implement is a dedicated auxiliary output for each AudioSampleBuffer, for the user’s convenience.
In prepareToPlay, I call setSize for the AudioSampleBuffers (using the sampleRate to calculate their proper maximum size), and in releaseResources I null them out by setting setSize(0, 0).
I’ve got the auxiliary outputs working fine, and I can see the outputs in Ableton and monitor them. What I’m noticing, however, is that when I start monitoring one of the outputs, releaseResources and prepareToPlay are called. The end result is that the contents of the AudioSampleBuffer get dumped, which seem like a poor user experience.
My question is basically this:
-
Is it wise to skip releaseResources/prepareToPlay in some cases? Is there a proper way to identify that there was no real change, and to avoid dumping the contents of the Buffers in this case?
-
Alternatively, am I misusing prepareToPlay and releaseResources for setting up my Buffers? Is there a better way to properly identify the lifecycle of the plug-in, since prepareToPlay/releaseResources can be called while the plug-in is still running?
