int32 offset
int32 startnote
int32 length
bool32.risingfalling active
bool32.pulse pulse if an element of the table is set to ON
int32 note index if inside range
int32 offset
int32 startnote
int32 length
bool32.tgl active
objref table
combo blocksize
int8_t _note1;
uint8_t _gate1;
uint8_t _velo1;
uint8_t prevnote;
uint8_t lastnote;
uint8_t start;
uint8_t end;
int trig;
int ntrig;
bool op;
uint32_t offset;
start = inlet_startnote + param_startnote;
end = (start + (inlet_length + param_length));
offset = (inlet_offset + param_offset);
if ((_note1 >= start) && (_note1 < end)) {
outlet_note = _note1;
lastnote = _note1;
if (inlet_active || param_active) {
if (((_gate1 > 0) && !ntrig) || (_note1 != prevnote)) {
ntrig = 1;
op = attr_table.array[((_note1 - start) << attr_blocksize) + offset];
op = !op;
attr_table.array[((_note1 - start) << attr_blocksize) + offset] =
(op * ((1 << 27) - 1 >> attr_table.GAIN));
if (op)
trig = 1;
}
if (!(_gate1 > 0))
ntrig = 0;
}
} else {
if (!lastnote)
lastnote = start;
outlet_note = lastnote;
}
prevnote = _note1;
outlet_trig = trig;
trig = 0;
if ((status == MIDI_NOTE_ON + attr_midichannel) && (data2)) {
_note1 = data1;
_gate1 = 1;
_velo1 = data2;
} 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;
}