i see the bug: if using channel -1 to see all channels, the noteoff velocity is sent. in the other conditional branch (checking for a specific channel) the note-off velocity is assumed to be zero. (the marimba lumina, being a very sophisticated controller, actually sends velocity with note-off, where most keyboards just send zero and this is a non-issue.)
this begs the question, alluded to in code comment: how should we handle note-off velocity? 1) we could choose the approach used in Max, using separate operators for Note On and Note Off. 2) we could add an output to the operator indicating on and off. or 3) we could fix the current code, discarding note-off velocity.
... if (com == 0x8) {
// note off
if(op->chan == -1) {
num = (data & 0xff0000) >> 16;
vel = (data & 0xff00) >> 8;
net_activate(op->outs[0], op_from_int(num), op);
net_activate(op->outs[1], op_from_int(vel), op);
print_dbg("\r\n op_midi note off ; num: ");
print_dbg_ulong(num);
} else {
ch = (data & 0x0f000000) >> 24;
if(ch == op->chan) {
// matches our channel, so perform it
num = (data & 0xff0000) >> 16;
vel = (data & 0xff00) >> 8;
net_activate(op->outs[0], op_from_int(num), op);
// FIXME: should noteoff be a separate op, retain release velocity?
/// or, a 3rd output for on/off ?? hm
net_activate(op->outs[1], 0, op);
}
}