3xPara

Dual Mode-morphing state-variable-filter. -Using a saw-wave LFO as input for the ModeX(1/2/A) creates a quadrature reading through: LP->BP->HP->Notch->LP ModeX1 and ModeX2 will control the modes of filters 1 and 2 respectively. ModeXA controls both modes at the same time. -depending in which input you send your audio, it will respond differently: -in1->normal response -in2->inversed filter response at filter 1, normal for filter 2 -in3->only send to filter 2 as inverse filter response -modeY1 controls the offset from the center, this control has an inversed response, meaning, a high input will force the mix to a centered mix of all filter modes. When above 64, it will inverse the filter responses, turning LP to HP, HP to LP, BP to Notch and Notch to BP. -SerialSel controls the amount of each audio input to be send to filter2 input when serial mode is mixed in. -SerPar mixes between serial and parallel mode for filter 1 and 2. -drive controls the drive over the resonance (BP filter part that influences the other filters)
Author: Remco van der Most
License: BSD
Github: sss/filter/3xPara.axo

Inlets

frac32buffer filter input

frac32 C1

frac32 B1

frac32 G1

frac32 C2

frac32 B2

frac32 G2

frac32 C3

frac32 B3

frac32 G3

Outlets

frac32buffer filter output

Parameters

frac32.s.map.pitch C1

frac32.s.map.pitch C2

frac32.s.map.pitch C3

frac32.u.map.filterq B1

frac32.u.map.filterq B2

frac32.u.map.filterq B3

frac32.s.map G1

frac32.s.map G2

frac32.s.map G3

frac32.s.map gain

Declaration
int32_t low[3];
int32_t band[3];
int32_t OUT[3];
int32_t freq[3];
int32_t Damp[3];
int32_t G[3];
int i;
int32_t config(int32_t pitch, int32_t reso, int32_t Gain, int Inst) {
  int32_t damp = (0x80 << 24) - (reso << 4);
  damp = ___SMMUL(damp, damp);
  Damp[Inst] = damp;
  int32_t alpha;
  MTOFEXTENDED(pitch, alpha);
  SINE2TINTERP(alpha, freq[Inst]);
  G[Inst] = Gain << 2;
}

int32_t SVF(int32_t in1, int32_t Freq, int32_t damp, int32_t gain,
            int32_t Inst) {
  int32_t notch = in1 - __SSAT((___SMMUL(damp, band[Inst]) << 1), 29);
  low[Inst] = low[Inst] + __SSAT((___SMMUL(Freq, band[Inst]) << 1), 29);
  int32_t high = notch - low[Inst];
  band[Inst] = (___SMMUL(Freq, high) << 1) + __SSAT(band[Inst], 27);
  OUT[Inst] = ___SMMUL(band[Inst] << 3, gain << 2);
}
Init
for (i = 0; i < 3; i++) {
  low[i] = 0;
  band[i] = 0;
}
Control Rate
config(inlet_C1 + param_C1, __USAT(param_B1 + inlet_B1, 27),
       inlet_G1 + param_G1, 0);
config(inlet_C2 + param_C2, __USAT(param_B2 + inlet_B2, 27),
       inlet_G2 + param_G2, 1);
config(inlet_C3 + param_C3, __USAT(param_B3 + inlet_B3, 27),
       inlet_G3 + param_G3, 2);
Audio Rate
int32_t IN1 = inlet_in1;
int32_t out;
SVF(IN1, freq[0], Damp[0], G[0], 0);
SVF(IN1, freq[1], Damp[1], G[1], 1);
SVF(IN1, freq[2], Damp[2], G[2], 2);
out = OUT[0] + OUT[1] + OUT[2] + IN1;
outlet_out = out + ___SMMUL(param_gain << 4, out << 1);

Privacy

© 2024 Zrna Research