touchrec

(aftertouch) automation recorder -records only when "rec" is high. -when "gate" is high, records CV onto current position and send incoming CV directly to output -when "gate" goes low (recorded/live), holds last CV value. -when "delete" is high, deletes gate/CV at current position when "gate" goes high -when "deleteSEQ" is high, deletes the whole sequence when "gate" goes high -when "clear" goes high, deletes the whole sequence immidiatly -clear should be used as the main reset-control, resetting multiple automation modules to zero. -connect gate and CV inputs to the gate/touch-outputs of my "noteTV" module (midi folder) -delete and deleteSEQ should be used to only delete certain CV-positions or certain sequences.
Author: Remco van der Most
License: BSD
Github: sss/table/touchrec.axo

Inlets

bool32 gate

bool32 rec

bool32 delete

bool32 deleteSEQ

bool32 clear

int32 position

int32 length

frac32 CV

Outlets

bool32 gate

frac32 CV

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;
int ctrig;
int i;
int dtrig;
int32_t CV;
int get;
int32_t temp;
Init
static int16_t _array[LENGTH] __attribute__((section(".sdram")));
array = &_array[0];
Control Rate
int32_t position;
position = inlet_position;
position = position - (position / inlet_length) * inlet_length;

int rec = inlet_gate && inlet_rec;
if (((inlet_deleteSEQ > 0) && (inlet_gate > 0)) && !dtrig) {
  dtrig = 1;
  for (i = 0; i < LENGTH; i++) {
    array[i] = 0;
  }
} else if (!(inlet_gate && inlet_deleteSEQ)) {
  dtrig;
}

if ((inlet_delete > 0) && (inlet_gate > 0)) {
  array[position] = 0;
}
int Delete = inlet_delete + inlet_deleteSEQ;

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

if ((rec > 0) && !(Delete)) {
  array[position & LENGTHMASK] = inlet_CV >> 12;
}
if (rec == 0) {

  outlet_gate = array[position & LENGTHMASK] > 0 ? 1 : 0;
  if (outlet_gate > 0) {
    outlet_CV = array[(position)&LENGTHMASK] << 12;
    CV = array[(position - 5) & LENGTHMASK] << 12;
  } else {
    outlet_CV = CV;
  }
}

if ((inlet_gate > 0) && !(Delete)) {
  outlet_CV = inlet_CV;
  CV = inlet_CV;
  outlet_gate = 1;
}

Privacy

© 2024 Zrna Research