stutter_write

write module for the stutter delay Connect range input to the range output of the stutter delay
Author: Remco van der Most
License: BSD
Github: sss/delay/stutter_write.axo

Inlets

bool32.rising reset

frac32buffer wave input

frac32 range

int32 repeat

Outlets

int32 power

Parameters

int32 repeat

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;
int32_t range;
int count;
int rtrig;
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_power = attr_size;
Audio Rate
range = ___SMMUL(LENGTHMASK << 3, inlet_range << 2);
writepos = (writepos + 1) - (((writepos + 1) / range) * range);
if ((inlet_reset > 0) && (!(rtrig))) {
  writepos = 0;
  rtrig = 1;
} else if (inlet_reset == 0) {
  rtrig = 0;
}
if (writepos == 0) {
  count += 1;
}
int8_t repeat = param_repeat + inlet_repeat;
count = count - ((count / repeat) * repeat);
if (count == 0)
  array[writepos] = __SSAT(inlet_in >> 14, 16);

Privacy

© 2024 Zrna Research