seq midi feedback 8steps

visual feedback of step-sequencer position for bidirectional midi-controllers (f.i. novation launchpad,livid base). the value at inlet 'step' are mapped to 8 midi-notes.
Author: Robert Schirmer
License: BSD
Github: rbrt/old/seq midi feedback 8steps.axo

Inlets

int32 current step

frac32.bipolar delay time for step position display

Outlets

None

Parameters

int32.mini map the step to midi notes

int32.mini map the step to midi notes

int32.mini map the step to midi notes

int32.mini map the step to midi notes

int32.mini map the step to midi notes

int32.mini map the step to midi notes

int32.mini map the step to midi notes

int32.mini map the step to midi notes

int32 note velocity if step > 0

Attributes

objref table

combo device

spinner channel

Declaration
int ntrig;
int32_t val;
int prev;
int32_t map[8];
int i;
Control Rate
map[0] = param_i0;
map[1] = param_i1;
map[2] = param_i2;
map[3] = param_i3;
map[4] = param_i4;
map[5] = param_i5;
map[6] = param_i6;
map[7] = param_i7;

// paint step index
if ((inlet_step != prev) && !ntrig) {
  val = 1 << 30;
  ntrig = 1;
  MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON + (attr_channel - 1),
            map[inlet_step], param_step);
} else {
  if (!(inlet_step != prev))
    ntrig = 0;
  if (val > 0) {
    int32_t t;
    MTOF(-((1 << 12) - inlet_delay), t);
    val -= t >> 3;
    if (val <= 0) {
      MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON + (attr_channel - 1),
                map[inlet_step], 0);
    }
  }
}
prev = inlet_step;

Privacy

© 2024 Zrna Research