wf_12Scale

Author: Smashed Transistors
License: LGPL
Github: tiar/osc/wf12/wf_12Scale.axo

Inlets

frac32.positive rate

frac32buffer.bipolar wf 12

Outlets

frac32buffer.bipolar wf 12

Parameters

frac32.u.map scale1

frac32.u.map scale0

Declaration
int32_t val(float x, const int32_t wf[]) {
  int ix0 = (int)x;
  float fx = x - ix0;
  ix0 %= 12;
  return (int32_t)(wf[ix0] + fx * (wf[ix0 < 11 ? ix0 + 1 : 0] - wf[ix0]));
}
Control Rate
float mod = inlet_mod * (1.0f / (1 << 27));
if (mod < 0)
  mod = 0;
if (mod > 1)
  mod = 1;
float scale = param_scale0 + mod * (param_scale1 - param_scale0);
scale = 0.25f + scale * scale * ((5.75f / (1 << 27) * (1.0f / (1 << 27))));

for (int i = 0; i < 12; i++) {
  outlet_wf12[i] = val(i * scale, inlet_wf12);
}

Privacy

© 2024 Zrna Research