• Register
  • Help
Results 1 to 6 of 6

Topic: Kontakt Keyswitch/Round Robin strangeness

Share/Bookmark
  1. #1

    Kontakt Keyswitch/Round Robin strangeness

    Hello all,
    I bought David Das' new book wch has been a great help in unlocking the Kontakt world. As I am creating a new Keyswitch instrument I am having a strange issue. It goes like this:
    I have 6 instruments key-mapped from C0-F0(Examples)
    VN Marcshort
    VN MarcMed
    VN MarcLong
    VN Spcc RR X6
    VN Marc RR X4
    VN Short RR X3

    The keymapping all works fine but the Latter 2 instruments when you play the them the instruments will cycle through the RR articulations and then there will be "dead hits" or silent hits at the end of the cycle and when you continue to hit the key (twice for the RR X 4 and 3 times for the RR X 3) there is silence. In other words you play the "VN Marc RR X4" instrument hitting the key 4 times and then there is a dead hit for the next two. It is consistently the same number of dead or silent hits each RR cycles.

    Any thoughts

  2. #2

    Re: Kontakt Keyswitch/Round Robin strangeness

    Hi Rixflix,
    I tried this out by constructing an instrument myself with multiple RRs of different length and I'm pretty sure this is a bug in Kontakt. I reported it in the bug list thread on the NI forums. I have not reported it via their support form. Please do that if you find time to.

    Best,
    Nils

  3. #3

    Re: Kontakt Keyswitch/Round Robin strangeness

    Thanks. I will report it to NI. Anybody know if there are workarounds?

  4. #4

    Re: Kontakt Keyswitch/Round Robin strangeness

    Quote Originally Posted by Rixflix
    Thanks. I will report it to NI. Anybody know if there are workarounds?
    As long as the longer RRs are of multiples lengths of the shorter you should be ok. Eg. say one is RR x 4 and one is RR x 2, then you can change the RR x 2 to a RR x 4 and setup a 1->2->1->2 sequence with OR conditions. Or if you're willing to let the sequence differ from a script round robin (eg. 1->1->2) you'd be ok without having the lengths as multiples. Just be sure to make all RRs equally long.

    You can also use scripts, which I find can be a better solution anyway, because they can let you play polyphonically. Say you set up a RR x 2, then if you play a sequence of pairs of notes you might still get the machine gun effect, since each pair resets the round robin state and you'll get position 1 for every start tone.
    With a script you can check the interval between notes and not advance the RR position if the notes are too close together (indicating that they're played polyphonically). Let me know if you need any help with writing a script - I'll be glad to help you out.

    Best,
    Nils

  5. #5

    Re: Kontakt Keyswitch/Round Robin strangeness

    Nils,
    Thanks for your reply. I have never scripted in Kontakt (or any sampler). I appreciate the work around perhaps you could give me some insight into a script for the action you described.
    Thanks, Richard

  6. #6

    Re: Kontakt Keyswitch/Round Robin strangeness

    Quote Originally Posted by Rixflix
    Nils,
    Thanks for your reply. I have never scripted in Kontakt (or any sampler). I appreciate the work around perhaps you could give me some insight into a script for the action you described.
    Thanks, Richard
    If you're interested in scripting I suggest that you read the script language manual (available as a pdf in the Kontakt documentation folder). The best way to learn is to experiment and to try some of the examples in the documentation out oneself.

    Here's a script that does round robin. It may look a little complicated, but then it also manages all keyswitching and all round robin settings for all groups (you shouldn't set any round robin group start conditions since it's all included in the script). To use it paste it into the Kontakt script editor of an empty script slot. Here's a more colorful version of the same script with more comments.
    Code:
    on init
      declare $rr := 0  
      declare %keyswitches[4] := (24, 25, 26, 27)          { key switches }
      declare %articulation_firstgroup[4] := (0, 2, 4, 8)  { first group of each articulation }
      declare %articulation_numgroups[4]  := (2, 2, 4, 6)  { no. groups of each articulation  }
      declare $articulation := 0
      declare $i
    end on
    
    on note
      $i := search(%keyswitches, $EVENT_NOTE)
      if ($i # -1)
        $articulation := $i
        $rr := 0           
      end if
        
      disallow_group($ALL_GROUPS)  
      allow_group(%articulation_firstgroup[$articulation] + $rr)
        
      inc($rr)
      if ($rr >= %articulation_numgroups[$articulation])
        $rr := 0
      end if
    end on
    Here's an explanation of the script above and a Kontakt2 script crash course:
    the on init section is run once and lets one initialize things. "declare" lets you create variables (named containers of information). Variables that begin with $ contain a single integer value and variables that begin with % contain a list of values. One can assign a value to (store it in) a variable by writing "variable := value". These are the variables declared:
    • $rr - here we store the current round robin position number. If we alternate between 3 groups this number will be between 0 and 2, that is we start counting at zero instead of one.
    • %keyswitches - this is a list (called array) of the key switches you want to use. In the example above there are four keyswitches (C0=24): C0, C#0, D0, D#0.
    • %articulation_firstgroup - this is a list of the index of the first group of each articulation. The script assumes your groups are ordered, so that first comes all groups of the first articulation, then all groups of the second articulation and so on. Unlike in the Kontakt interface scripts start counting at zero, so the first group is 0, the second has index 1 and so on. If your instrument has one RRx3 and one RRx6, these indexes would be 0 (for the first articulation) and 3 (first group of the second articulation).
    • %articulation_numgroups - this is a list of the number of groups (eg. 3 for a RRx3) of each articulation.
    • $articulation - this is the number of the current articulation. The first keyswitch corresponds to 0, the second to 1 and so on.
    You will want to change the three lists above to match the articulations and groups of your instrument.
    The on note part of the script is run for each note that is pressed. It takes care of keyswitching and activating the right group while disactivating all other. The first line in it searches for the note you pressed ($EVENT_NOTE) in your keyswitch array and stores the position in $i. If it's not in the array $i will get the value -1 instead. The next line checks if $i is not equal (#) to -1. If so (the key was a keyswitch key) we update the $articulation and reset the round robin position.

    Then we turns all groups off. Followed by turning the single group we want to use on. The index of the first group of the current articulation is %articulation_firstgroup[$articulation] - which means look at item numbered $articulation in the %articulation_firstgroup list. Since we're using round robin we'll want to use a later group if $rr (the RR position) is greater than zero. To find the right group index to turn on, we add the value of $rr to the index of the first group. Eg. if the the first group of the current articulation is 6 and that articulation has an RRx2, $rr will be either 0 or 1 and the sum will be either 6 or 7. So we will alternate between those groups.

    The last part of the script increments $rr. After incrementing it we must check if it reached the upper limit (the number of RR groups of the current articulation) and needs to be reset to zero.

    If you didn't follow, please don't worry - this was an extremely compressed and quick introduction. The Kontakt Script Language Manual has tutorials and describes things in a slower pace. If your instrument use special release trigger groups the script might need a couple of changes to work. If there's anything you wonder about, please ask.

    Best,
    Nils

Go Back to forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •