cc i any

Receives Midi Continuous Controller messages from any CC number and channel.
Author: Johannes Taelman
License: BSD
Github: midi/in/cc i any.axo

Inlets

None

Outlets

int32.positive midi CC value 0..127

int32.positive midi CC number 0..127

int32.positive midi channel 1..16

bool32.pulse trigger output

Declaration
int32_t _value;
int32_t _cc;
int32_t _channel;
int32_t ntrig;
Init
_cc = 0;
_channel = 1;
_value = 0;
ntrig = 0;
Control Rate
outlet_value = _value;
outlet_cc = _cc;
outlet_channel = _channel;
outlet_trig = ntrig;
ntrig = 0;
Midi Handler
if ((status & 0xF0) == MIDI_CONTROL_CHANGE) {
  _value = data2;
  _cc = data1;
  _channel = (status & 0x0F) + 1;
  ntrig = 1;
}

Privacy

© 2024 Zrna Research