hi,

i need help with getting a program of mine to work. i'm trying to design a 
compressor based on the implementation details given in this: 
https://www.mathworks.com/help/audio/ref/compressor-system-object.html but for 
some reason my implementation isn't working correctly

here's my code, don't mind the redefiniton of ifNc (i'm working with an older 
version of faust)

import("stdfaust.lib");

ifNc((c,r)) = c,r:ifNc(outputs(r)/2);
ifNc(1) = ba.if;
ifNc(n) = _,_,ifNc(n-1):ifNc(1);

comp_gain_computer(thres,ratio,knee,in) = ifNc(2,
2*(in-thres)<-knee,in,
2*(abs(in-thres))<=knee,in+(((1/(ratio-1))*((in-thres+(knee/2))^2))/(2*knee)),
thres
);

comp(thres,ratio,knee,attack,release) = 
_<:_,(ba.linear2db<:(_*-1,comp_gain_computer(thres,ratio,knee):>+):si.onePoleSwitching(release,attack):ba.db2linear):>*;

process = os.lf_sawpos(50):comp(-10,20,10,0,0);

i have the attack and release turned to zero for testing. if you look the 
oscilloscope in the faust ide you'll see the saw wave isn't shaped correctly, 
and i can't figure out why

would someone take a look? thanks!
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to