None
int32 note on note-on
int32 velocity
bool32.pulse pulse on note-on
bool32.pulse pulse on note-off
bool32 any notes on hold?
spinner startNote
spinner endNote
spinner channel
uint8_t _note;
uint8_t count;
uint8_t _velo;
bool trigon;
bool trigoff;
_note = 0;
trigon = 0;
trigoff = 0;
outlet_note = _note;
outlet_velo = _velo;
outlet_noteOn = trigon;
outlet_noteOff = trigoff;
trigon = 0;
trigoff = 0;
outlet_gate = bool(count);
if ((status == MIDI_NOTE_ON + (attr_channel - 1)) && (data2)) {
if ((data1 >= attr_startNote) && (data1 <= attr_endNote)) {
trigon = 1;
count += 1;
_note = data1;
_velo = data2;
}
}
if (((status == MIDI_NOTE_ON + (attr_channel - 1)) && (!data2)) ||
(status == MIDI_NOTE_OFF + (attr_channel - 1))) {
if ((data1 >= attr_startNote) && (data1 <= attr_endNote)) {
if (count)
count -= 1;
_note = data1;
trigoff = 1;
_velo = 0;
}
} else if ((status == (attr_channel - 1) + MIDI_CONTROL_CHANGE) &&
(data1 == MIDI_C_ALL_NOTES_OFF)) {
count = 0;
}