int32.positive b0
int32.positive b1
int32.positive b2
int32.positive b3
None
uint8_t prev[4];
uint8_t in[4];
uint8_t doit;
uint8_t count;
int i;
in[3] = inlet_b0;
in[2] = inlet_b1;
in[1] = inlet_b2;
in[0] = inlet_b3;
if (!doit && !count) {
for (i = 0; i < 4; i++) {
if (in[i] != prev[i]) {
doit = i + 1;
break;
}
}
}
if (doit && !MidiGetOutputBufferPending(MIDI_DEVICE_USB_HOST)) {
MidiSend3(MIDI_DEVICE_USB_HOST, 2, MIDI_CONTROL_CHANGE, doit + 115,
in[doit - 1]);
prev[doit - 1] = in[doit - 1];
doit = 0;
count = 50;
}
if (count)
count--;