frac32 cycle
frac32buffer.bipolar pink noise
frac32.u.map cycle
int32 offset
int32 jitter
bool32.tgl invert
int32_t inv; // -1 if invert needed
// inv = 1 => F B F B
// / \ / \
//
// inv = -1 => F B-F-B
// / \
// \ /
int32_t c;
int32_t r;
int32_t r2;
int32_t s;
int32_t newCycle = 8;
r = GenerateRandomNumber();
c = 0;
r2 = 137;
s = 1 << (32 - 4);
{
int32_t c = (int32_t)__USAT(param_cycle + inlet_cycle, 27);
uint32_t fc = (c & ((1 << 23) - 1)) << (32 - 23);
newCycle = (c >> 23) + (fc > (r2 = r2 * 69069 + 1));
}
inv = param_invert ? -1 : 1;
int32_t resetValue =
___SMMLA(r2 = r2 * 69069 + 1, param_jitter, newCycle + param_offset);
c--;
if (c <= -newCycle) {
c = resetValue;
s *= inv;
}
r = (c <= 0 ? -1511872763 * (r - 1) : 69069 * r + 1);
outlet_out = ___SMMUL(s, r);