Patch samples stop working when zone remapped?

djchimneysparrow
djchimneysparrow Member Posts: 9 Member
edited March 2022 in Kontakt

Hi everyone, I've been exploring forums and looking at the manual, but I can't seem to find the answer to what I though was an easy question, but now seems increasingly complex:


I'm using the latest (full) version of Kontakt, and I would like to create a track that maps a wide range of percussion sounds - the lower sounds like base drums would be on the bottom end, and the cymbals, etc. near the top.


I'm using the Symphony Series Percussion Library (starting with the bass drums), and want to remap the zones at which the samples trigger. However, when I move the zones over, I can't hear anything, on either the original zone, or the one I moved it over to.


I've tried moving over all samples in the list view of the editor for a specific key, and have also tried dragging in samples from the browser, but with the same result. The zone and root key are moving together, so I don't see why the sample wouldn't trigger when the new key is pressed.


I also tried looking at a few other NI patches, and some of them (like Alicia's Keys) worked fine when I moved the zone over. Others (like Action Strikes) clearly have some sort of additional script running, as the key zones activating are nowhere near the keys actually pressed. I'm starting to feel badly out of my depth here.


Is there a straightforward way to change the key at which a certain sample or group of samples is played, or if the answer is more complicated, can anyone recommend some resources that might move me in the right direction?


Thanks.

Tagged:

Best Answer

  • EvilDragon
    EvilDragon Moderator Posts: 1,023 mod
    edited March 2022 Answer ✓

    Ah no, this script is for remapping keys per individual channel, it doesn't remap key w from channel x to key y on channel z.


    That said, the MIDI channel dropdown in the above script I wrote is just a display/editor change. It doesn't change your incoming MIDI channel at all - it just selects which MIDI channel you're remapping keys for.

Answers

  • EvilDragon
    EvilDragon Moderator Posts: 1,023 mod
    edited March 2022

    It's very likely that custom scripting for the particular library you've tried to modify already has hardcoded playable ranges, so you moving zones around messes this up.

    What you could try doing is use the Remap Keyboard multiscript - with this one you can remap which key plays which other key, for each MIDI channel separately.

  • djchimneysparrow
    djchimneysparrow Member Posts: 9 Member

    Thanks EvilDragon, that definitely sounds like what I'm looking for. Is there a way to have certain keys remapped to a particular MIDI channel (without having to press separate buttons)? I see Orange Tree has a multiscript for changing channels by pushing certain keys, but would love to just know certain keys will trigger the instrument I want without wondering what channel I'm on, or having to waste time cycling through them all.


    I see there's a 'change keys' function, which only appears to work on 12 keys per instance, or a 'remap keyboard', which looks much more extensive. Can I assume it's the latter you are referring to for this feature?

  • EvilDragon
    EvilDragon Moderator Posts: 1,023 mod

    I did mention Remap Keyboard, since that one enabled you to remap each and every MIDI channel available in Kontakt. But you do have to remap each channel separately, there are no copy-paste facilities.

  • djchimneysparrow
    djchimneysparrow Member Posts: 9 Member

    Pardon, I see that you did.


    However, I don't see how to change MIDI channels using remap keyboard. The remapping of the keys for a particular channel seem clear enough, but the only way I can find to change channels is with the dropdown.


    Another issue that has come up with this is the MIDI channel I select through remap keyboard seems to apply to any instrument selected, regardless of what MIDI channel that instrument is on. I'll try and explain further in case others are having this issue:

    1. I upload two instruments (say, a bass drum and a rototom) into Kontakt, on MIDI channels 1 + 2 respectively.
    2. Then I go to the remap keyboard preset, and adjust a key for MIDI channel 1. Now if I press that key, the actual key triggered is the one I mapped it to.
    3. If I highlight EITHER instrument (including the one on MIDI channel 2) the remapped key activates, but only for the highlighted instrument.
    4. Then if I choose MIDI channel 2 from the remap keyboard dropdown and remap a new key, only that key is remapped if I press it - and again, only for whichever instrument is selected.
    5. I've also tried setting both instruments to the same MIDI channel, which causes the remapped key to apply to both instruments simultaneously - not good if some notes overlap.

    In other words, the MIDI channel dropdown on the remap keyboard seems to behave more like a preset that's applied to all instruments equally.

    All this said, I'm brand new to working with Kontakt, so I'm probably missing something. Thanks for your patience.

  • EvilDragon
    EvilDragon Moderator Posts: 1,023 mod

    You're right, there IS a bug in that multiscript! Well, we need to fix that. Here's a modified version of that script that works properly, plus also adds copy/paste options:

    on init
       message("")
    
       declare const $NUM_CHANNELS := 64
       declare const $KEYMAP_SIZE := 128
    
       set_script_title("Remap Keyboard")
       set_ui_height(3)
    
       declare $i
       declare $j
       declare %clipboard[$KEYMAP_SIZE] := (-1)
       declare %keymap[$KEYMAP_SIZE * $NUM_CHANNELS]
       declare !ports[4]
       !ports[0] := "[A] "
       !ports[1] := "[B] "
       !ports[2] := "[C] "
       !ports[3] := "[D] "
    
       $i := 0
       while ($i < $KEYMAP_SIZE)
          $j := 0
          while ($j < $NUM_CHANNELS)
             %keymap[($KEYMAP_SIZE * $j) + $i] := $i
    
             inc($j)
          end while
    
          inc($i)
       end while
    
       declare ui_table %Remap[128] (1, 1, 127)
       move_control_px(%Remap, 59, 2)
       set_control_par(get_ui_id(%Remap), $CONTROL_PAR_WIDTH, 518)
       set_control_par(get_ui_id(%Remap), $CONTROL_PAR_HEIGHT, 102)
    
       declare ui_menu $Channel
       move_control_px($Channel, 59, 107)
    
       $i := 0
       while ($i < $NUM_CHANNELS)
          add_menu_item($Channel,"MIDI Ch: " & !ports[$i / 16] & $i mod 16 + 1,$i)
    
          inc($i)
       end while
    
       declare ui_button $MIDISelect
       set_text($MIDISelect, "MIDI Select")
       set_control_par(get_ui_id($MIDISelect), $CONTROL_PAR_TEXT_ALIGNMENT, 1)
       move_control_px($MIDISelect, 149, 107)
    
       declare ui_value_edit $From (0, 127, $VALUE_EDIT_MODE_NOTE_NAMES)
       move_control_px($From, 239, 107)
    
       declare ui_value_edit $To (0, 127, $VALUE_EDIT_MODE_NOTE_NAMES)
       move_control_px($To, 330, 107)
    
       declare ui_menu $Edit
       add_menu_item($Edit, "Edit...", -1)
       add_menu_item($Edit, "--------------------------", -1)
       add_menu_item($Edit, "Copy Mapping", 1)
       add_menu_item($Edit, "Paste Mapping", 2)
       add_menu_item($Edit, "--------------------------", -3)
       add_menu_item($Edit, "Reset Mapping", 3)
       add_menu_item($Edit, "Reset All Mappings", 4)
       move_control_px($Edit, 490, 107)
    
       set_control_help(%Remap, "Remapping Table: Displays the keyboard mapping of the currently selected <MIDI Channel>.")
       set_control_help($Channel, "MIDI Channel: Selects the MIDI channel for editing the keyboard mapping.")
       set_control_help($MIDISelect, "MIDI Select: Selects the <From Key> based on the incoming MIDI notes over the selected <MIDI Channel>.")
       set_control_help($From, "From Key: Selects which key to remap.")
       set_control_help($To, "To Key: Selects to which key will the <From Key> be remapped.")
       set_control_help($Edit, "Edit Options: Offers copy, paste and reset options for the keyboard mappings.")
    
       make_persistent($Channel)
       make_persistent(%keymap)
    
       read_persistent_var($Channel)
       read_persistent_var(%keymap)
    
       $i := 0
       while ($i < $KEYMAP_SIZE)
          %Remap[$i] := %keymap[($KEYMAP_SIZE * $Channel) + $i]
          inc($i)
       end while
    
       $From := 60
       $To := %Remap[$From]
    end on
    
    
    on midi_in
       if ($MIDI_COMMAND = $MIDI_COMMAND_NOTE_ON)
          if ($MIDI_CHANNEL = $Channel and $MIDISelect = 1)
             $From := $MIDI_BYTE_1
             $To := %Remap[$MIDI_BYTE_1]
          end if
    
          set_event_par($EVENT_ID, $EVENT_PAR_MIDI_BYTE_1, %keymap[($KEYMAP_SIZE * $MIDI_CHANNEL) + $MIDI_BYTE_1])
          exit
       end if
    
       if ($MIDI_COMMAND = $MIDI_COMMAND_NOTE_OFF)
          set_event_par($EVENT_ID, $EVENT_PAR_MIDI_BYTE_1, %keymap[($KEYMAP_SIZE * $MIDI_CHANNEL) + $MIDI_BYTE_1])
          exit
       end if
    
       if ($MIDI_COMMAND = $MIDI_COMMAND_POLY_AT)
          set_event_par($EVENT_ID, $EVENT_PAR_MIDI_BYTE_1, %keymap[($KEYMAP_SIZE * $MIDI_CHANNEL) + $MIDI_BYTE_1])
          exit
       end if
    end on
    
    
    on ui_control (%Remap)
       $i := 0
       while ($i < $KEYMAP_SIZE)
          %keymap[($KEYMAP_SIZE * $Channel) + $i] := %Remap[$i]
          inc($i)
       end while
    
       $From := $NI_CONTROL_PAR_IDX
       $To := %Remap[$NI_CONTROL_PAR_IDX]
    
       set_midi($Channel, $MIDI_COMMAND_CC, 123, 1)
    end on
    
    on ui_control ($Channel)
       $i := 0
       while ($i < $KEYMAP_SIZE)
          %Remap[$i] := %keymap[($KEYMAP_SIZE * $Channel) + $i]
          inc($i)
       end while
    
       $To := %keymap[($KEYMAP_SIZE * $Channel) + $From]
    end on
    
    on ui_control ($From)
       $To := %keymap[($KEYMAP_SIZE * $Channel) + $From]
    end on
    
    on ui_control ($To)
       %keymap[($KEYMAP_SIZE * $Channel) + $From] := $To
       %Remap[$From] := $To
       set_midi($Channel, $MIDI_COMMAND_CC, 123, 1)
    end on
    
    on ui_control ($Edit)
       $Edit := abs($Edit)
    
       select ($Edit)
          case 1
             $i := 0
             while ($i < $KEYMAP_SIZE)
                %clipboard[$i] := %Remap[$i]
                inc($i)
             end while
          case 2
             if (%clipboard[0] # -1)
                set_midi($Channel, $MIDI_COMMAND_CC, 123, 1)
    
                $i := 0
                while ($i < $KEYMAP_SIZE)
                   %Remap[$i] := %clipboard[$i]
                   %keymap[($KEYMAP_SIZE * $Channel) + $i] := %clipboard[$i]
                   inc($i)
                end while
             end if
          case 3
             set_midi($Channel, $MIDI_COMMAND_CC, 123, 1)
    
             $i := 0
             while ($i < $KEYMAP_SIZE)
                %Remap[$i] := $i
                %keymap[($KEYMAP_SIZE * $Channel) + $i] := $i
                inc($i)
             end while
          case 4
             $i := 0
             while ($i < $KEYMAP_SIZE)
                %Remap[$i] := $i
    
                $j := 0
                while ($j < $NUM_CHANNELS)
                   %keymap[($KEYMAP_SIZE * $j) + $i] := $i
    
                   inc($j)
                end while
    
                if ($i < $NUM_CHANNELS)
                   set_midi($i, $MIDI_COMMAND_CC, 123, 1)
                end if
    
                inc($i)
             end while
       end select
    
       $Edit := -1
    end on
    


  • djchimneysparrow
    djchimneysparrow Member Posts: 9 Member

    Nice! Looks like that resolved the second issue.

    Now I just need to figure out how to change MIDI channels. As I mentioned earlier, it looks like I should be able to set up channel switching with Orange Tree, but it would be great if the individual keys could be mapped to a specific channel (w/o me having to manually change the MIDI channel in the remap keyboard dropdown of course).

    Is this possible, or am I stuck with the Orange Tree option? Thanks again for all your help with this.

  • EvilDragon
    EvilDragon Moderator Posts: 1,023 mod
    edited March 2022 Answer ✓

    Ah no, this script is for remapping keys per individual channel, it doesn't remap key w from channel x to key y on channel z.


    That said, the MIDI channel dropdown in the above script I wrote is just a display/editor change. It doesn't change your incoming MIDI channel at all - it just selects which MIDI channel you're remapping keys for.

  • djchimneysparrow
    djchimneysparrow Member Posts: 9 Member

    Fair enough, and I really appreciate the assistance. Looks like I'm going the Orange Tree route, or maybe spending a week building my own percussion player from the sample libraries. Cheers!

Back To Top