right row set

Author:
License: GPL
Github: rbrt/push/right row set.axo

Inlets

int32.positive b0

int32.positive b1

int32.positive b2

int32.positive b3

int32.positive b4

int32.positive b5

int32.positive b6

int32.positive b7

Outlets

None

Declaration
uint8_t in[8];
uint8_t prev[8];
uint8_t i;
uint8_t doit;
Control Rate
in[7] = inlet_b0;
in[6] = inlet_b1;
in[5] = inlet_b2;
in[4] = inlet_b3;
in[3] = inlet_b4;
in[2] = inlet_b5;
in[1] = inlet_b6;
in[0] = inlet_b7;

if (!doit) {
  if (in[i] != prev[i]) {
    prev[i] = in[i];
    doit = i + 1;
  }
  i++;
  i = i % 8;
}

if (doit && !MidiGetOutputBufferPending(MIDI_DEVICE_USB_HOST)) {
  MidiSend3(MIDI_DEVICE_USB_HOST, 2, MIDI_CONTROL_CHANGE, doit + 35,
            in[doit - 1]);
  prev[doit - 1] = in[doit - 1];
  doit = 0;
}

Privacy

© 2024 Zrna Research