bool32 active
bool32.rising reset
frac32.bipolar pitch
frac32buffer.bipolar axis x
frac32buffer.bipolar axis y
frac32.u.map freq
frac32.s.map s
frac32.s.map r
bool32.mom err
float x;
float tx;
float y;
float ty;
float z;
float tz;
float s;
float r;
float b;
float dt;
int res;
x = 0.1;
y = 0.1;
z = 0.1;
s = 10.0;
r = 28.0;
b = 2.66;
dt = 41;
res = 0;
int32_t freq;
MTOFEXTENDED(param_freq + inlet_pitch, freq);
if (inlet_active > 0) {
tx = s * (y - x);
ty = (r * x) - y - (x * z);
tz = (x * y) - (b * z);
x = x + tx * 1 / dt;
y = y + ty * 1 / dt;
z = z + tz * 1 / dt;
outlet_x = (int32_t)(x * (1 << 22));
outlet_y = (int32_t)(y * (1 << 21));
dt = 41 + (freq >> 20);
s = 10 + (param_s >> 24);
r = 28 + (param_r >> 23);
}
else {
outlet_x = 0;
outlet_y = 0;
}
if (((inlet_reset > 0) || (param_err)) && !res) {
res = 1;
x = 0.1;
y = 0.1;
z = 0.1;
} else if (!(inlet_reset > 0) || (param_err))
res = 0;