rottenDelay

dirty rotten delayline with delaytime, feedback, samplerate, bits, LP damp, wet and dry control
Author: Remco van der Most
License: BSD
Github: sss/delay/rottenDelay.axo

Inlets

frac32buffer wave input

Outlets

frac32buffer out

Parameters

frac32.u.map time

frac32.s.map feedback

frac32.s.map wet

frac32.s.map dry

frac32.s.map.pitch damp

int32 rate

int32 bits

Attributes

combo size

Declaration
static const uint32_t LENGTHPOW = (attr_size);
static const uint32_t LENGTH = (1 << attr_size);
static const uint32_t LENGTHMASK = ((1 << attr_size) - 1);
int32_t *array;
uint32_t writepos;
int32_t feedback;
int32_t HP;
int32_t count;
int32_t out;
Init
static int32_t _array[attr_poly][1 << attr_size]
    __attribute__((section(".sdram")));
array = &_array[parent->polyIndex][0];
int i;
writepos = 0;
for (i = 0; i < LENGTH; i++)
  array[i] = 0;
Control Rate
int32_t f;
MTOF(param_damp, f)
int32_t h;
MTOF(-10 << 21, h)
Audio Rate
count += 1;
count = count - (count / param_rate) * param_rate;
if (count == 0) {
  writepos = (writepos + 1) & LENGTHMASK;
  array[writepos] =
      ((inlet_in + ___SMMUL(param_feedback << 3, feedback) + 1) << 2) >>
      32 - (param_bits);
  if (param_bits < 31) {
    out = array[writepos - (param_time >> 27 - LENGTHPOW) & LENGTHMASK]
          << 32 - param_bits;
  }
  if (param_bits > 30) {
    out = array[writepos - (param_time >> 27 - LENGTHPOW) & LENGTHMASK] >>
          -32 + param_bits;
  }
}
out = __SSAT(out, 27);
HP = ___SMMLA((out - HP) << 1, h, HP);
feedback = ___SMMLA((out - HP - feedback) << 1, f, feedback);
outlet_out = ___SMMUL(out << 3, param_wet << 2) +
             ___SMMUL(inlet_in << 3, param_dry << 2);

Privacy

© 2024 Zrna Research