bool32 gate
int32 note
None
bool32.mom copy
bool32.mom reset
objref core
static const uint32_t LENGTH = 48 * 48;
int32_t prev;
int i;
int gtrig;
int16_t *array;
int j;
int ctrig;
int rtrig;
static int16_t _array[LENGTH] __attribute__((section(".sdram")));
array = &_array[0];
for (i = 0; i < LENGTH; i++) {
array[i] = 0;
}
int prev = 0;
if ((param_reset > 0) && !rtrig) {
rtrig = 1;
for (i = 0; i < LENGTH; i++) {
array[i] = 0;
}
} else if (param_reset == 0) {
rtrig = 0;
}
if ((inlet_gate > 0) && !gtrig) {
gtrig = 1;
int32_t NOTE = inlet_note;
NOTE = NOTE - NOTE / 48 * 48;
NOTE = NOTE >= 0 ? NOTE : NOTE + 48;
array[prev + NOTE] += 1;
prev = NOTE * 48;
} else if (inlet_gate == 0) {
gtrig = 0;
}
if ((param_copy > 0) && !ctrig) {
ctrig = 1;
for (i = 0; i < 48; i++) {
for (j = 0; j < 48; j++) {
attr_core.array[i * 48 + j] = array[i * 48 + j];
if (j > 0) {
attr_core.array[i * 48 + j] += attr_core.array[i * 48 + j - 1];
}
}
}
} else if (param_copy == 0) {
ctrig = 0;
}