pusher

Distortion/limiting algorithm based on frequency-modulating a serial lowpass and highpass filter. The lowpass cutoff frequency is pushed down by the peak-volume of the input signal+gain. The highpass cutoff frequency is pushed up by the peak-volume of the output signal.
Author: Remco van der Most
License: BSD
Github: sss/dist/pusher.axo

Inlets

frac32buffer input

Outlets

frac32buffer output

Parameters

frac32.u.map gain

frac32.u.map LPmod

frac32.u.map HPmod

frac32.s.map.pitch damp

Declaration
int32_t val1;
int32_t val2;
int32_t peak1;
int32_t peak2;
int32_t out;
int32_t hp;
Init
val1 = 0;
val2 = 0;
Control Rate
int32_t f;
int32_t g;
int32_t h;
MTOF(param_damp, h);
Audio Rate
int32_t in =
    (__SSAT((inlet_in + ___SMMUL(param_gain << 3, inlet_in << 2)) >> 3, 27)
     << 3);
hp += ((in - hp) >> 13);
in = in - hp;

MTOF((65 << 27) - (___SMMUL(param_LPmod << 3, peak2 << 3) << 1), f);
MTOF((-65 << 27) + (___SMMUL(param_HPmod << 4, peak1 << 4) << 1), g);

val1 = ___SMMLA((in - val1) << 1, f, val1);
val2 = ___SMMLA((val1 - val2) << 1, g, val2);
out = val1 - val2;
peak1 = ___SMMLA(((out > 0 ? out : -out) - peak1) << 1, h, peak1);
peak2 = ___SMMLA(((in > 0 ? in : -in) - peak2) << 1, h, peak2);
outlet_out = out;

Privacy

© 2024 Zrna Research