scrith

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

Inlets

frac32 bright

Outlets

frac32buffer.bipolar out

Parameters

frac32.s.map bright

Declaration
uint32_t r = 137;
uint32_t dp = 1 << 30;
uint32_t p = 0;
int32_t dir = -1;
Init
r = GenerateRandomNumber();
Control Rate
int32_t bright;
MTOFEXTENDED(__SSAT(param_bright + inlet_bright, 28), bright);
Audio Rate
if (dp < bright) {
  dir = +1;
} else if (dp > (3 << 29)) {
  dir = -1;
}

r = r * 69069 + 1;
dp = ___SMMUL(dp, (1 << 30) + dir * (r >> 5)) << 2;
p += dp;

// outlet_out = sine2t[p>>20]>>4;
outlet_out = __SSAT((abs((int32_t)p) >> 2) - (1 << 28), 28);

Privacy

© 2024 Zrna Research