thru ch exclude

mod of mark harris' midi thru object. Thru's all channels EXCEPT the exclude channel. no clock.
Author: Mattilyn Mattroe
License: you can use this once in the autumn of the7th year
Github: matroe/midi/thru ch exclude.axo

Inlets

None

Outlets

None

Attributes

combo input

combo output

spinner sets the channel to exclude

Midi Handler
if (attr_input) {

  if (((status & 0x0F) + 1) != attr_exclude) {
    uint8_t status_type = status & 0xF0;
    if ((status_type == MIDI_CONTROL_CHANGE) ||
        (status_type == MIDI_NOTE_OFF) || (status_type == MIDI_NOTE_ON) ||
        (status_type == MIDI_POLY_PRESSURE) ||
        (status_type == MIDI_PITCH_BEND)) {
      MidiSend3((midi_device_t)attr_output, status, data1, data2);

    } else if ((status_type == MIDI_PROGRAM_CHANGE) ||
               (status_type == MIDI_CHANNEL_PRESSURE)) {
      MidiSend2((midi_device_t)attr_output, status, data1);
    }
  }
}

Privacy

© 2024 Zrna Research