Many mixers have an saturation/clipping character when the signal is >0db. This would be nice for EQUIS too, especially as the hardclip we currently use is not pleasant.
just some faust code dump:
import("stdfaust.lib");
superpow(p) = _ <: abs, ma.signum : pow(p), _ : *;
overdrive_inner(expo, treshold, cap, x) = pow((abs(x) - offset), expo) : ma.tanh : pow(1/expo) : (_*cap) : *(ma.signum(x))
with {
offset = overdrive_offset(expo, treshold, cap);
};
overdrive_offset(expo, treshold, cap) = (
treshold - (
pow(
ma.atanh(
pow(
(treshold/cap),
expo
)
),
(1 / expo)
)
)
);
debug(e) = _ <: attach(_, e);
overdrive(expo, treshold, cap, x) = x , overdrive_inner(expo, treshold, cap, x) : select2(abs(x) > treshold);
dbmeter = _ <: attach(_, (ba.slidingRMSp(60, 60) : ba.linear2db : hbargraph("rms[unit:db]", -70, 8)));
gain(g) = _ * ba.db2linear(g);
h = hslider("headroom[unit:db]", 0, -4, 20, 1);
g = hslider("gain[unit:db]", 0, -4, 20, 1);
m = hslider("makeupgain[unit:db]", 0, -4, 20, 1);
expo = hslider("expo", 0.5, 0.01, 2, 0.01);
treshold = hslider("overdrive treshold[unit:db]", 4, -20, 12, 0.001);
cap = hslider("overdrive cap[unit:db]", 2, -20, 12, 0.001) : ba.db2linear : debug(hbargraph("oc", 0, 8));
overdrive_chain = gain(g) : overdrive(expo, treshold : ba.db2linear : debug(hbargraph("ot", 0, 8)), cap) : gain(min(0, treshold) : *(-1) : debug(hbargraph("makeupgain", -10, 10)) : ba.db2linear) ;
process = _ : ba.bypass_fade(ma.BS*4, checkbox("bypass"), overdrive_chain) : gain(-h) : dbmeter <: _,_;
//process = overdrive(hslider("expo", 0.5, 0.01, 20, 0.01), 1.2, -1.5);
//process = hslider("overdrive treshold[unit:db]", 4, -20, 4, 0.001) : ba.db2linear;
Many mixers have an saturation/clipping character when the signal is >0db. This would be nice for EQUIS too, especially as the hardclip we currently use is not pleasant.
just some faust code dump:
```
import("stdfaust.lib");
superpow(p) = _ <: abs, ma.signum : pow(p), _ : *;
overdrive_inner(expo, treshold, cap, x) = pow((abs(x) - offset), expo) : ma.tanh : pow(1/expo) : (_*cap) : *(ma.signum(x))
with {
offset = overdrive_offset(expo, treshold, cap);
};
overdrive_offset(expo, treshold, cap) = (
treshold - (
pow(
ma.atanh(
pow(
(treshold/cap),
expo
)
),
(1 / expo)
)
)
);
debug(e) = _ <: attach(_, e);
overdrive(expo, treshold, cap, x) = x , overdrive_inner(expo, treshold, cap, x) : select2(abs(x) > treshold);
dbmeter = _ <: attach(_, (ba.slidingRMSp(60, 60) : ba.linear2db : hbargraph("rms[unit:db]", -70, 8)));
gain(g) = _ * ba.db2linear(g);
h = hslider("headroom[unit:db]", 0, -4, 20, 1);
g = hslider("gain[unit:db]", 0, -4, 20, 1);
m = hslider("makeupgain[unit:db]", 0, -4, 20, 1);
expo = hslider("expo", 0.5, 0.01, 2, 0.01);
treshold = hslider("overdrive treshold[unit:db]", 4, -20, 12, 0.001);
cap = hslider("overdrive cap[unit:db]", 2, -20, 12, 0.001) : ba.db2linear : debug(hbargraph("oc", 0, 8));
overdrive_chain = gain(g) : overdrive(expo, treshold : ba.db2linear : debug(hbargraph("ot", 0, 8)), cap) : gain(min(0, treshold) : *(-1) : debug(hbargraph("makeupgain", -10, 10)) : ba.db2linear) ;
process = _ : ba.bypass_fade(ma.BS*4, checkbox("bypass"), overdrive_chain) : gain(-h) : dbmeter <: _,_;
//process = overdrive(hslider("expo", 0.5, 0.01, 20, 0.01), 1.2, -1.5);
//process = hslider("overdrive treshold[unit:db]", 4, -20, 4, 0.001) : ba.db2linear;
```