bool32.rising stop all active notes
int32.positive index (0 - 512)
bool32.risingfalling start/stop
int32 note
int32 velocity
objref table
uint16_t v;
uint16_t vout;
bool play;
uint8_t active[128];
uint8_t note;
uint8_t velo;
uint8_t i;
i = 128;
if (inlet_play && !play)
play = 1;
if (play) {
v = attr_table.array[inlet_index];
if (v && (v != vout)) {
vout = v;
note = (vout & 127) - 1;
velo = vout >> 8;
active[note] = 1;
}
}
if (!inlet_play && play) {
play = 0;
i = 0;
}
if (inlet_stopall)
i = 0;
if (i < 128) {
if (active[i] > 0) {
note = i;
velo = 0;
active[i] = 0;
}
i++;
}
outlet_note = note;
outlet_velocity = velo;