Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Compander coded with ugens
name
code content
(//compander -> amplitude n=Ndef(\ct,{ //var sig=SinOsc.ar*(1-LFSaw.ar(1,0,0.5,0.5)); var sig=SinOsc.ar*(1-LFPulse.ar(1)); var inputspecs=[ Spec.add(\clampTime, [0.00001, 10,\exp,0,0.05]); Spec.add(\clampTime2, [0, 1,\lin,0,0.05]); Spec.add(\relaxTime, [0.00001, 60,\exp,0,1]); Spec.add(\compression, [0.01, 1,\lin,0,0.1]); Spec.add(\slopeBelow, [0.01, 10,\lin,0,0.1]); Spec.add(\slopeAbove, [0.0001, 1,\lin,0,0.25]); ]; var t=\thresh.kr(0.75); var ct=\clampTime.kr(0.05); var rt=\relaxTime.kr(1); var slopeBelow= \slopeBelow.kr(1); var slopeAbove= \slopeAbove.kr(0.9); var a=Amplitude.ar(sig,ct,rt); var prevmaxval=a.abs; var lg1=pow(prevmaxval / t, slopeBelow - 1); var absx = lg1.abs; var lg=if((absx < 1e-15),0,if((absx > 1e15),1,lg1)); var ag=pow(prevmaxval / t, slopeAbove - 1); var next_gain=if (prevmaxval < t,lg,ag); var cp=Compander.ar(sig,sig,t,slopeBelow,slopeAbove,ct,rt); Out.ar(0,[sig * next_gain,cp]); }); n.gui; ) s.scope(bufsize:2**14)
code description
I am not sure if anybody else is interested in such a thing but i think it is cool be able to look inside the working of compander inside of SuperCollider. leftchannel=different UGens rightchannel=Compander.ar
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change