gausFixSnc

fixed retriggered pseudo gaussian distributed (white) noise useful for drums/attack-part of sounds that should stay the same for each gate. Range -64..64 This version has no extra randomisation at initialisation, so noise-seed can be used as a preset value for later recall.
Author: Remco van der Most
License: BSD
Github: sss/noise/gausFixSnc.axo

Inlets

frac32 seed

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;
seeds[9] = 0xfbc57f7a;
seeds[10] = 0x7dd1ef4a;
seeds[11] = 0xe4ec34ad;
seeds[12] = 0x72007b2f;
seeds[13] = 0x3d1e9783;
seeds[14] = 0xa4a8f892;
seeds[15] = 0xc82c5e28;
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) {
  int32_t SD = param_seed + inlet_seed;
  trig = 1;
  seeds[0] = seeds[8] + SD;
  seeds[1] = seeds[9] - (SD << 1);
  seeds[2] = seeds[10] + SD;
  seeds[3] = seeds[11] + SD * seeds[10];
  seeds[4] = seeds[12] + SD;
  seeds[5] = seeds[13] + SD * SD;
  seeds[6] = seeds[14] + (SD << 1);
  seeds[7] = seeds[15] - SD;
} 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 << 1;

Privacy

© 2024 Zrna Research