What's new

The Variable Delay Compensator (v1.6): Another multi script for CSS...but for any others, too!

kpmuzik

Active Member
As the developer of Section Leader, I now present a multi script far less ambitious but hopefully far more usable: the Variable Delay Compensator (VDC).

Before I continue, I want to shout-out the currently available solutions for making "laggy" libraries easier to work with:
There's no point in acting like this hasn't been done before. You have options! (Did I miss any?) Check them out if you haven't already and come back when you're done.

So first, I'd like to demonstrate the vernacular I've come to use regarding delay compensation: "If a library's legato transition takes 50ms to sound, it has 50ms of lag and therefore requires 50ms of lead (rhymes with "seed") to compensate." Basically, "lead" here is short for "lead time" as I got tired of saying "negative delay".

Alright, so let's take a look at the UI:

Lead Conditions.png

Lead Algorithms.png

Indeed, it's not skinned this time, but I wanted to focus on "function" before going all-out on the "form".

As for how this works, we have lead conditions that choose lead algorithms. Lead conditions are defined by rulesets that are comprised of up to 4 rules that must all be satisfied before choosing its respective lead algorithm. Lead algorithms define the first-note leads and legato-note leads for up to 8 velocity ranges, each of which are identified by their max velocity.

Please refer to the attached PDF manual for all the details!


Changelog:
v1.6 (10/11/23)
  • Added support for acknowledging notes extended by sustain pedal (CC64). If the pedal is depressed before the last note-off, the next note-on will use a legato-note delay instead of a first-note as long as the pedal is still depressed.
  • Added the “Original Note-Length Timing” mode made available by a new button in the Advanced Options page.
  • Fixed issue with hanging notes occurring when transport-activation is on and DAW playback is stopped for certain virtual instruments in certain DAWs.
  • Fixed issue with CC activity still being delayed when transport-activation should have suspended all delays.
  • Now requires a least Kontakt 6.8.0 (up from 6.7.1).
v1.5.1 (9/12/23)
  • Improved auto-bypass behavior by allowing keyswitches and other state-changing messages to pass through while transport isn't running.
v1.5 (2/19/23)
  • Added transport-based activation. Script bypasses itself if transport isn't detected so script-induced delays only occur during DAW playback. Stopped transport also resets state.
  • Added "Advanced Options" page
    • Global offset is moved here
    • Added ability to set "playback gap" (used to be a hidden value): When forced to move an event "out of the way" to preserve note order in applying legato algorithms, this is the size of the gap it leaves between the event it "shoved" and the new event. This keeps note-on/-off events from ending up too close together for the instrument to process properly.
    • Added toggle for transport-based activation (active by default)
  • Added one-note trill support for CSS (bundled CSS preset now utilizes this): A lead algorithm can optionally send the extra note (as a blip) required to fully select a trill in CSS.
  • Added version number to script title
  • Improved status display when algorithm selection is underdetermined
  • Fixed behavior of bypassed rulesets so that they properly can't be activated
  • Fixed possible hanging notes upon transport stop when transport-based activation is on
  • Fixed various issues possible when using different channels simultaneously in "Channel = Alg" mode
v1.4 (2/9/23)
  • Fixed oversight allowing queued keyswitches/CCs to default to channel 1 when used in a rule
  • Fixed value_edit focus issue for rule editors
v1.3 (2/5/23)
  • Non-momentary keyswitches now transmit both a note-on and a note-off when released to play just before a playable note
v1.2 (1/31/23)
  • Fixed issue with channel-based logic implementation to keep queued events from affecting those of other channels
v1.1 revision (1/23/23)
  • Renormalized bundled CSS preset (+75ms) so advertised delay (upper-right) corresponds much more closely with the negative track delay you'll need to use
v1.1 (1/21/23):
  • Added option for channel-based logic
v1.0 revision (1/18/23):
  • Resaved multi script in Kontakt 6.7.1 for Kontakt 6 compatibility
 

Attachments

  • Variable Delay Comp v1.6.zip
    36.5 KB · Views: 164
  • VDC Manual.pdf
    435.3 KB · Views: 201
Last edited:
I put it in the right directory (presets / Multiscripts / Nando). It appears in Kontakt as a choice. But when I click it, it doesn't load. Nothing happens. If I click Edit, the editor is empty. I restarted Reaper, same thing.

Kontakt 6.7.1 on Reaper on Windows 10.
 
I put it in the right directory (presets / Multiscripts / Nando). It appears in Kontakt as a choice. But when I click it, it doesn't load. Nothing happens. If I click Edit, the editor is empty. I restarted Reaper, same thing.

Kontakt 6.7.1 on Reaper on Windows 10.
Well this is embarrassing!

I might know what's happening, but I won't be in a position to update this for a few hours (away from workstation). For now, can you try renaming the nkp file "Variable Delay Compensator v1.0.nkp" then reloading Kontakt to see if that helps? If it doesn't, I may have to resave it on my end and double-check that it works before reuploading.

(Edited to correct filename)
 
Actually I've figured it out. Turns out saving in Kontakt 7 locked it out of being able to be opened in earlier versions (I was able to recreate). Resaving in Kontakt 6 seems to have cleared that up. Couldn't go back further as Kontakt 5 wouldn't take, but hopefully that's fine for most.

The original post has been updated. The script should now work in Kontakt 6.7.1 and Kontakt 7 (at the very least).
 
Within the limitations of Kontakt multi scripts, this is going to have been an incredible amount of work. That you have managed to make the ruleset and their effects so generic is excellent.

I will have to give this a go!
 
Updated script to v1.1 to now have a channel-based mode!

I actually wanted to implement this from the start as I know there are plenty who prefer to separate articulations by channel. However, I originally felt it would require a potential under-the-hood overhaul, so I put it off for a later version. Then it dawned on me, a simple way to implement this without such overhaul, hence this somewhat quick release.

Users who wish to use the new mode will have to activate the bottom selection of the channel selector (bottom-right of the UI). As always, feedback is welcome.
 
This is great kpmusik.
Big thanks to you.

I test with berlin strings. so far it's great.

I'm not sure it's possible but it will great if VDC accept multi channel.
I combine channel with cubase expression maps.
If I combine 3 channel then I need 3 instance of KSP script. right?
It will great If we can specify channel on each condition.

And Off delay setting is great. but it's working on globally right?
can we set up off delay setting individual on each condition?
Because it might be problem on sus or short note.

And I wish we can name each condition eg. spic, legato

Thanks!
 
Last edited:
I'm not sure it's possible but it will great if VDC accept multi channel.
I combine channel with cubase expression maps.
If I combine 3 channel then I need 3 instance of KSP script. right?
It will great If we can specify channel on each condition.
This was actually the subject of the recent 1.1 update. (Download from the top post again if you're not already using v1.1.) Use the channel selector in the lower-right corner and select the bottom option, "Channel = Alg". The algorithm would then be selected by channel instead of the rules.

If instead you need rules prepared per channel, then yes you're right: you need an instance per channel. For that you use the channel selector of each instance to select which channel to process.

And Off delay setting is great. but it's working on globally right?
can we set up off delay setting individual on each condition?
Because it might be problem on sus or short note.
It affects all notes no matter the active rule/algorithm, yes. It is only there to allow notes that are close to overlapping to actually overlap. Shorts are generally not affected by overlap or note lengths, so this setting shouldn't cause issues there. If it's causing problems with sustains, you may have to describe the problem or the potential problem.
 
A common problem that might arise (but I have not tested it in VDC yet) is on repeated pitches. A naif implementation wouldn't see the repeated pitches and allow the 1st note off message to cut short the 2nd note on, resulting in undesired silences.

One use case for off delay in algorithms is this: In CSS, I think Violins 1 legato have a much longer and more pronounced release than all the other instruments and articulations. I thought a negative release delay could be used to counteract this, but I wouldn't want the same number on all articulations or instruments.

About channels. I use CSS with the transposition trick to get divisi a 2. So I have 10 instances of CSS (string quintet times 2) distributed over 4 or 5 Kontakt instances. I thought with the update I could use only one VDC with only one set of rules managing many channels. Maybe even all 10 channels if I use Kontakt as a MIDI effect and then route the MIDI to the other Kontakt instances containing the instruments.

By the way, one benefit of putting VDC in its own empty instance of Kontakt and then routing the MIDI is this: In Reaper I can then bypass the delay simply by selecting the destination track directly and playing on my MIDI keyboard. In fact, I use Dorico but host VIs in Reaper. The 2 apps are connected by virtual MIDI cables. My Dorico files are lighter because they do not contain any VSTs, the entire template is in Reaper. In Reaper I have a set of tracks receiving the MIDI from Dorico, that's where I put delay plugins. So I can audition my VIs without delay simply by selecting the track with the VI in Reaper -- no need to open the FX and no way to forget a temporarily disabled delay plugin.
 
A naif implementation wouldn't see the repeated pitches and allow the 1st note off message to cut short the 2nd note on, resulting in undesired silences.
I was quite aware of this. It's a special case that I hope you find works as expected.

I thought with the update I could use only one VDC with only one set of rules managing many channels.
Right now, only one algorithm can be active at a time globally. I wanted to make sure this works for everyone before I go to making it possible to allow multiple states at a time (requires a bit of additional work to implement, and I wasn't sure if it'd be in enough demand to justify it). You'll just have to use multiple script slots to do what you're doing and make use of presets to shares states across your sections (this was my workflow except that I hosted each part in their own Kontakt instance).

The multi-channel workflow of the VDC is solely for those who select articulation by channel in place of keyswitches entirely. It assumes that for each channel there's no further articulation selection (and therefore no need for the ruleset portion of the script).
 
One use case for off delay in algorithms is this: In CSS, I think Violins 1 legato have a much longer and more pronounced release than all the other instruments and articulations. I thought a negative release delay could be used to counteract this, but I wouldn't want the same number on all articulations or instruments.
I'll take this as another vote for conditional off-delays. I was only thinking about "assisted-overlap" when I implemented this. It's also restricted to positive values making it doubly unsuitable for that use-case. If I do come around to implementing this, it would become another setting per lead algorithm, but that manipulation wouldn't change overlap to gap or vise-versa like the global one would. I'd probably refer to it as a "release trim" (that can be positive or negative) to distinguish it.
 
I have a problem with Berlin strings multi (Kontakt)

1674468304840.png

Set note (via expression map attribute)
SPIC - SPIC - PIZZ - PIZZ - SPIC - SPIC - PIZZ - PIZZ

when I play.. It sound
SPIC - SPIC - SPIC - PIZZ - PIZZ - SPIC - SPIC - PIZZ

and I rewind to first note
sound PIZZ first.

When I bypass script it's fine
It's like one step pushed

ps: sorry for my english. I don't know if I explain correctly
 
You described it fine, no worries.

So what I suspect is that your expression map MIDI doesn't have matching rules prepared in your VDC configuration.

The complication is that since the VDC messes with MIDI timings, it has to know the function of every MIDI signal that comes through it to know where to line them up. The VDC infers this from the rules you've configured.

From the OP:
Are Keyswitches/CC Delayed? - Any keyswitch or CC that is used in any rule (bypassed or not) are queued to play just before a playable note is to be played. All others are delayed by the amount indicated in the upper-right corner (what you should set your track negative-delay to) so your performance CCs and such play in time with the metronome and when your instrument sounds. In effect, you shouldn't have to don't worry about this.
What this means is that if only some articulations require delay compensation, you still have to create rules for the articulations that don't require the compensation (sorry if that wasn't clear). Just assign them to an all-zeroes algorithm with the appropriate Poly setting. See my included CSS preset as an example (just don't overwrite your settings with it!).

If that is not the issue, then I'll need more detail:
  1. your exported preset (nka) that is producing this issue
  2. what MIDI your expression map is sending for spiccato and pizzicato
Unfortunately, I don't own any OT libraries, but I should still be able to figure it out.
 
Thanks for you time kpmuzik

To switching articulation I send keyswitch
I tested with other keyswitching library but same result.
I tested with vienna ensemble pro and internal cubase kontakt also same.

In my expression map
I send keyswitching note and cc for lead condition (like cc 24:1 for alg 1, cc24:2 for alg 2)

I attached nka and screen record.

Thank you
 

Attachments

  • 20230124_061241.mp4
    934.3 KB
  • test.rar
    206 bytes · Views: 3
I think I'm seeing the misunderstanding.

The idea is to use the same keyswitches (or CCs) as what your library is using for switching articulations. That way the keyswitch (or CC) performs switching the algorithm (in the VDC) and switching the articulation (in your library). The rules should largely resemble your expression map, and you shouldn't have to change your expression map to use the VDC. No need to send special algorithm-switcher CCs or anything.

Because you don't have the keyswitch programmed in a rule, the VDC is delivering them too late for your use case (40ms too late judging by your screen recording). Instead of using CC24 in the VDC, configure your rules to use your library's keyswitches instead. (And just in case you haven't already figured it out, press the CC button until you get the keyswitch rule type.)
 
Trying this in Studio One. I have to put -400 in the track to get CSS sound in the beat, but in the right corner I see 285 ms.

As I understand Alg 1 is for Low Latency, Alg 2 is for Expressive.

Trying to do Woodwinds and Brass
 
Top Bottom