sigmo

Author: Smashed Transistors
License: LGPL
Github: tiar/noise/sigmo.axo

Inlets

frac32 freq

frac32 width

Outlets

frac32buffer.bipolar out

Parameters

frac32.u.map freq

frac32.u.map width

Declaration
const int32_t a = 1664525;
const int32_t b = 1013904223;
int32_t r;
float alpha = 0;
float da = 1;
float x0, x1 = 0;
Init
r = GenerateRandomNumber();
Control Rate
float freq = arm::q_to_float(__USAT(inlet_freq + param_freq, 27), 27);
freq = 0.005f + 0.995f * freq * freq;

float width = 1 - arm::q_to_float(__USAT(inlet_width + param_width, 27), 27);
width = 0.99f * (1 - width * width);
Audio Rate
alpha += da;
if (alpha >= 1) {
  alpha -= 1;
  x0 = x1;
  x1 = arm::q_to_float(r = r * a + b, 31);
  da = arm::q_to_float(r = r * a + b, 31);
  if (da < 0)
    da = -da;
  da = freq * (1.0f - width * da);
}
float sigmo = alpha * alpha * (3 - 2 * alpha);
outlet_out = arm::float_to_q(x0 + sigmo * (x1 - x0), 28);

Privacy

© 2024 Zrna Research