Kontakt Key-to-Channel Remapper

A Kontakt multi-script that intercepts incoming MIDI notes from your keyboard and re-maps them by note zone.

What it does

  • Splits the keyboard into channels. Every 4 consecutive keys are mapped to a separate MIDI channel (0 to 15, covering the standard 16 channels) and routed to a specific target note (C3 to D#3).
  • Consolidates instrument layouts. Instead of needing unique key mappings across several loaded instruments, you can use identical instrument patches on different MIDI channels and control them all from a single keyboard layout.

The script

Copy the script into a Kontakt multi-script slot. The start note (C1 = 36), the number of keys per instrument and the target notes are set at the top of the script, so you can adapt them to your own patches.

on init
    { Starting note on your keyboard (C1 = 36) }
    declare const $START_NOTE := 36
    
    { 4 keys per instrument/channel }
    declare const $KEYS_PER_INST := 4
    
    { Target base notes inside the NKI: C3 (60), C#3 (61), D3 (62), D#3 (63) }
    declare %TARGET_NOTES[4]
    %TARGET_NOTES[0] := 60
    %TARGET_NOTES[1] := 61
    %TARGET_NOTES[2] := 62
    %TARGET_NOTES[3] := 63

    { Declare working variables to prevent declaration errors }
    declare $note_offset
    declare $inst_index
    declare $key_offset
end on

on midi_in
    if (($MIDI_COMMAND = 144 and $MIDI_BYTE_2 > 0) or $MIDI_COMMAND = 128 or ($MIDI_COMMAND = 144 and $MIDI_BYTE_2 = 0))
        if ($MIDI_BYTE_1 >= $START_NOTE)
            $note_offset := $MIDI_BYTE_1 - $START_NOTE
            $inst_index := $note_offset / $KEYS_PER_INST
            $key_offset := $note_offset mod $KEYS_PER_INST
            
            { Check if the instrument index fits within the standard 16 MIDI channels (0 to 15) }
            if ($inst_index >= 0 and $inst_index < 16 and $key_offset < $KEYS_PER_INST)
                { Block the original incoming MIDI event }
                ignore_midi
                
                { Send it out on the correct MIDI channel (0 to 15) 
                  with the remapped target NKI key (60 to 63) }
                set_midi($inst_index, $MIDI_COMMAND, %TARGET_NOTES[$key_offset], $MIDI_BYTE_2)
            end if
        end if
    end if
end on

Use case: accelerated percussion loading

The script is especially useful for libraries like Stickbreakers, where each patch is internally mapped to the exact same base keys (C3 to D#3). You can load up to 16 of those patches inside a single Kontakt instance and play them directly across your keyboard, without opening several Kontakts or manually reassigning MIDI maps.

Tip for fast loading: Before saving your instrument channel strip or Multi, purge all samples within the patches. When you load the multi later, it comes up in Kontakt with virtually zero initial memory footprint. You can populate heavy orchestral or percussion templates instantly, and samples only stream into RAM as you activate them.