trrum

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

Inlets

None

Outlets

frac32buffer.bipolar out

Declaration
const int32_t A = 69069;
const int32_t B = -1511872763;

int32_t r;
uint8_t c = 0;
Init
r = GenerateRandomNumber();
Control Rate
c++;
if (c & 1 == 0) {
  outlet_out[0] = (r = A * r + 1) >> 4;
  outlet_out[1] = r >> 4;
  outlet_out[2] = r >> 4;
  outlet_out[3] = r >> 4;
  outlet_out[4] = (r = A * r + 1) >> 4;
  outlet_out[5] = (r = B * (r - 1)) >> 4;
  outlet_out[6] = r >> 4;
  outlet_out[7] = (r = A * r + 1) >> 4;
  outlet_out[8] = (r = A * r + 1) >> 4;
  outlet_out[9] = r >> 4;
  outlet_out[10] = r >> 4;
  outlet_out[11] = (r = B * (r - 1)) >> 4;
  outlet_out[12] = (r = B * (r - 1)) >> 4;
  outlet_out[13] = (r = B * (r - 1)) >> 4;
  outlet_out[14] = (r = A * r + 1) >> 4;
  outlet_out[15] = (r = B * (r - 1)) >> 4;
} else {
  outlet_out[0] = (r = A * r + 1) >> 4;
  outlet_out[1] = (r = A * r + 1) >> 4;
  outlet_out[2] = (r = A * r + 1) >> 4;
  outlet_out[3] = (r = A * r + 1) >> 4;
  outlet_out[4] = (r = A * r + 1) >> 4;
  outlet_out[5] = (r = B * (r - 1)) >> 4;
  outlet_out[6] = r >> 4;
  outlet_out[7] = (r = B * (r - 1)) >> 4;
  outlet_out[8] = (r = A * r + 1) >> 4;
  outlet_out[9] = (r = B * (r - 1)) >> 4;
  outlet_out[10] = r >> 4;
  outlet_out[11] = (r = B * (r - 1)) >> 4;
  outlet_out[12] = (r = B * (r - 1)) >> 4;
  outlet_out[13] = (r = B * (r - 1)) >> 4;
  outlet_out[14] = (r = B * (r - 1)) >> 4;
  outlet_out[15] = r >> 4;
}

Privacy

© 2024 Zrna Research