retrGaussian

retriggered pseudo gaussian distributed (white) noise useful for drums/attack-part of sounds that should stay the same for each gate. Range -64..64
Author: Remco van der Most
License: BSD
Github: sss/noise/retrGaussian.axo

Inlets

bool32 trig

Outlets

frac32buffer.bipolar white noise

Parameters

frac32.s.map seed

Declaration
uint32_t seeds[16];
int trig;
int32_t array;
Init
seeds[8] = 0x21c32332 + GenerateRandomNumber();
seeds[9] = 0xfbc57f7a + GenerateRandomNumber();
seeds[10] = 0x7dd1ef4a + GenerateRandomNumber();
seeds[11] = 0xe4ec34ad + GenerateRandomNumber();
seeds[12] = 0x72007b2f + GenerateRandomNumber();
seeds[13] = 0x3d1e9783 + GenerateRandomNumber();
seeds[14] = 0xa4a8f892 + GenerateRandomNumber();
seeds[15] = 0xc82c5e28 + GenerateRandomNumber();
seeds[0] = seeds[8];
seeds[1] = seeds[9];
seeds[2] = seeds[10];
seeds[3] = seeds[11];
seeds[4] = seeds[12];
seeds[5] = seeds[13];
seeds[6] = seeds[14];
seeds[7] = seeds[15];
Control Rate
if ((inlet_trig) && !trig) {
  trig = 1;
  seeds[0] = seeds[8] + param_seed;
  seeds[1] = seeds[9] + param_seed;
  seeds[2] = seeds[10] + param_seed;
  seeds[3] = seeds[11] + param_seed;
  seeds[4] = seeds[12] + param_seed;
  seeds[5] = seeds[13] + param_seed;
  seeds[6] = seeds[14] + param_seed;
  seeds[7] = seeds[15] + param_seed;
} else if (inlet_trig == 0) {
  trig = 0;
}
Audio Rate
int i;
int32_t n = 0;
for (i = 0; i < 8; i++) {
  seeds[i] = (seeds[i] * 196314165) + 907633515;
  n += ((int32_t)(seeds[i])) >> 7;
}
outlet_wave = n;

Privacy

© 2024 Zrna Research