radio

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

Inlets

frac32.bipolar spectrum

Outlets

frac32buffer.bipolar out

Parameters

frac32.u.map noisiness

frac32.u.map spectrum

Declaration
int32_t r, v;
int32_t c5 = 3, sh5 = 0;
Init
r = GenerateRandomNumber();
Control Rate
int32_t prob = 0x7FFF0000 - (param_noisiness << 4);
int32_t spectrum = __USAT(param_spectrum + inlet_spectrum, 27) + 0x00100000;
Audio Rate
if ((r = r * 69069 + 1) < prob)
  v += spectrum;
int32_t out = ((v ^ (v >> 1) ^ (v >> 2)) & 0x0FFFFFFF) - (1 << 27);
c5++;
if (c5 >= 4) {
  c5 = 0;
  sh5 = out;
}
outlet_out = (out + sh5) >> 1;

Privacy

© 2024 Zrna Research