holdmap send

references a table, sends note and velocity when an index of the table changes. works good with 'holdmap'
Author: robert schirmer
License: BSD
Github: rbrt/poly/holdmap send.axo

Inlets

bool32.rising redraw

bool32.risingfalling mute

Outlets

None

Attributes

objref holdmap

spinner thin

spinner channel

combo device

Declaration
uint8_t preout[128];
uint8_t counter;
bool trig;
uint8_t thin;
Control Rate
if (!inlet_mute) {
  if (inlet_redraw && !trig)
    memset(&preout[0], 128, 128);
  if (!inlet_redraw)
    trig = 0;
  // send output map
  if (!thin) {
    if ((attr_holdmap.array[counter] != preout[counter]) &&
        !MidiGetOutputBufferPending(MIDI_DEVICE_USB_HOST)) {
      MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON + (attr_channel - 1),
                counter, attr_holdmap.array[counter]);
      thin = attr_thin;
      preout[counter] = attr_holdmap.array[counter];
    }
  } else
    thin--;

  counter++;
  counter = counter % 128;
}

Privacy

© 2024 Zrna Research