right block 1 set

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

Inlets

int32.positive b0

int32.positive b1

Outlets

None

Declaration
uint8_t in[2];
uint8_t prev[2];
uint8_t doit;
uint8_t i;
uint8_t count;
Control Rate
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--;

Privacy

© 2024 Zrna Research