Bandpass_amplitude

Dual bandpass filter, state-variable type, modulation inputs. A version without resonance in subtracted from a version WITH resonance, leaving mostly the resonance. Then both the filter without resonance and the resonance-only signal's amplitude get multiplied by respectively presence and emphasis. You have thus independent control over the amplitude of the filtered signal as well as the resonance! Resonance path has saturation, creating grit here and there.
Author: Remco van der Most
License: BSD
Github: sss/filter/Bandpass_amplitude.axo

Inlets

frac32buffer filter input

frac32 pitch

frac32 presence

frac32 resonance

frac32 emphasis

Outlets

frac32buffer filter output

Parameters

frac32.s.map.pitch pitch

frac32.s.map presence

frac32.s.map emphasis

frac32.u.map.filterq reso

Declaration
int32_t low1;
int32_t band1;
int32_t low2;
int32_t band2;
int32_t frac;
Init
low1 = 0;
band1 = 0;
low2 = 0;
band2 = 0;
Control Rate
int32_t damp1 = (0x80 << 24) - (__USAT(inlet_reso + param_reso, 27) << 4);
damp1 = ___SMMUL(damp1, damp1);
int32_t alpha;
int32_t freq;
MTOFEXTENDED(param_pitch + inlet_pitch, alpha);
SINE2TINTERP(alpha, freq);

int32_t damp2 = (0x80 << 24) - (10 << 25);
damp2 = ___SMMUL(damp2, damp2);
Audio Rate
frac = frac + ((freq - frac) >> 8);
int32_t resonance1 = __SSAT((___SMMUL(damp1, band1) >> 1), 28);
int32_t notch1 = __SSAT(inlet_in - resonance1, 28);
low1 = __SSAT(low1 + (___SMMUL(frac, band1) << 1), 28);
int32_t high1 = __SSAT(notch1 - low1, 28);
band1 = (___SMMUL(frac, high1) << 1) + band1;
int32_t out1 = band1;

int32_t resonance2 = __SSAT((___SMMUL(damp2, band2) >> 1), 28);
int32_t notch2 = __SSAT(inlet_in - resonance2, 28);
low2 = __SSAT(low2 + (___SMMUL(frac, band2) << 1), 28);
int32_t high2 = __SSAT(notch2 - low2, 28);
band2 = (___SMMUL(frac, high2) << 1) + band2;
int32_t out2 = band2;

int32_t resa = out1 - out2;
outlet_out = ___SMMUL(-out2 << 3, (param_presence + inlet_presence) << 2) +
             ___SMMUL(resa << 3, (param_emphasis + inlet_emphasis) << 2);

Privacy

© 2024 Zrna Research