3cousins

Same topology as 3 sisters eurorack filter module, but no effort is done to make it sound like it. Also added some extra individual controls for the three seperate bands. All three filters have a resonance feedback control that goes in two directions. Negative values will create a lot of distorting resonance at high settings and gives a "fat ring" Positive values have a thinner resonance attitude.
Author: Remco van der Most
License: BSD
Github: sss/filter/3cousins.axo

Inlets

frac32buffer input to all filter inputs

frac32buffer input for highpass filter

frac32buffer input for bandpass filter

frac32buffer input for lowpass filter

frac32.bipolar main center frequency

frac32.bipolar span

frac32.bipolar works only when smode it higher then 0

frac32.bipolar works only when smode it higher then 0

frac32.bipolar works only when smode it higher then 0

Outlets

frac32buffer summed output of all filters

frac32buffer highpass filter output

frac32buffer bandpass filter output

frac32buffer lowpass filter output

Parameters

frac32.u.map at zero, span depends on span parameter, when high, fades in input frequencies (eg for vowel frequencies)

frac32.u.map fades highpass filter into a bandpass filter

frac32.u.map fades lowpass filter into a bandpass filter

frac32.u.map fades from full bandwidth to narrow bandwidth for all 3 filters (for high and lowpass this also means different slopes if they're in low/highpass mode)

frac32.s.map.pitch center frequency

frac32.s.map spans low and high frequencies

frac32.s.map resonance amount for lowpass

frac32.s.map resonance amount for bandpass

frac32.s.map resonance amount for highpass

Declaration
int32_t lp[4], hp[4], bp[4], span[3];
int32_t flp, fhp, fbp;
int32_t v27 = 1 << 27;
int i;
Control Rate
int32_t lfrq, blfrq, bhfrq, hfrq;
int32_t fofs[3];
int32_t spn = __SSAT(param_span + inlet_span, 28);
fofs[0] = inlet_lfrq;
fofs[1] = inlet_bfrq;
fofs[2] = inlet_hfrq;
span[0] = -spn;
span[1] = 0;
span[2] = spn;
for (i = 0; i < 3; i++) {
  span[i] += ___SMMUL(param_smode, fofs[i] - span[i]) << 5;
}
int32_t pitch = __SSAT(param_pitch + inlet_pitch, 28);
MTOF(__SSAT(pitch + span[0], 28), lfrq);
MTOF(__SSAT(pitch + span[2] - (___SMMUL(span[2], param_bandQ) << 5) + span[1],
            28),
     blfrq);
MTOF(__SSAT(pitch + span[0] - (___SMMUL(span[0], param_bandQ) << 5) + span[1],
            28),
     bhfrq);
MTOF(__SSAT(pitch + span[2], 28), hfrq);
int32_t lbfrq, hbfrq;
int32_t bandQ = v27 - param_bandQ;
int32_t width = ___SMMUL(-v27 - pitch, bandQ) << 5;
MTOF(__SSAT(pitch + span[0] + width, 28), lbfrq);
width = ___SMMUL(v27 - pitch, bandQ) << 5;
MTOF(__SSAT(pitch + span[2] + width, 28), hbfrq);
Audio Rate
int32_t tmp = inlet_all + inlet_low + flp;
int32_t in = tmp;
for (i = 0; i < 4; i++) {
  lp[i] += ___SMMUL(tmp - lp[i], i & 1 ? lbfrq : lfrq) << 1;
  if (i & 1) {
    tmp = lp[i] + (___SMMUL(tmp - (lp[i] << 1), param_lowmode) << 5);
  } else if (!(i & 1)) {
    tmp = lp[i];
  }
  if (i == 1) {
    flp = ___SMMUL(__SSAT((param_lowres > 0 ? in : 0) - tmp, 27), param_lowres)
          << 6;
  }
}
outlet_low = tmp;
int32_t low = tmp;
tmp = inlet_all + inlet_band + fbp;
in = tmp;
for (i = 0; i < 4; i++) {
  if (i & 1) {
    bp[i] += ___SMMUL(tmp - bp[i], bhfrq) << 1;
    tmp -= bp[i];
  } else if (!(i & 1)) {
    bp[i] += ___SMMUL(tmp - bp[i], blfrq) << 1;
    tmp = bp[i];
  }
  if (i == 1) {
    fbp =
        ___SMMUL(__SSAT((param_bandres > 0 ? in : 0) - tmp, 27), param_bandres)
        << 6;
  }
}
outlet_band = tmp;
int32_t band = tmp;
tmp = inlet_all + inlet_high + fhp;
in = tmp;
for (i = 0; i < 4; i++) {
  hp[i] += ___SMMUL(tmp - hp[i], i & 1 ? hbfrq : hfrq) << 1;
  if (i & 1) {
    tmp = tmp - hp[i] + (___SMMUL((hp[i] << 1) - tmp, param_highmode) << 5);
  } else if (!(i & 1)) {
    tmp -= hp[i];
  }
  if (i == 1) {
    fhp =
        ___SMMUL(__SSAT((param_highres > 0 ? in : 0) - tmp, 27), param_highres)
        << 6;
  }
}
outlet_high = tmp;

outlet_all = low + band + tmp;

Privacy

© 2024 Zrna Research