table store FULL

writes midi controler data to a table.set the start of the range of the controlers to read out with 'startcc',the length of the range with 'length'. the data is written to the table starting at 'offset'.
Author: robert schirmer
License: BSD
Github: rbrt/midi/in/table store FULL.axo

Inlets

bool32.risingfalling active

int32 offset

int32 startcc

Outlets

bool32.pulse pulse if any cc value changes

int32 index written to

Parameters

bool32.tgl active

int32 offset

Attributes

objref table

spinner startcc

spinner length

Declaration
int8_t cc;
int32_t cv;
int32_t prevcv;
uint8_t prevcc;

uint8_t end;
uint8_t start;
uint32_t offset;

bool chtrig;
Init
prevcv = 0;
prevcc = 0;
chtrig = 0;
Control Rate
start = attr_startcc + inlet_startcc;
end = start + attr_length;
offset = (inlet_offset + param_offset);

if (((cc >= start) && (cc < end)) && (inlet_active || param_active)) {

  if ((cv != prevcv) || (cc != prevcc)) {
    outlet_index = (cc - start) + offset;
    attr_table.array[outlet_index] = __SSAT(cv, 28) >> attr_table.GAIN;
    prevcv = cv;
    prevcc = cc;
    chtrig = 1;
  }

  outlet_chtrig = chtrig;
  chtrig = 0;
}
Midi Handler
if (status == attr_midichannel + MIDI_CONTROL_CHANGE) {
  cc = data1;
  cv = ((33284 * data2) >> 15) << 20;
}

Privacy

© 2024 Zrna Research