# Automaticly start playback 100ms from the beginning of sample



## nrec (Feb 11, 2011)

Hello Community!

What I'm trying to do: I want Kontakt to automaticly playback every sample NOT from the beginning, but skip the first 100ms of every sample and start playback from this point with a determined fade-in.

I kept the whole attack time, when I was cutting my samples. Now I would like to skip this "natural attack" for better playability.


----------



## nrec (Feb 12, 2011)

Alright, thanks a lot!

I also started with the scripting tutorial to understand what I'm doing here.

I still have a problem: I have 2 groups, and the script only works on the second group!? But it should work on both groups! Probably some easy mistake/flaw of mine?!?


----------



## EvilDragon (Feb 12, 2011)

It should work on both groups.


----------



## nrec (Feb 12, 2011)

So far I mangaed to set the sampleoffset and control the volume in a specified range. But strangely it is still only working on Group2 (I have group1 and Group2).

What I could not figure out yet, is how to implement controls for the fade-in of the samples!?

And second: How to change the volume increase/decrease behaviour, which means: I want the volume not to change linear, but more in a concarve curve.

Here is my code so far:

on init
declare ui_knob $SampleOffset(0, 10000000, 1)
declare ui_knob $Volume (300000,800000,10000)
$SampleOffset := 0
$Volume:=0 
end on

on ui_control ($Volume)
_set_engine_par($ENGINE_PAR_VOLUME,$Volume,0,-1,-1)
_set_engine_par($ENGINE_PAR_VOLUME,$Volume,1,-1,-1)
end on

on note
ignore_event($EVENT_ID) 
play_note($EVENT_NOTE,$EVENT_VELOCITY,$SampleOffset,-1)
end on


----------



## polypx (Feb 12, 2011)

This might be obvious, but maybe one of your groups is set to DFD mode without any sample modulation depth?


----------



## nrec (Feb 12, 2011)

Yes, but that was it. Thanks for the obvious hint!


----------



## kotori (Feb 12, 2011)

nrec @ Sat Feb 12 said:


> What I could not figure out yet, is how to implement controls for the fade-in of the samples!?
> 
> And second: How to change the volume increase/decrease behaviour, which means: I want the volume not to change linear, but more in a concarve curve.



Why not just use an AHDSR envelope?


----------



## EvilDragon (Feb 12, 2011)

Too bad that the Curve parameter of AHDSR is only relating to Attack. Decay and Release are always exponential...


----------



## Tod (Feb 12, 2011)

kotori @ Sat Feb 12 said:


> nrec @ Sat Feb 12 said:
> 
> 
> > What I could not figure out yet, is how to implement controls for the fade-in of the samples!?
> ...



I agree Nils, it can either be set up with a script or more simply a modulator.



> Too bad that the Curve parameter of AHDSR is only relating to Attack. Decay and Release are always exponential...



True ED but based on what nrec seems to be trying to do, Decay and Release are sort of after the fact, unless he wants to control them too, right?


----------



## polypx (Feb 12, 2011)

Too bad we can't get at the Flexible Envelope from KSP. It's such a great EG.


----------



## P.T. (Feb 12, 2011)

kotori @ Sat Feb 12 said:


> nrec @ Sat Feb 12 said:
> 
> 
> > What I could not figure out yet, is how to implement controls for the fade-in of the samples!?
> ...



If the sample has a bit of a swelling attack and you want to not have that swell then the ADSR won't help you. Zero attack time would still have the swell.

So, you have to move the start of the playback to a point that is a bit into the sample.
I can see how this would help with legato passages.

I have been looking into something like this also.


----------

