table store

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.axo

Inlets

int32 offset

int32 startcc

bool32.risingfalling active

Outlets

bool32.pulse pulse if any cc value changes

Parameters

int32 offset

bool32.tgl active

Attributes

objref table

spinner startcc

spinner length

Declaration
int8_t cc;
int8_t cv;
uint8_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)) {
    attr_table.array[(cc - start) + offset] = ((cv << 20) >> 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 = data2;
}

Privacy

© 2024 Zrna Research