Simple fake sidechain

MrCanvas

Well-known member
I wanted to implement a basic sidechain effect in a groove box project. However I have limited experience with the concept in practice (more than just enjoying how well others use it in their mixes).

What do you think of this simple way to fake the effect using a triggered envelope through a multiplier? The envelope can be triggered when a "source" receives a noteOn for example and each voice can easily be set to respond to specific sources.

Capture.PNG

Sure, I can see many potential problems. Probably the envelope need to be much smoother for one? But so far it sounds ok at least (tested with a droning base note and triggered a kick sample manually). What do you think? Is there a better way to do it?

Cheers, Daniel
 
And yes, using peak on the sidechain source to set mixer levels for the targets would be an obvious alternative. I just cant get that to sound as ok, not sure what latency could be expected from such an implementation.
 
Just to follow up, this super simple stuff is enough to get a convincing and useable sidechain effect. Put it at the end of your audio pipeline and call trigger(), for example when you receive midi data for the kick. The parameters (level, attack, hold, release) should be tuned to your bpm and desired effect.

C++:
class SideChain
{
  private:
    AudioSynthWaveformDc     _dc;
    elapsedMillis            _timer;
    AudioConnection  *   _patchCords[2];
    void _release();
    bool _isActive = false;
  public:
    SideChain();
    float level = 0.0;
    float attack = 0.0;
    float hold = 0.0;
    float release = 0.0;
    AudioEffectMultiply      left;
    AudioEffectMultiply      right;
    void trigger();
    void update();
};

SideChain::SideChain()
{
  _patchCords[0] = new AudioConnection(_dc, 0, left, 1);
  _patchCords[1] = new AudioConnection(_dc, 0, right, 1);
  _dc.amplitude(1.0);
}

void SideChain::trigger()
{
  _timer = 0;
  _dc.amplitude(1.0 - level, attack);
  _isActive = true;
}

void SideChain::_release()
{
  _dc.amplitude(1.0, release);
  _isActive = false;
}

void SideChain::update()
{
  if (_isActive && _timer > hold) _release();
}
 
Back
Top