delay write kt ms

delayline definition, read it with "delay/read" objects referencing the instance name of this object. Returns the right amount of kticks and milliseconds represented by its size attribute.
Author: Oscar Abraham
License: BSD
Github: oscar/delay/delay write kt ms.axo

Inlets

frac32buffer wave input

Outlets

int32.positive kticks

int32.positive millis

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);
int16_t *array;
uint32_t writepos;
static const uint32_t kticks = pow(2, attr_size);
static const uint32_t millis = (uint32_t)(0.0208333 * kticks);
Init
static int16_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
outlet_kticks = kticks;
outlet_millis = millis;
Audio Rate
writepos = (writepos + 1) & LENGTHMASK;
array[writepos] = __SSAT(inlet_in >> 14, 16);

Privacy

© 2024 Zrna Research