ZDF SK35

Author: Smashed Transistors
License: LGPL
Github: tiar/filter/ZDF SK35.axo

Inlets

frac32buffer filter input

frac32 pitch

frac32 filter resonance

Outlets

frac32buffer filter output

Parameters

frac32.s.map.pitch pitch

frac32.u.map Q

Declaration
int32_t u, y;
Init
u = y = 0;
Control Rate
float Q = __USAT(param_Q + inlet_reso, 27) * (15.0f / (1 << 27));
Q = 2.0f - 1.0f / (0.1f * Q * Q + 0.5f) + 0.000015f * Q * Q * Q;

uint32_t alpha;
MTOFEXTENDED(param_pitch + inlet_pitch - (525 << 14), alpha);
float Freq = arm::q_to_float(alpha, 32);
Freq *= (1.0f / 32);

float a = Freq;
float b = 1 - Freq;
float c = -Freq * Q;
float e = Freq;

for (int i = 0; i < 8; i++) {
  float ce = c * e;
  a = a * (1 + b) + c * (1 - b) - ce;
  float bbc = b + b - c;
  b = b * b + ce;
  c *= bbc;
  e *= bbc;
}
int32_t A = arm::float_to_q(a, 27);
int32_t B = arm::float_to_q(b, 27);
int32_t C = arm::float_to_q(c, 27);
int32_t E = arm::float_to_q(e, 27);

int32_t F = B - C;
int32_t D = (1 << 27) - B - E;

for (int i = 0; i < BUFSIZE; i++) {
  y = __SSAT(y, 30);
  int32_t nu =
      __SSAT(___SMMLA(A, inlet_x[i], ___SMMLA(B, u, ___SMMUL(C, y))) << 5, 30);
  outlet_lp12[i] = y = ___SMMLA(D, inlet_x[i], ___SMMLA(E, u, ___SMMUL(F, y)))
                       << 5;
  u = nu;
}

Privacy

© 2024 Zrna Research