wind

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

Inlets

None

Outlets

frac32buffer.bipolar out

Declaration
float c, _c;
int32_t acc, r1, r2, rd;
Init
rd = GenerateRandomNumber();
r1 = GenerateRandomNumber();
r2 = r1;
for (int i = 0; i < 15; i++)
  r2 = r2 * 69069 + 1;
c = 15;
_c = 1 / 15.0f;
acc = r2 >> 16;
Audio Rate
rd = rd * 69069 + 1;
if (rd > 0x7FA00000 && c < 50) {
  c += 1.0f;
  _c = 1.0f / c;
  // addition to the box
  r2 = r2 * 69069 + 1;
  acc += r2 >> 16;
} else if (rd < -0x7FA00000 && c > 15) {
  c -= 1.0f;
  _c = 1.0f / c;
  // sub to the box
  r1 = r1 * 69069 + 1;
  acc -= r1 >> 16;
}
// box slide
r1 = r1 * 69069 + 1;
acc -= r1 >> 16;
r2 = r2 * 69069 + 1;
acc += r2 >> 16;
outlet_out = arm::float_to_q(acc * _c, 27 - 14);

Privacy

© 2024 Zrna Research