multiCC

Receives Midi Continuous Controller messages for 4 inputs. Has a binairy selector (2 boolean-inputs) to select between 4 outputs for each midiCC-> 4 controls to 16 outputs.
Author: Remco van der Most
License: BSD
Github: sss/midi/multiCC.axo

Inlets

bool32 selectA

bool32 selectB

Outlets

frac32.positive midi CC 0-63.5

frac32.positive midiCC1b

frac32.positive midiCC1c

frac32.positive midiCC1d

frac32.positive midiCC2a

frac32.positive midiCC2b

frac32.positive midiCC2c

frac32.positive midiCC2d

frac32.positive midiCC3a

frac32.positive midiCC3b

frac32.positive midiCC3c

frac32.positive midiCC3d

frac32.positive midiCC4a

frac32.positive midiCC4b

frac32.positive midiCC4c

frac32.positive midiCC4d

Parameters

int32 ccCV1

int32 ccCV2

int32 ccCV3

int32 ccCV4

int32 midichannel

Attributes

spinner default

Declaration
int32_t ccv[16];
int Csel;
int Csal;
int CC[4];
int Cc;
int channel;
Init
int i;
for (i = 0; i < 16; i++) {
  ccv[i] = attr_default << 20;
}
Control Rate
outlet_midiCC1a = ccv[0];
outlet_midiCC1b = ccv[1];
outlet_midiCC1c = ccv[8];
outlet_midiCC1d = ccv[9];
outlet_midiCC2a = ccv[2];
outlet_midiCC2b = ccv[3];
outlet_midiCC2c = ccv[10];
outlet_midiCC2d = ccv[11];
outlet_midiCC3a = ccv[4];
outlet_midiCC3b = ccv[5];
outlet_midiCC3c = ccv[12];
outlet_midiCC3d = ccv[13];
outlet_midiCC4a = ccv[6];
outlet_midiCC4b = ccv[7];
outlet_midiCC4c = ccv[14];
outlet_midiCC4d = ccv[15];
CC[0] = param_ccCV1;
CC[1] = param_ccCV2;
CC[2] = param_ccCV3;
CC[3] = param_ccCV4;

Csel = inlet_selectA;
Csal = inlet_selectB;
channel = param_midichannel - 1;
Midi Handler
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[0]) &&
    (Csel == 0) && (Csal == 0)) {
  ccv[0] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[0]) &&
    (Csel > 0) && (Csal == 0)) {
  ccv[1] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[1]) &&
    (Csel == 0) && (Csal == 0)) {
  ccv[2] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[1]) &&
    (Csel > 0) && (Csal == 0)) {
  ccv[3] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[2]) &&
    (Csel == 0) && (Csal == 0)) {
  ccv[4] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[2]) &&
    (Csel > 0) && (Csal == 0)) {
  ccv[5] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[3]) &&
    (Csel == 0) && (Csal == 0)) {
  ccv[6] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[3]) &&
    (Csel > 0) && (Csal == 0)) {
  ccv[7] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[0]) &&
    (Csel == 0) && (Csal > 0)) {
  ccv[8] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[0]) &&
    (Csel > 0) && (Csal > 0)) {
  ccv[9] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[1]) &&
    (Csel == 0) && (Csal > 0)) {
  ccv[10] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[1]) &&
    (Csel > 0) && (Csal > 0)) {
  ccv[11] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[2]) &&
    (Csel == 0) && (Csal > 0)) {
  ccv[12] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[2]) &&
    (Csel > 0) && (Csal > 0)) {
  ccv[13] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[3]) &&
    (Csel == 0) && (Csal > 0)) {
  ccv[14] = data2 << 20;
}
if ((status == channel + MIDI_CONTROL_CHANGE) && (data1 == CC[3]) &&
    (Csel > 0) && (Csal > 0)) {
  ccv[15] = data2 << 20;
}

Privacy

© 2024 Zrna Research