ap1 m

Author: Smashed Transistors
License: LGPL
Github: tiar/pata/ap1 m.axo

Inlets

frac32 rotation angle

frac32buffer in

frac32buffer theta ar

Outlets

frac32buffer output signal

Parameters

frac32.u.map rotation angle

Declaration
int32_t theta;
int32_t Z_1;
Init
theta = 0;
Z_1 = 0;
Control Rate
int32_t dTheta = (inlet_theta_space_kr + param_theta - theta) >> 4;
// jump
if (abs(dTheta) > (1 << 20)) {
  theta = inlet_theta_space_kr + param_theta;
  dTheta = 0;
}
Audio Rate
// linear interpolation of krate theta
theta += dTheta;

uint32_t t = ((uint32_t)(inlet_theta_space_ar + theta)) << 5;
int32_t a = (t & ((1 << 20) - 1)) << 8; // q28
uint32_t i = t >> 20;
int32_t s = ___SMMLA(a, sine2t[i + 1] - sine2t[i], sine2t[i] >> 4);
i = (i + 1024) & 4095;
int32_t c = ___SMMLA(a, sine2t[i + 1] - sine2t[i], sine2t[i] >> 4);

outlet_out = ___SMMLS(Z_1, s, ___SMMUL(inlet_in, c)) << 5;
Z_1 = ___SMMLA(Z_1, c, ___SMMUL(inlet_in, s)) << 5;

Privacy

© 2024 Zrna Research