thru shift

midi thru with a shift inlet. When inlet shift is low it thru's the incoming midi on the selected channel. if inlet shift is high it thru's the selected channel to the shift channel, if you see what I mean
Author: Mattilyn Mattroe
License: you have to give me one token for the car park in the old Purley Sainsbury's each time you use this
Github: matroe/midi/thru shift.axo

Inlets

bool32 shift

Outlets

None

Attributes

combo output device

spinner default channel

spinner shift channel

Declaration
int shiftchannel;
Control Rate
if (inlet_shift) {
  shiftchannel = (attr_shiftchannel - 1);
} else if (!inlet_shift) {
  shiftchannel = (attr_channel - 1);
}
Midi Handler
if (status == MIDI_NOTE_ON + (attr_channel - 1)) {
  MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON + shiftchannel, data1,
            data2);
}
if (status == MIDI_NOTE_OFF + (attr_channel - 1)) {
  MidiSend3((midi_device_t)attr_device, MIDI_NOTE_OFF + shiftchannel, data1,
            data2);
}
if (status == (attr_channel - 1) + MIDI_CONTROL_CHANGE) {
  MidiSend3((midi_device_t)attr_device, shiftchannel + MIDI_CONTROL_CHANGE,
            data1, data2);
}

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

Privacy

© 2024 Zrna Research