Geiger2

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

Inlets

frac32.bipolar density

Outlets

frac32buffer.bipolar impulses

Parameters

frac32.u.map density

Declaration
uint32_t r;
int32_t r2;
int32_t e;
int32_t density;
uint8_t c;
Init
r = 137 + GenerateRandomNumber();
r2 = 123456789;
e = 1 << 27;
c = 0;
Control Rate
density = param_density + inlet_density;
density = ___SMMLA(density << 2, density << 3, density >> 4); // x^2 + x/16
density = ___SMMLA(density << 2, density << 3,
                   density >> 2); // (x^2 + x/16)^2 + (x^2 + x/16)/4

density >>= 6; // q31
Audio Rate
r *= 69069UL;
if ((r >> 5) < density) {
  r2 = 123456789;
  e = 1 << 28;
}
e = ___SMMUL(e, (1 << 27) - (1 << 21)) << 5;
outlet_out = ___SMMUL(r2, e);
if ((c & 3) == 0)
  r2 *= 69069;
c++;

Privacy

© 2024 Zrna Research