rndTapDelaySt_m

random multi-tap delay/early reflections with controllable tap-amount. length sets the amount of taps. maximum and minimum values are modulatable for phasing effects
Author: Remco van der Most
License: BSD
Github: sss/delay/rndTapDelaySt_m.axo

Inlets

bool32.rising random

frac32buffer in

frac32 maximum

frac32 minimum

Outlets

frac32buffer wave

frac32buffer outR

frac32buffer wetsum

frac32buffer delayRec

Parameters

bool32.mom random

frac32.u.map maximum

frac32.u.map minimum

frac32.u.map feed

int32 length

Attributes

objref delayname

Declaration
int32_t _val[16];
int32_t _vol[16];
int32_t _pan[16];
int32_t _com[16];
int32_t _sam[16];
int ntrig;
int8_t lng;
int i;
uint32_t _delay[16];
int32_t sumL;
int32_t sumR;
int32_t mad;
int32_t mid;
Init
for (i = 0; i < 16; i++)
  _val[i] = (GenerateRandomNumber()) >> 5;
{}
for (i = 0; i < 16; i++)
  _vol[i] = (GenerateRandomNumber()) >> 5;
{}
for (i = 0; i < 16; i++)
  _pan[i] = (GenerateRandomNumber()) >> 5;
{}
for (i = 0; i < 16; i++)
  _com[i] = (1 << 27) - _pan[i];
{}
ntrig = 0;
Control Rate
lng = param_length;
int32_t width = inlet_maximum + param_maximum - param_minimum;

if (((param_random + inlet_random) >= 1) && (!(ntrig))) {
  for (i = 0; i < lng; i++)
    _val[i] = ((GenerateRandomNumber()) >> 5);
  {}
  for (i = 0; i < lng; i++)
    _vol[i] = ((GenerateRandomNumber()) >> 5);
  {}
  for (i = 0; i < lng; i++)
    _pan[i] = ((GenerateRandomNumber()) >> 5);
  {}
  for (i = 0; i < lng; i++)
    _com[i] = (1 << 27) - _pan[i];
  {}
  ntrig = 1;
} else if (!((param_random + inlet_random) >= 1)) {
  ntrig = 0;
}
Audio Rate
mad = mad + ((inlet_minimum + param_minimum - mad) >> 13);
mid = mid + ((width - mid) >> 13);
sumL = 0;
sumR = 0;
for (i = 0; i < lng; i++) {
  _delay[i] = attr_delayname.writepos -
              (__USAT(___SMMUL(mid << 3, (_val[i]) << 2) + mad, 27) >>
               (27 - attr_delayname.LENGTHPOW)) -
              BUFSIZE + buffer_index;
}

for (i = 0; i < lng; i++)
  _sam[i] =
      (___SMMUL(
          (attr_delayname.array[(_delay[i]) & attr_delayname.LENGTHMASK] << 14)
              << 3,
          _vol[i] << 2)) /
      (1 + lng / 2);
{}
for (i = 0; i < lng; i++)
  sumL += ___SMMUL((_sam[i]) << 3, (_pan[i]) << 4);
{}
for (i = 0; i < lng; i++)
  sumR += ___SMMUL((_sam[i]) << 3, (_com[i]) << 4);
{}
outlet_outL = sumL + (inlet_in >> 1);
outlet_outR = sumR + (inlet_in >> 1);
outlet_wetsum = (sumL + sumR) >> 1;
outlet_delayRec =
    (inlet_in - ___SMMUL((sumL + sumR) << 2, param_feed << 2)) >> 1;

Privacy

© 2024 Zrna Research