What's new

Kontak skipping cc values?!

Libamaj

New Member
Hi there!
I have noticed an issue, for example i want the script to do something when the cc1 value is 64. But when i move the controller fast nothing happens, when i move slowly i get the message. As if kontakt missed the cc values on fast moves. In reaper with ReaControlMIDI i get all cc messages if i move fast the controller. Or i do something wrong? here's the code:

Code:
on init
  message("")
end on

on controller
  if ($CC_NUM=1)
    if (%CC[$CC_NUM]=64)
        message("yep")
    end if
  end if
end on
 
Hi, there.

You need some serious aiming skills to target a specific CC value manually in realtime.
Some libraries make extensive use of CC to target articulations and such, but when the goal is realtime functionality, they tend to opt for a range instead.

For your case, consider if you actually need a value. Otherwise, you should go with ranges or a simple higher/lower than boolean operation.

Cheers
 
Actually i don't want to target a specific cc, i just want to move the slider and when the controller send the specific cc message (in this case 64) than the script do something. What i don't understand if the controller send all the 128 messages when i move up full or down, in theory the 'on controller' callback runs 128 times, than why don't run 128 times when i move it fast?
 
Most likely your controller is not sending all 128 messages. You can test that with the MIDI Monitor script in verbose mode.
 
Yep! The controller skips some messages randomly, i tought not, but yes pffff.
Thanks!
 
Buy the way, this is interensting, when i move the controller fast, kontakt's midi monitor shows about 10 messages, Reaper's ReaControlMIDI shows about 110 messages. I'm not a proggrammer, i don't know how it works, but this is interesting.
 
My opinion is that kontakt has serious design flaws in the way it handles cc messages. I think it may thin down the cc signal to once per process block, but dont really know for sure; we just see often strange things with fine detailed cc work into kontakt.
 
Interesting. I just did a similar test in Cubase, I drew a straight line that included 127 CC1 values, from 1 to 127, in about a quarter of a second. Kontakt only caught about every 4th to 6th value.

I tried changing the audio buffer, but didn't seem to make much difference.
 
every host may handle it differently, but there is no garauntee that the process block size will be the same as the audio buffer size. The host can make numerous callbacks to plugins with the space of time of a single audio buffer. Each call represents one "process block", and each plugin gets to operate on that process block during the callback. So making the audio buffer really small may not make any difference to the actual process block size.. If you can go down to a 32 sample buffer you might see it shrink a little. But lots of hosts use a larger buffer size anyway for non-live tracks, so I don't think it will make any difference. LogicPro has a process buffer size setting, can try setting it to small and see what happens.

My advice for Kontakt is

  1. Don't use CC articulation switches. Ever. But especially if you ever want to have poly-articulation chords or if you need for some reason to have a series of two CC's (of the same number) as switches in front of a note.

  2. Don't expect such fine grain CC precision. Generally for typical CC use where you're using it to handle expression or whatever, you probably don't need more then one CC message per process block. A process block is probably around 1ms, maybe less, worth of audio. So Kontakt just uses the last message it got (for each CC num), most likely..and all processing in that process block will happen with that latest CC value. The granularity there is 1ms, give or take half a millisecond..that is probably quite enough granularity honestly for that kind of thing. Even though the midi monitor shows its not seeming to receive all CC messages, it is just only paying attention to the last one, per ccnum, per process block... The upside is less overhead too, some hosts, such as Logic Pro thin out cc messages on purpose too!
 
Well, if I want a script to react on a CC crossing a value I always have a storage for "previous values" of a these CCs. In the on controller callback I then check if present and previous values are on different sides of the threshold value (with the threshold value itself of course belonging to one side) and then I perform the desired action. I never rely on the exact value being received. Apart from that I'm glad that a full swing of the modwheel does not cause the occb being called 127 times.
 
I drew a straight line that included 127 CC1 values, from 1 to 127, in about a quarter of a second. Kontakt only caught about every 4th to 6th value
Same here, that is really weird! The value simply doesn't get updated, neither wait nor listener callback were of much help.
 
Top Bottom