Switching between algorithms

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi guys,
sometimes what looks the easiest can just drive you crazy :lol:

Basically, I'm trying to find a way to remove a loud pop I get when I change between algorithms.
In my processBlock I have something like that, on sample level.

Code: Select all

switch(algoType)
{
  case 0:
     doThis();
     break;

 case 1:
   doThat();
   break;
}
I tried with a fade out (on the block) -> processing -> fadeIn, but it's not helping very much. I also tried a DC block, but without any luck. I want to avoid to have fill another buffer and crossfade between them, becase some algorithms can be a bit heavy on the CPU.

Any hint?

Thanks,
Luca

Post

If fade in/out does not work, it's implemented incorrectly because there is no other way that it could fail.
~stratum~

Post

Audiority wrote: I tried with a fade out (on the block) -> processing -> fadeIn, but it's not helping very much. I also tried a DC block, but without any luck. I want to avoid to have fill another buffer and crossfade between them, becase some algorithms can be a bit heavy on the CPU.
There's no magic solution to this problem, sadly.

Post

If your algorithms have any filters inside them, you should probably reset their state them before using that algorithm again.

Post

Fade out/fade in should work. You may still hear an artifact, but it shouldn't pop or click. Play with the timing of each, some waves can do 1ms, but sine waves are really nasty for this and need more time.

Otherwise, crossfade. ;)
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post

I'd say fade-in/fade-out should be at least somewhere around 0.2s (longer->better, personally I'd go for 0.5s) otherwise it's still a click (just softer).

Post

When you switch, the new algorithm should be reset. Then, you process both old algorithm and new algorithm at the same time for a given duration (50 ms at least) with fade out for old and fade in for new. Doing so should attenuate enough any pop / click.

Post

I personally use a little trick which works depending on the case, i don't fade in/out, i initialize a variable to the value of the last sample and make it decay exponentially, it's mixed with the output.
Very probably won't work for everything but in my specific case it does a good job.

Post

Thank you guys!

Post

Have you considered that the pop/click sound could simply be caused by excessive CPU load? ... Just a stab in the dark.

Post

thanks, but i'm sure it's not that.

Post

It would help to know what the two algorithms in your example are doing. A crossfade should work, by fading to silence and then fading to the new algorithm.

Post Reply

Return to “DSP and Plugin Development”