Subscribe to RSS feed

KSP: K2 Sample Start Inconsistency

If you want your Kontakt sample library to support Kontakt 2 as well as later versions, there are some format differences that need to be considered. This article explains an inconsistency in the “play_note” function’s sample offset value.

If you use the sample start variable in the “play_note” function, there is an important inconsistency that you need to account for: the conversion ratio between milliseconds (which ENGINE_UPTIME uses) and microseconds (the unit of the sample offset variable) does not equal 1000 as it should, and as how Kontakt 3 and 4 respond. Instead, the ratio is 1081. Basically this means that if you want Kontakt 2 to play a sample starting 1000 microseconds (μsec) in, you have to tell it to start at 1081 μsec to achieve the correct sample start time.

To account for inconsistencies such as this, you need to make separate K2 and K3/K4 patches. What I like to do is include a constant within the script, like this:

declare kontakt.version := 2
declare kontakt.offset_ratio := 2
select (kontakt.version)
case 2
kontakt.offset_ratio := 1081
case 3 to 4
kontakt.offset_ratio := 1000
end select

In previous versions of Kontakt, you used to be able to detect the Kontakt version within the script, using the differences in effect IDs, but that was changed in the latest release of Kontakt 3. Now you have to change the “kontakt.version” variable manually.

Bookmark and Share

Tags: ,

2 Responses to “KSP: K2 Sample Start Inconsistency”

  1. Ben says:

    Can you use CoreGuitar Strawberry with the new free Kontakt 4 player. This would be great, but having to purchase kontakt is putting me off. I wonder if it’s possible to use the free Kontakt 4 with CGS?

  2. Greg says:

    Unfortunately the Kontakt Player (all versions) will only load 3rd party libraries in evaluation mode, which is limited to 30 minutes use at a time. Hopefully I’ll eventually be able to afford the investment to license the Kontakt Player for Strawberry Electric Guitar.

Leave a Reply