taildelay

Delay with a precise feedback-time control. delay-time functions the same as the other normal delays, but.. the tailtime is a direct representation of the time (in seconds) the feedback will take to die out, whatever the delaytime. So when you set to control to 30, it will take 30 seconds die out, whether it's at a delaytime of 100ms or 2 seconds..
Author: Remco van der Most
License: BSD
Github: sss/delay/taildelay.axo

Inlets

frac32buffer delay time (fraction of total delayline size)

frac32 time

frac32 tailtime

Outlets

frac32buffer wave

Parameters

frac32.u.map time

frac32.u.map tailtime

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 feed;
int32_t Time;
int32_t val1;
int32_t val2;
int32_t T1ime;
Init
static int32_t _array[1 << attr_size] __attribute__((section(".sdram")));
array = &_array[0];
int i;
writepos = 0;
for (i = 0; i < LENGTH; i++)
  array[i] = 0;
Control Rate
int32_t TMP = __USAT(inlet_time + param_time, 27);
Time = TMP >> 27 - LENGTHPOW;
int32_t tailtime = __USAT(param_tailtime + inlet_tailtime, 27) >> 5;
float32_t ratio = (float32_t)(Time << 2) / (float32_t)(tailtime * 7);
float32_t dB = (float32_t)(-10) * ratio;
dB = powf(2, dB) * 4;
uint32_t tmp_w1 = (TMP << (LENGTHPOW + 3)) & 0x3FFFFFFF;
uint32_t tmp_w2 = (1 << 30) - tmp_w1;
Audio Rate
writepos = (writepos + 1) & LENGTHMASK;
uint32_t tmp_di1 = writepos - (Time)-1;
int32_t tmp_a1 = array[tmp_di1 & LENGTHMASK];
int32_t tmp_a2 = array[(tmp_di1 + 1) & LENGTHMASK];
int32_t tmp_r = ___SMMUL(tmp_a1, tmp_w1);
tmp_r = ___SMMLA(tmp_a2, tmp_w2, tmp_r);
int32_t lp = tmp_r * dB;
array[writepos] = -lp + inlet_in;
outlet_out = -lp + inlet_in;

Privacy

© 2024 Zrna Research