jsfx writing - crossfeed for headphones (error?)
what's the error in following lines
desc:Crossfeed for Headphones
slider1:1000<20,20000>Low Pass Cutoff (Hz)
slider2:0<-60,60,0.1>Make-Up Gain (dB)
in_pin:left input
in_pin:right input
out_pin:left output
out_pin:right output
@init
ext_tail_size = -1;
log2db = 8.6858896380650365530225783783321; // 20 / ln(10)
db2log = 0.11512925464970228420089957273422; // ln(10) / 20
delay = 0.17;
fc = 0;
q = 1;
gain = 1;
@slider
lowpasscutoff = slider1;
gain = exp(slider2 * db2log);
fc = 2 * sin(lowpasscutoff / (2 * srate));
@sample
left = left_input;
right = right_input;
crossfeedl = spl1 * fc;
crossfeedr = spl0 * fc;
spl0 = left + (delay * crossfeedl);
spl1 = right + (delay * crossfeedr);
spl0 *= gain;
spl1 *= gain;
|