Gating sidechain 0 to 1

hi everyone,
SuperCollider keeps entertaining my time thanks to every voice here.

I have this request I tried different versions but unsuccessful until now
I made a screenshot from an ableton function that I am trying to reproduce

here I gate sidechained channel 10 to channel 11 and it wont play 11 unless 10 goes below -33.6 db

I tried using Amplitude.ar to get a similar result but only managed using .linlin to reduce volume but not to zero ( or at least a volume so low that cannot be heard)

and i cannot get the volume to go 100% when sidechain (10) is low enough

hope this message make sense :joy:

thanks =)

Compander’s control signal input is the sidechain input. (“Control” as in “controls the volume,” not “control rate” – it should be audio rate.)

Also, to use Compander as a gate, set slopeBelow to a high number, and slopeAbove to 1.

hjh

1 Like

thank you ^^ James !!

i ll try different output but i think it needs to be reversed as compressed signal only plays when ctrl is loud

reddit: I tried negative values for slopeBelow or slopeAbove and using 0 for one of them at the time without success.

reddit2: my threshold was 0.01 its working with 1, thanks !!

reddit 3 : my bad it stil only plays if volume of control is high when I would like the opposite that it shuts when control volume is high.

reddit4: ok I just re-learnt compression, trying again, compressing signals to get sidechained to go quiet when control is loud

after multiple testings it is still not working I am starting to wonder if Compander might not be the right tool to use, it works well sidechaining signal like kicks or short length noise but not for using longer note sidechained to other signals

I ll use an example, Amplitude based, given by James early this year.

thank you

Hi,
maybe im missing the point, but this works for me

(
{
var samp = WhiteNoise.ar(LFDNoise1.kr(1));
var osc = SinOsc.ar([400,401]);

osc-Compander.ar(osc,samp,0.1,12,1)

}.play;
)

im not too sure but I think it only plays when ctrl plays im trying to get a reverse effect that it plays when ctrl does not.

thanks anyway =)

Like this?

~sidechain = Bus.audio(s, 1);

(
a = {
	var sig = SinOsc.ar(440);
	var trig = Dust.kr(1.2);
	var ampLFO = ToggleFF.kr(trig) * 0.1 + 0.02;
	sig = sig * ampLFO;
	Out.ar(~sidechain, sig);
	Out.ar(0, sig.dup)
}.play;
)

(
b = {
	var sig = LFTri.ar(LFDNoise3.kr(3).exprange(200, 800));
	var ctl = In.ar(~sidechain, 1);
	
	sig = Compander.ar(sig, ctl,
		thresh: 0.05, slopeBelow: 1, slopeAbove: -50,
		clampTime: 0.05, relaxTime: 0.1
	);
	
	(sig * 0.1).dup
}.play(target: a, addAction: \addAfter);
)

b's signal definitely gets suppressed when a is making sound, and it passes through when a is quiet.

hjh

1 Like

thats is it !! thank you

it does your reverse effect.

(
{
var samp = Decay.ar(Impulse.ar(1),0.1)*WhiteNoise.ar(1);
var osc = SinOsc.ar([400,401]);

(osc-Compander.ar(osc,samp,0.01,12,1,0.01,0.2))+samp
}.play;
)
but this is better:
(
{
var samp = Decay.ar(Impulse.ar(1),0.1)*WhiteNoise.ar(1);
var osc = SinOsc.ar([400,401]);

Compander.ar(osc,samp,0.01,1,-12,0.01,0.2)+samp
}.play;
)

1 Like