# K3 and Sample-Start Offset



## Big Bob (Oct 5, 2007)

I know a lot of you have expressed an interest in whether or not K3 will solve the sample-start offset problem for the DFD mode. The short answer is yes and no :lol: 

In K2 there are two ways to do runtime control of the sample start offset. In the source module, you can assign various controllers (including a CC) to modulate sample-start, SS, and in the KSP you can specify an offset parameter with the play_note() function. Unfortunately, neither of these two methods work in DFD mode. A number of scripts have been written (including the SIPS-Legato script, SLS), that need to change the SS in order to provide smoother 'inside note' transitions. To use these scripts you need to load an instrument in Sampler mode because SS offset is not supported in DFD mode.

To use the SLS in DFD mode, you have to follow a rather laborious process of creating a new set of sample groups with the start of the samples chopped off. So, when we heard that K3 provides the means to modulate the SS, naturally our ears popped up in hopeful anticipation.

Now, here's what I can tell you about K3 and controlling SS. What has changed is that there is a new parameter that is accessed in the Loop Editor named something like Sample Start Modulation Range (I'll refer to this henceforth as SSMR). As best as I can tell, here is how it works. For each sample zone that you set this to a non-zero value, K3 increases the pre-load size for that sample by the specified number of samples. For example, if your samples are sampled at 44.1KHz, you would specify about 44,100 samples for SSMR to have a one-second SS offset range.

Now, if you assign a CC to the sample start parameter, you will be able to change the SS from 0 to 1.0 seconds into the sample. *And, this will work in the DFD mode as well as the Sampler mode*, but, it will only work for those sample zones that you have edited the SSMR for (in the Loop Editor). And, as far as I can determine, there doesn't seem to be any way to edit Loop parameters like this for all zones in a group at the same time. I could be wrong about this because I don't have much experience with using the Loop Editor. So, if someone knows a way to edit an entire group at once, please let us know because that would make this process a whole lot less painful.

Unfortunately, even with all the SSMRs edited, scripts are not able to change SS via the play_note() function offset parameter (at least I wasn't able to do it). Therefore, the only way a script will be able to control SS at runtime is by issuing set_controller commands. But, this will require that the instrument be prepared by editing all the SSMRs and then assigning a CC to modulate them.

To test this I edited a clarinet with one group and simply set the SSMR to 44000 for the 8 sample zones from C3 to G3. I then assigned the Mod Wheel to control SS. When I played notes in the C3 to G3 interval and moved the Mod Wheel I could actually hear the SS offset changing and when I played notes outside of this region there was no effect (running in DFD mode of course). The edited instrument showed the following for memory usage. The Instrument in Sample mode used 30.84M while the unedited instrument in DFD mode used 2.46M. After editing the SSMRs, the DFD memory used increased to 3.16M. This works out to almost exactly 8x2x44000 bytes increase (the clarinet samples are mono). Don't let the percentage increase here mislead you, if I had edited the entire instrument range, the preload usage would probably have increased to about 3.94M, which is about a 56% increase in the preload size.

So, If you plan to use this new feature of K3, your preload size will increase in direct proportion to the SS offset range you need. Moreover, any scripts that merely include an offset parameter in the play_note() function call will have to be modified to instead issue set_controller calls. Finally, such scripts will only work with instruments that have been suitably edited.

So, does K3 solve the SS problem? As I said at the beginning, yes and no :lol: 

God Bless,

Bob


----------



## Dynamitec (Oct 5, 2007)

Hi Bob,
thanks for your "review" of this new feature. I agree that this is really pain to do this way. 

AT LEAST it should be possible to change the sample start modulation range for all selected zones! I don't think it would be to hard to rewrite existing legato tools to incorporate the new feature with set_controller values. But i can't imagine anyone want to to edit 4000 samples by hand just to get a legato sample set >8o 

Best,
Benjamin


----------



## Fernando Warez (Oct 5, 2007)

Thanks for the report Bob. 

The preload size is not all that bad although the process seems so tedious that one might as well edit the sample in a wave editor.. Not all that bad compare to sample mode i mean.

I really hope they will add a global setting for all zones in a group in the near future.


----------



## VonRichter (Oct 8, 2007)

:| 

Would be nice if they could simply include a group-level secondary buffer point that can be addressed in the script.

Sometimes I wonder if all the programmers here shouldn't just make a bare-bones sampler (_not_ a "one-size-fits-all") with all of these tricks built in. I doubt any manufacturer of a general use sampler knows what's needed for truly advanced sample tricks better than we do.

I guess one can only dream...


----------



## Tod (Oct 8, 2007)

I would think with today's technology there could be an option in the DFD mode to pick and choose the pre-load buffer size. Hehe, maybe not. :roll: :D 

It would be especially nice if you could do it on a group by group basis. :mrgreen: :mrgreen:


----------



## Thonex (Oct 8, 2007)

VonRichter @ Mon Oct 08 said:


> Would be nice if they could simply include a group-level secondary buffer point that can be addressed in the script.



Agreed.

Or Sample Start 1, Sample Start 2, and Sample Start 3.

3 sample starts would be able to handle your typical beginning of the sample, after the attack, and the Sample Start 3 could be useful with (say) release triggers.

We can all dream


----------



## Alex W (Oct 8, 2007)

At least it's a step in the right direction.

Who knows, maybe in an update or 2 they'll change it to allow the play_note command to address that function directly. That'd be the first thing for them to do.


----------



## caseyjames (Sep 9, 2009)

*I have s.mod working.... Please help me modify SIPS*

I believe this is now fixed.

I change the s.mod value of one zone. 
I then select all of the zones, making sure I select the modified zone last. 
I click the gear icon in the sample editor->to all selected zones->copy current start-mod settings

This sets the s.mod of all the zones to that of the last selected zone.

my question, as a kontact script neophyte:

Can someone mod SIPS to take advantage of this? 

I'm a few weeks away from a big project and I am revamping my entire template. I discovered SIPS the other day and I absolutely love it. I had it on a bassoon last night and couldn't put it down till 4am


----------



## polypx (Sep 10, 2009)

Yes, I can confirm caseyjames post above.

You can now copy current start-mod settings to all selected zones, in K 3.5.

VERY useful.

cheers
Dan


----------



## acabreira (Sep 10, 2009)

*Re: I have s.mod working.... Please help me modify SIPS*



caseyjames @ September 10th 2009 said:


> I believe this is now fixed.
> 
> I change the s.mod value of one zone.
> I then select all of the zones, making sure I select the modified zone last.
> ...



Excellent finding, this copy s.mod to other zones is going to make my life much easier.

I have modded SIPS some time ago, I´ll link to my post where I ask if the mod is correct:
http://vi-control.net/forum/viewtopic.php?t=13232

If after reading you still want the modded SIPS Legato script, I have attached it here. I´m not sure my solution is the best and I know for sure that the mod is incomplete, since I don´t update the interface to use s.mod.

As I posted there, I´m also not sure if these are enough modifications, It´s some time now since I don´t touch or test the script, but my preliminary tests were successful with the modified code.

Thanks.


----------



## caseyjames (Sep 10, 2009)

The script seems to work here.

There is a slight popping like a hush record crackle (probably at the loop points), but I found that in the old script as well.

I have a LOT of patches I need to retrofit today. I did a little test to see how quickly I could retrofit a patch.

About 3 min. Not bad.


----------



## Fernando Warez (Sep 11, 2009)

> Yes, I can confirm caseyjames post above.
> 
> You can now copy current start-mod settings to all selected zones, in K 3.5.




Thanks for heads up guys.

Now I'm glad i didn't edit all those instruments i wanted to. :mrgreen:


----------



## lux (Sep 19, 2009)

> Now, if you assign a CC to the sample start parameter, you will be able to change the SS from 0 to 1.0 seconds into the sample



sorry to ask, i've tried to assign a cc from the sorce->external->midi cc to the sample start into the wave manager in K3.5, using drag and drop, but it doesnt allow me to automate that parameter with a cc. May i ask how can i assign a midi cc to sample start?

Thanks
Luca


----------



## _taylor (Sep 19, 2009)

lux @ Sat Sep 19 said:


> sorry to ask, i've tried to assign a cc from the sorce->external->midi cc to the sample start into the wave manager in K3.5, using drag and drop, but it doesnt allow me to automate that parameter with a cc. May i ask how can i assign a midi cc to sample start?
> 
> Thanks
> Luca



2 more ways to try,

In 3.5 you can now right click on a parameter and Midi learn. 

Also, go to the auto tab - Midi Automation and drag from there..

hmmm


----------



## Fernando Warez (Sep 20, 2009)

*Re: I have s.mod working.... Please help me modify SIPS*



caseyjames @ Wed Sep 09 said:


> Can someone mod SIPS to take advantage of this?



I don't know but I'd like to know as well. I know it does in sampler mode. Maybe it works on DFD mode with SIPS 2?


----------



## lux (Sep 21, 2009)

spitt @ Sat Sep 19 said:


> lux @ Sat Sep 19 said:
> 
> 
> > sorry to ask, i've tried to assign a cc from the sorce->external->midi cc to the sample start into the wave manager in K3.5, using drag and drop, but it doesnt allow me to automate that parameter with a cc. May i ask how can i assign a midi cc to sample start?
> ...



Thanks for the help but none of them seem to work. I try to link SS in the Wave manager->upper part where's possible to change the value. Probably its not the right place to do it.

Please could anyone help me telling me where's the right place i can use to link the sample start to a controller?

Thanks again
Luca


----------



## lux (Sep 21, 2009)

:cry:


----------



## _taylor (Sep 21, 2009)

Maybe info you already know but,

open up the sample in the wav editor, leave S.Start at 0 turn the S. Mod amount up, you'll see a bar stretch as you adjust. In the source mod panel, same as pitch, you can add a modulator ( external source, midi cc ) and change it from pitch to sample start..


hope this helps


----------



## lux (Sep 21, 2009)

spitt @ Mon Sep 21 said:


> Maybe info you already know but,
> 
> open up the sample in the wav editor, leave S.Start at 0 turn the S. Mod amount up, you'll see a bar stretch as you adjust. In the source mod panel, same as pitch, you can add a modulator ( external source, midi cc ) and change it from pitch to sample start..
> 
> ...



definitely helped, now got it

Thanks a lot


----------

