int32 offset
int32 start
int32 length
bool32.risingfalling active
int32 pad index if inside range
bool32.pulse pulse if an element is set to ON
int32 offset
int32 start
int32 length
bool32.tgl active
combo blocksize
objref table
int8_t _note1;
uint8_t _gate1;
uint8_t matrix;
uint8_t prevmatrix;
uint8_t lastmatrix;
uint8_t start;
uint8_t end;
uint8_t bitmask1 = 0b10001110;
int32_t _value;
int32_t _cc;
int32_t offset;
int rtrig;
int ntrig;
bool op;
offset = inlet_offset + param_offset;
start = inlet_start + param_start;
end = (start + (inlet_length + param_length));
matrix = (_note1 - ((_note1 >> 4) << 3));
if ((matrix >= start) && (matrix < end)) {
outlet_matrix = matrix;
lastmatrix = matrix;
if (inlet_active || param_active) {
if (((_gate1 > 0) && !ntrig) || (matrix != prevmatrix)) {
ntrig = 1;
op = attr_table.array[(matrix << attr_blocksize) + offset];
op = !op;
attr_table.array[(matrix << attr_blocksize) + offset] =
(op * ((1 << 27) - 1 >> attr_table.GAIN));
if (op)
rtrig = 1;
}
if (!(_gate1 > 0))
ntrig = 0;
}
} else {
if (!lastmatrix)
lastmatrix = start;
outlet_matrix = lastmatrix;
}
prevmatrix = matrix;
outlet_trig = rtrig;
rtrig = 0;
if ((status == MIDI_NOTE_ON + attr_midichannel) && (data2)) {
if ((data1 - 8) & bitmask1) {
_note1 = data1;
_gate1 = 1;
}
} else if (((status == MIDI_NOTE_ON + attr_midichannel) && (!data2)) ||
(status == MIDI_NOTE_OFF + attr_midichannel)) {
if (_note1 == data1) {
_gate1 = 0;
}
} else if ((status == attr_midichannel + MIDI_CONTROL_CHANGE) &&
(data1 == MIDI_C_ALL_NOTES_OFF)) {
_gate1 = 0;
}