Noise-free plugin load/unload and state transition

Hi All,

I’m developing some VST3/AU plugins on SDK 3.7.3.

I’m currently working on adding the plugins smooth and noise-free processing during the load/unload and state transition phases.
No big problems in adding a smooth fade-in, triggered in the setActive(true), that permits to properly fade the first processed buffers. As result I get a nice and smooth patching while hosts are playing or similarly a good re-activation (after the plugin has been deactivated).
In other words, the setActive(true) method is called before the first audio buffers are processed.

BUT…

How could I know if the plugin is going to be removed/deleted/deactivated and permit me to apply a fade-out to the last processed buffers?
The setActive(false) method is called after the last buffers are processed.
Is there a method/event I could use to trigger the fade-out before the plugin is removed? This would permit to process and apply a fade-out before to the last audio buffers before the plugin is unloaded.

Hope this is clear enough :wink:

Thanks in advance,
Andrea

I don’t think it is possible to know that it is the last buffer.

That being said, I am not entirely sure why you would care too much. Removing a plugin is clearly a user voluntary triggered action that is not really part of the song (it is not like you can automate removing a plugin for example). So the fact that the change is sudden and not nice will always be expected behavior…

Even if you knew it was the last buffer, I don’t think that one buffer would change this fact. For example if your plugin was lowering the volume by 15dB on a channel and you suddenly remove it, whether it is one buffer or more you are going to have a 15dB jump in volume when you remove it…

Thank you for your reply. Yes, I also think that it is not possible to intercept the last buffers sent to the plugins.
There are too many plugins that produce orrible weird, zipper noises, crackles and so on when they are loaded/unloaded or they change state from active to inactive (or viceversa) while the hosts are playing. Specially if they use delay lines and require latency compensation.
I don’t like this. Now our plugins load smoothly without noises but unloading is still a problem.
Thanks again!

I think that this is the responsibility of the host to fade in and fade out the audio stream when adding or removing an effect.

Hi Arne,
yes, I agree, you are completely right. Hosts should do that.
But unfortunately most of them do not. So we are trying to mitigate the bad effects when adding or removing a plugin (or in state transition). So, now I have a graceful fade in when adding a plugin but it’s not the same when removing it :unamused: