xor5

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

Inlets

None

Outlets

frac32buffer.bipolar out

Declaration
int32_t s = 1 << 27;
int16_t c0, c1, c2, c3 = 1, c4 = 1;
int16_t p0 = 51, p1 = 25, p2 = 13, p3 = 7, p4 = 3;
Init
c0 = GenerateRandomNumber() & 31;
c1 = GenerateRandomNumber() & 15;
c2 = GenerateRandomNumber() & 7;
Audio Rate
c0--;
if (c0 <= 0) {
  c0 = p0;
  s = -s;
}
c1--;
if (c1 <= 0) {
  c1 = p1;
  s = -s;
}
c2--;
if (c2 <= 0) {
  c2 = p2;
  s = -s;
}
c3--;
if (c3 <= 0) {
  c3 = p3;
  s = -s;
}
c4--;
if (c4 <= 0) {
  c4 = p4;
  s = -s;
}

outlet_out = s;

Privacy

© 2024 Zrna Research