filterSLAVE

THIS MODULE TAKES USE OF THE CODES INSIDE THE "filterCORE" MODULE Add the filterCORE module to provide the codes and refer to it using the Object-reference attribute More then one filter can refer to the codes, so the codes are only added once to save space! type1=normal filters based on cascaded 6dB filters without resonance. Res knob controls cascading/filter mode (HP/LP) type2=SVF filters type3=Biquad filters type4= my own custom filters for type1 counts: 1=cascadable 6dB LP filters. from 0dB slope up to 48dB 2=cascadable 6dB HP filters. from 0dB slope up to 48dB 3=12dB LP-BP-HP morphable based on two 6dB filters 4=18dB LP-BP1-BP2-HP morphable filters based on three 6dB filters for type 2 and 3 counts: 1=LP 2=HP 3=BP 4=NOTCH for type 4 counts: 1=36dB LP with control over cutoff and resonance 2=mostfilter2 LP version with control over cutoff and resonance 3=mostfilter2 HP version with control over cutoff and resonance 4=mostBfilter LP, a new filter which internally boosts the signal to get a more aggressive character
Author: Remco van der Most
License: BSD
Github: sss/filter/filterSLAVE.axo

Inlets

frac32buffer in2

frac32 cut

frac32 res

int32 MT

Outlets

frac32buffer out

Parameters

bool32.tgl allpass

bool32.tgl add

frac32.s.map.pitch cut

frac32.u.map.filterq res

int32.hradio mode

int32.hradio type

Attributes

objref core

Declaration
int i;
biquad_state bs;
biquad_coefficients bc;
int32_t in[BUFSIZE];
int32_t out[BUFSIZE];
int32_t val[8];
int32_t freq;
int32_t pv;
int32_t stp;
int32_t Freq;
int prv;

int32_t v26 = (1 >> 26);
int BUFMASK = BUFSIZE - 1;
int32_t band;
int32_t low;
Control Rate
attr_core.bs = bs;
attr_core.bc = bc;
attr_core.low = low;
attr_core.band = band;
for (i = 0; i < BUFSIZE; i++) {
  attr_core.in[i] = inlet_in[i];
}
attr_core.ALL = (param_allpass + ((inlet_MT >> 4) & 1)) & 1;
int MODE = ((param_mode & 3) + ((param_type & 3) << 2) + inlet_MT) & 15;

if (!(MODE == prv)) {
  for (i = 0; i < 8; i++) {
    val[i] = 0;
  }
}

attr_core.settings(__SSAT(param_cut + inlet_cut, 28),
                   __USAT(param_res + inlet_res, 27), MODE);
Freq = attr_core.Freq;
if ((MODE < 8) || (MODE > 11)) {
  stp = (Freq - pv) >> 4;
  freq = pv;
  pv = Freq;
} else {
  freq = Freq;
}
attr_core.freq = freq;
attr_core.stp = stp;
for (i = 0; i < 8; i++) {
  attr_core.val[i] = val[i];
}

attr_core.filter(MODE);

for (i = 0; i < 8; i++) {
  val[i] = attr_core.val[i];
}

for (i = 0; i < BUFSIZE; i++) {
  int32_t tmp =
      __SSAT(attr_core.out[i], 28) + (param_add > 0 ? inlet_in[i] : 0);
  int32_t ts = __SSAT(tmp, 28);
  int32_t tsq31 = ts << 3;
  int32_t tsq31p3 = ___SMMUL(tsq31, ___SMMUL(tsq31, tsq31));
  outlet_out[i] = ts + (ts >> 1) - (tsq31p3);
}
prv = MODE;
bs = attr_core.bs;
bc = attr_core.bc;
low = attr_core.low;
band = attr_core.band;

Privacy

© 2024 Zrna Research