tabRecorder

records value input (to be used with "singleTouch" module to record aftertouch) The recorded automation won't be reset to 0 when axoloti is restarted. set the desired maximum table size with the "size" selector attribute. For the "size" input: Use a "ratioVCAI" module to set a desired ratio to host tempo, using the "clock2timing" module to provide the amount of samples (ksamples output). A gate high at the "delete" input, WHILE rec is high, will set the currently recorded value to 0. A gate high at the "delALL" input, WHILE rec is high, will set all position in the table to 0. A gate high at the "reset" input will reset the internal readout position to 0. outputs: "gate" goes high when recorded readout value is above zero. "mix" outputs a smoothed gate high to use with crossfaders "out" outputs the recorded readout value
Author: Remco van der Most
License: BSD
Github: sss/table/tabRecorder.axo

Inlets

int32 size

bool32 rec

bool32 delete

bool32 delALL

bool32 reset

frac32 val

Outlets

frac32 mix

frac32 out

bool32 gate

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);
static const uint32_t BITS = 8;
static const uint32_t GAIN = 20;
uint8_t *array;
int32_t position;
int32_t val;
int32_t mix;
int reset;
int i;
int trig;
Init
static uint8_t _array[attr_poly][LENGTH] __attribute__((section(".sdram")));
array = &_array[parent->polyIndex][0];
Control Rate
if ((inlet_reset > 0) && !trig) {
  trig = 1;
  position = 0;
} else if (!(inlet_reset > 0)) {
  trig = 0;
}

if ((inlet_delALL > 0) && (!reset) && inlet_rec) {
  reset = 1;
  for (i = 0; i < LENGTH; i++) {
    array[i] = 0;
  }
} else if (!(inlet_delALL)) {
  reset = 0;
}

int32_t in = inlet_delete > 0 ? 0 : inlet_val;
position = (position + 1) & LENGTHMASK;
position = position > inlet_size ? 0 : position;
if (!(inlet_rec > 0)) {
  val = val + (((array[position] << 19) - val) >> 7);
}

if (inlet_rec > 0) {
  val = val + ((in - val) >> 7);
  array[position] = val >> 19;
}

outlet_out = val;
outlet_gate = array[position] > 0 ? 1 : 0;
mix = mix + (((outlet_gate << 27) - mix) >> 7);
outlet_mix = mix;

Privacy

© 2024 Zrna Research