thru ch translate

Midi thru with channel translate, messages on the inchannel are sent as the outchannel to the device
Author: Mattilyn Mattroe
License: You have to take me out for a night on the town if you use this more than 3000 times
Github: matroe/midi/thru ch translate.axo

Inlets

None

Outlets

None

Attributes

spinner inchannel

spinner outchannel

combo output device

Midi Handler
if (status == MIDI_NOTE_ON + (attr_inchannel - 1)) {
  MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON + (attr_outchannel - 1),
            data1, data2);
}
if (status == MIDI_NOTE_OFF + (attr_inchannel - 1)) {
  MidiSend3((midi_device_t)attr_device, MIDI_NOTE_OFF + (attr_outchannel - 1),
            data1, data2);
}
if (status == (attr_inchannel - 1) + MIDI_CONTROL_CHANGE) {
  MidiSend3((midi_device_t)attr_device,
            (attr_outchannel - 1) + MIDI_CONTROL_CHANGE, data1, data2);
}

if (status == MIDI_POLY_PRESSURE + (attr_inchannel - 1)) {
  MidiSend3((midi_device_t)attr_device,
            MIDI_POLY_PRESSURE + (attr_outchannel - 1), data1, data2);
}
if (status == MIDI_PROGRAM_CHANGE + (attr_inchannel - 1)) {
  MidiSend3((midi_device_t)attr_device,
            MIDI_PROGRAM_CHANGE + (attr_outchannel - 1), data1, data2);
}
if (status == MIDI_PITCH_BEND + (attr_inchannel - 1)) {
  MidiSend3((midi_device_t)attr_device, MIDI_PITCH_BEND + (attr_outchannel - 1),
            data1, data2);
}
if (status == MIDI_CHANNEL_PRESSURE + (attr_inchannel - 1)) {
  MidiSend2((midi_device_t)attr_device,
            MIDI_CHANNEL_PRESSURE + (attr_outchannel - 1), data1);
}

Privacy

© 2024 Zrna Research