4x8bit_del_write

4channel 8bit delayline. Incoming audio gets filtered and then coded into 8bit, shifted, summed and recorded to the table.
Author: Remco van der Most
License: BSD
Github: sss/delay/4x8bit_del_write.axo

Inlets

frac32buffer 1

frac32buffer 2

frac32buffer 3

frac32buffer 4

Outlets

None

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);
int64_t *array;
uint32_t writepos;
int32_t val1;
int32_t val2;
int32_t val3;
int32_t val4;
Init
static int64_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;
val1 = 0;
val2 = 0;
val3 = 0;
val4 = 0;
Audio Rate
val1 = val1 + (((inlet_1 << 4) - val1) >> 2);
val2 = val2 + (((inlet_2 << 4) - val2) >> 2);
val3 = val3 + (((inlet_3 << 4) - val3) >> 2);
val4 = val4 + (((inlet_4 << 4) - val4) >> 2);
int8_t in1 = val1 >> 24;
int8_t in2 = (val2 >> 24);
int8_t in3 = (val3 >> 24);
int8_t in4 = (val4 >> 24);
int32_t an1 = in1;
int32_t an2 = in2;
int32_t an3 = in3;
int32_t an4 = in4;
an2 = an2 << 8;
an3 = an3 << 16;
an4 = an4 << 24;

int32_t sum = an1 + an2 + an3 + an4;

writepos = (writepos + 1) & LENGTHMASK;
array[writepos] = sum;

Privacy

© 2024 Zrna Research