I wrote this to remap the midi output from my Alesis Nitro Kit into different channels the Elektron Model: Cycles understands:
drums = midi.connect(1)synth = midi.connect(2)local note_to_channel = {[36] = 1,[46] = 2,[23] = 2,[42] = 2,[44] = 2,[38] = 3,[48] = 4,[45] = 5,[43] = 6}function init()print('yoooo')drums.event = handle_midiendfunction handle_midi(data)msg = midi.to_msg(data)velocity = data[3]if msg.type == 'note_on' thenprint(note_to_channel[msg.note])synth:note_on(60, velocity, note_to_channel[msg.note])endif msg.type == 'note_off' thensynth:note_off(60, velocity, note_to_channel[msg.note])endend