i see. so just use the midi thru object and in this section:
if(attr_input) {
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);
flash_cnt = FLASH_LEN;
} else if ( (status_type == MIDI_PROGRAM_CHANGE) ||
(status_type == MIDI_CHANNEL_PRESSURE)) {
MidiSend2((midi_device_t) attr_output,status,data1);
flash_cnt = FLASH_LEN;
}
}
which is the MIDI Code
define an array of 128 bytes that contains your remapping, so position 0 would be what you want to be output when you press midi key 0 on the Akai APC and so on for all 128 (unless there is some fixed offset in which case it would be even simpler)
then you will have to rewrite the code a little to handle note on and off messages separately like so:
name_of_array[128] {put your values in here};
if(attr_input) {
uint8_t status_type = status & 0xF0;
if ((status_type == MIDI_CONTROL_CHANGE) ||
(status_type == MIDI_POLY_PRESSURE) ||
(status_type == MIDI_PITCH_BEND)) {
MidiSend3((midi_device_t) attr_output,status,data1,data2);
flash_cnt = FLASH_LEN;
} else if ((status_type == MIDI_NOTE_OFF) ||
(status_type == MIDI_NOTE_ON)) {
MidiSend3((midi_device_t) attr_output,status,name_of_array[data1],data2);
flash_cnt = FLASH_LEN;
}else if ( (status_type == MIDI_PROGRAM_CHANGE) ||
(status_type == MIDI_CHANNEL_PRESSURE)) {
MidiSend2((midi_device_t) attr_output,status,data1);
flash_cnt = FLASH_LEN;
}
}
this is untested but should get you going. if it is a fixed offset you don't need the array, you can simply add the value to data1 in the note on and note off section above (the edited midi code i posted)