s quant m

Author: Smashed Transistors
License: LGPL
Github: tiar/tuning/s quant m.axo

Inlets

frac32 pitch input

frac32.positive quant

Outlets

frac32 pitch

Declaration
float s(float x) { return x * x * (3 - 2 * x); }
Control Rate
float a = arm::q_to_float(inlet_pitch & 0x001FFFFF, 21);
float q = arm::q_to_float(__USAT(inlet_quant, 27), 27);
if (q < 1 / 4.0f) {
  a += 4 * q * (s(a) - a);
} else if (q < 2 / 4.0f) {
  a = s(a);
  a += 4 * (q - 1 / 4.0f) * (s(a) - a);
} else if (q < 3 / 4.0f) {
  a = s(a);
  a = s(a);
  a += 4 * (q - 2 / 4.0f) * (s(a) - a);
} else {
  a = s(a);
  a = s(a);
  a = s(a);
  a += 4 * (q - 3 / 4.0f) * (s(a) - a);
}
outlet_pitch = arm::float_to_q(a, 21) + (inlet_pitch & 0xFFE00000);

Privacy

© 2024 Zrna Research