int32.positive b0
int32.positive b1
None
uint8_t in[2];
uint8_t prev[2];
uint8_t doit;
uint8_t i;
uint8_t count;
in[0] = inlet_b0;
in[1] = inlet_b1;
if (!doit) {
if (in[i] != prev[i]) {
prev[i] = in[i];
doit = i + 1;
}
i++;
i = i % 2;
}
if (doit && !MidiGetOutputBufferPending(MIDI_DEVICE_USB_HOST)) {
MidiSend3(MIDI_DEVICE_USB_HOST, 2, MIDI_CONTROL_CHANGE, doit + 27,
in[doit - 1]);
prev[doit - 1] = in[doit - 1];
doit = 0;
count = 50;
}
if (count)
count--;