Sidechain gating. For real.

Hi there,

I was obsessed by the one feature I really miss in Renoise 3.1, sidechaingate. I found a simple enough solution that works fine for me using a Formula device. I thought I’d share it here if anyone else is interested.

The setup is quite simple: a signal follower on the sidechain source track and a formula+gainer on the destination track. SF targets the A parameter in the formula and the formula targets the gainer’s gain. I put the gate threshold in the B parameter and here is the code to put in (and finetune to taste):

-- parameters
local low = .75 * db2lin(-40)
local hi = .75 * db2lin(0)
local attack = .8
local release = .04

-- actual code
local tgt = {[false]=low, [true]=hi}
local spd = {[false]=release, [true]=attack}
local state = low

function interp(v, t, c)
  return v + (t - v) * c
end

function gate(v, t)
  local above = v > t
  state = interp(state, tgt[above], spd[above])
  return state
end

And the output code is simply:

y = gate(A, B)

There are probably some much better sounding attack/release slopes to use here and much optimization to make, I just didn’t bother but I’ll take any suggestion of improvements :slight_smile:

I love Formula. I love Renoise. :smiley:

Happy new year everyone!

Edit: had forgotten to include the output code.

You forgot to include the code for the output.

y = ???

D’oh! My bad.

y = gate(A, B)

I’m going to edit the original post to fix this. Thanks :slight_smile:

Maybe you can include a quick demo song to show it in action?

Would be useful to see how you typically set it up and what kind of sounds you use.

Well, here goes nothing…

It was the brilliant occasion to make a better version of it into a doofer. It took me a while to figure out a way to work around the three-parameter limitation in the Formula but that made me implement it in stages and it’s much cleaner this way, with all controls in the front (threshold, output level, floor, attack, release).

It’s a very short demo, I hope it answers some of your questions :slight_smile:

https://drive.google.com/file/d/1Kmwf8BT09HdSFcsslad0KLh3jIavcmtH/view?usp=sharing

Edit: file was too big to upload… fixed attachment