rndTapDelay

random multi-tap delay/early reflections with controllable tap-amount. length sets the amount of taps.
Author: Remco van der Most
License: BSD
Github: sss/delay/rndTapDelay.axo

Inlets

None

Outlets

frac32buffer wave

Parameters

int32 length

bool32.mom random

Attributes

objref delayname

Declaration
int32_t _val[16];
int32_t _vol[16];
int ntrig;
int8_t lng;
int i;
uint32_t _delay[16];
int32_t sum;
Init
for (i = 0; i < 16; i++)
  _val[i] = (GenerateRandomNumber()) >> 4;
{}
for (i = 0; i < 16; i++)
  _vol[i] = (GenerateRandomNumber()) >> 4;
{}
ntrig = 0;
Control Rate
lng = param_length;
if ((param_random > 0) && (!(ntrig))) {
  for (i = 0; i < lng; i++)
    _val[i] = ((GenerateRandomNumber()) >> 5) + (1 << 26);
  _vol[i] = ((GenerateRandomNumber()) >> 4);
  {}
  ntrig = 1;
} else if (!(param_random > 0)) {
  ntrig = 0;
}
for (i = 0; i < lng; i++) {
  _delay[i] = attr_delayname.writepos -
              (__USAT(_val[i], 27) >> (27 - attr_delayname.LENGTHPOW)) -
              BUFSIZE;
}
Audio Rate
sum = 0;
for (i = 0; i < lng; i++)
  sum += ___SMMUL(
      (attr_delayname.array[(_delay[i]++) & attr_delayname.LENGTHMASK] << 14)
          << 3,
      _vol[i] << 2);
outlet_out = sum / ((1 + lng) / 2);

Privacy

© 2024 Zrna Research