WCR12

Records the weights for each three-note-follow-up and copies it into the internal array of the "WCG12 module" when you hit "send". Connect a midi module note and gate outputs to the note and gate inputs and play a melody. Make sure your last played note makes a connection back to another note played before. When the WCG12/WCG16 hangs on a certain note, this can be altered by playing this note twice on the keyboard, followed up by another note. Press "send" to send the recorded chance-table to the WCG12/WCG16 Press "reset" to reset the recorded table to start a new recording. Press "get" to get the chancetable from the WCG12/16 "core" module so you can alter it. (this way you can alter old recordings "on the fly" while live without losing the original saved settings.)
Author: Remco van der Most
License: BSD
Github: sss/patt/WCR12.axo

Inlets

bool32 gate

int32 note

Outlets

None

Parameters

bool32.mom send

bool32.mom reset

bool32.mom get

Attributes

objref core

Declaration
static const uint32_t LENGTH = 1728;
int32_t prev;
int32_t PREV;
int i;
int gtrig;
int16_t *array;
int j;
int ctrig;
int rtrig;
int GET;
int Gtrig;
Init
static int16_t _array[LENGTH] __attribute__((section(".sdram")));
array = &_array[0];
for (i = 0; i < LENGTH; i++) {
  array[i] = 0;
}

// for(i=0;i<144;i++){
//
//	array[i*12]=1;
//	array[i*12+2]=1;
//	array[i*12+4]=1;
//	array[i*12+5]=1;
//	array[i*12+7]=1;
//	array[i*12+9]=1;
//	array[i*12+11]=1;
//}
int prev = 0;
int PREV = 0;
Control Rate
if ((param_reset > 0) && !rtrig) {
  rtrig = 1;
  GET = 0;
  for (i = 0; i < LENGTH; i++) {
    array[i] = 0;
  }
} else if (param_reset == 0) {
  rtrig = 0;
}

if ((param_get > 0) && !Gtrig) {
  Gtrig = 1;
  for (i = 0; i < 144; i++) {
    for (j = 0; j < 12; j++) {
      array[i * 12 + j] = attr_core.array[i * 12 + j];
      if (j > 0) {
        array[i * 12 + j] -= attr_core.array[i * 12 + j - 1];
      }
    }
  }
} else if (param_get == 0) {
  Gtrig = 0;
}
if ((inlet_gate > 0) && !gtrig) {
  gtrig = 1;
  int32_t NOTE = inlet_note;
  NOTE = NOTE - NOTE / 12 * 12;
  NOTE = NOTE < 0 ? NOTE + 12 : NOTE;
  if (GET == 0) {
    PREV = prev = NOTE;
  }
  array[PREV + prev + NOTE] += 1;
  PREV = prev * 12;
  prev = NOTE * 12;

  GET = 1;
} else if (inlet_gate == 0) {
  gtrig = 0;
}

if ((param_send > 0) && !ctrig) {
  ctrig = 1;
  for (i = 0; i < 144; i++) {
    for (j = 0; j < 12; j++) {
      attr_core.array[i * 12 + j] = array[i * 12 + j];
      if (j > 0) {
        attr_core.array[i * 12 + j] += attr_core.array[i * 12 + j - 1];
      }
    }
  }
} else if (param_send == 0) {
  ctrig = 0;
}

Privacy

© 2024 Zrna Research