6dBresLP

6dB Lowpass filter with extra lowpass and highpass filters in the resonance path (creating a bandpass filter). The resonance-frequency can be offset respective to the cutoff frequency The resonance bandwidth can be set with the "width" control. Seperate inputs for pitch, envelope and lfo are added to allow for different responses to these signals for both cutoff and resonance.
Author: Remco van der Most
License: BSD
Github: sss/filter/6dBresLP.axo

Inlets

frac32buffer input

frac32 pitch

frac32 env

frac32 LFO

Outlets

frac32buffer output

Parameters

frac32.u.map gain

frac32.s.map.pitch freq

frac32.s.map envCut

frac32.s.map lfoCut

frac32.s.map res

frac32.s.map envRes

frac32.s.map lfoRes

frac32.s.map offset

frac32.s.map width

Declaration
int32_t val1;
int32_t val2;
int32_t val3;
int32_t val4;
Init
val1 = 0;
val2 = 0;
val3 = 0;
Control Rate
int32_t f;
int32_t g;
int32_t h;
int32_t Freq;
Freq = __SSAT(param_freq + inlet_pitch +
                  ___SMMUL(param_envCut << 3, inlet_env << 3) +
                  ___SMMUL(inlet_LFO << 3, param_lfoCut << 2),
              28);
MTOF(Freq, f);
MTOF(Freq + param_offset - (param_width >> 2), g);
MTOF(Freq + param_offset + (param_width >> 2), h);
// int32_t res=param_res>0?param_res>>1:param_res;
int32_t res = param_res + ___SMMUL(param_envRes << 3, inlet_env << 2) +
              ___SMMUL(param_lfoRes << 3, inlet_LFO << 2);
Audio Rate
val2 = ___SMMLA((val4 - val2) << 1, g, val2);
val3 = ___SMMLA((val4 - val2 - val3) << 1, h, val3);
int32_t sat = __SSAT(val3, 27);
int32_t gain = inlet_in + ___SMMUL(res << 3, sat << 3);
gain += +___SMMUL(gain << 4, param_gain << 4);
gain = __SSAT(gain, 27);
val1 = ___SMMLA((gain - val1) << 1, f, val1);
val4 = ___SMMLA((val1 - val4) << 1, f, val4);
outlet_out = val4;

Privacy

© 2024 Zrna Research