# Kontakt 3.5 Script stop a Sample with NoteOn and continue with same NoteOn



## richimusic (Nov 5, 2009)

Dear Musicians,

i am a scripting-newbie and i have tried to program it on my own ---- i just can do some music...
Please help me !

I want to do a Live Performance with Kontakt 3.5. 
I need to use one long sample that has to be interruptet by a NoteOn Message: Sample is playing, NoteOn=Stop--with the same NoteOn continue the Position it stopped before. This should be possible again and again.

I don´t know if it is possible to do something like that
Any suggestions--many thanks in advance for any hint

Richi


----------



## tfishbein82 (Nov 5, 2009)

Not sure I get what you're asking? You want a Note On to stop the previous note and sound the next? So essentially mono mode?


----------



## richimusic (Nov 5, 2009)

Thank you very much for your answer. I try to explain it better (sorry for my bad english);
i want to start the Sample with for example C1, than stop the same Sample with the same Notenumber C1 and then i want to continue with the same C1 at the Sampleposition the Sample has been stopped before. And this should be possible as often as i want.

Start/Stop/continue/Start/Stop/Continue....... all with a free definable Notenumber

Best wishes
Richi


----------



## reddognoyz (Nov 5, 2009)

richimusic @ Thu Nov 05 said:


> Thank you very much for your answer. I try to explain it better (sorry for my bad english);
> i want to start the Sample with for example C1, than stop the same Sample with the same Notenumber C1 and then i want to continue with the same C1 at the Sampleposition the Sample has been stopped before. And this should be possible as often as i want.
> 
> Start/Stop/continue/Start/Stop/Continue....... all with a free definable Notenumber
> ...




Dude, get a dat machine.


----------



## polypx (Nov 5, 2009)

I understand what you mean. You need a "latch" behaviour so that the sample starts and stops with the same key.

There's a similar script here that lets you do that to many sample loops together, and keep them all in sync at the same time. It's not so simple, but it might help you out:

http://www.native-instruments.com/forum ... hp?t=81127

cheers
Dan


----------



## richimusic (Nov 6, 2009)

Thank you very much Dan,
i will try it out...
by the way DAT was not so cool..these rotating Heads uhhh.
I need to work with wireless Midisystems on Stage.

Cheers Richi


----------



## richimusic (Nov 6, 2009)

Hi Dan,

with this script the Sample always starts from the beginning.
I need a Note-On-Pause-Function.
Thank you very much.

Richi


----------



## kotori (Nov 6, 2009)

richimusic @ Fri Nov 06 said:


> Hi Dan,
> 
> with this script the Sample always starts from the beginning.
> I need a Note-On-Pause-Function.
> ...



I don't think any pause functionality will be possible unless you use Sampler mode (i.e. if you load all the samples into RAM). Would loading the samples into RAM be an option?


----------



## richimusic (Nov 8, 2009)

yes, the sample can be loaded into ram.
I never thought about the streaming problem in this case.

Best regards
Richi


----------



## MaraschinoMusic (Nov 8, 2009)

I don't know of any sampler that can playback in the mode that you describe. Many offer a playback toggle mode, but the sample will invariably play from the beginning again when retriggered. Perhaps you could cut the sample up into shorter segments and trigger each segment as required.

A better idea is to record the sample(s) onto audio CD, and use a CD player to play back the tracks as required, and use the pause button to achieve the desired effect.


----------



## gregjazz (Nov 8, 2009)

In Kontakt 3+, isn't there a sample start position modulator available for DFD samples? From what I remember though, it's percentage-based, which would just mean that you would need to have the sample lengths built into the script.


----------



## richimusic (Nov 9, 2009)

Thank you all for your help. I never thought it could be this complicate to interrupt a sample.
If anybody knows a CD-Player that can be remoted wireless by Midi or WLan i can try it out.

Thank you all

Richi


----------



## Big Bob (Nov 9, 2009)

Hi Richi,

I think the reason Nils asked you if loading the sample in RAM would be an option (which you seem to indicate in the affirmative) is that you might be able to concoct a script to do what you want. 

At least conceivably the script could keep track of how much of the sample has been played and each time it's retriggered it could be played with a sample start offset equal to the cumulative play time. The play_note parameter for sample start offset only functions in Sampler mode however, thus the need to have the sample in RAM.

God Bless,

Bob


----------



## gregjazz (Nov 9, 2009)

kotori @ Mon Nov 09 said:


> Would you care to elaborate a little on the choice of that constant?
> The Kontakt 2 documentation clearly says that ENGINE_UPTIME is in the unit of milliseconds and that the third argument to the play_note function is in the unit of microseconds. If your conversion ratio is correct then the Kontakt script manual must be wrong.



Sure! I simply found that K2 does not play the sample from the exact starting point specified, but a tiny bit early--and I found that this was by a ratio, not a constant amount. This inconsistency is fixed in K3+.

So in K3+, you multiply the ENGINE_UPTIME units (milliseconds) by 1000, but in K2 you have to multiply it by 1081 to get the same sample start point result.

I'll have to write a blog post about this in the Orange Tree Samples blog, since it's an important consideration when making libraries compatible with both K2 and K3+.


----------



## kotori (Nov 9, 2009)

Thanks for the info Greg. That's odd indeed. So clearly the NI documentation is wrong then. If the offset had been constant that would have been easier to understand.


----------



## polypx (Nov 9, 2009)

> Hi Dan,
> 
> with this script the Sample always starts from the beginning.
> I need a Note-On-Pause-Function.
> Thank you very much.



That script doesn't start from the beginning at all. It starts from wherever in the bar you are at that moment. 

ie. it keeps track of a virtual "sample played" with respect to the bar line /tempo information.


It should be able to be tweaked to do what you need.


----------



## richimusic (Nov 12, 2009)

i have to use Kontakt in Logic while Logic is stopped.
So Kontakt wont get any Sync messages and the Script did not work for me.
Many thanks for trying it out.

I have less time at the moment because my wife has born a beautiful Daughter last sunday....i am such a lucky guy, thanks to god

I will try out the script mentioned before next week.
Thank you all.
Richi


----------



## gregjazz (Nov 12, 2009)

Congratulations, Richi!!


----------



## richimusic (Feb 23, 2010)

Hi kotori,

now i have time to try your nice little script but Kontakt 3.5 will not Apply the script.
Error (line 2): 'end on' expected it says.......
May you please check it out again ?

That would be so great getting this script to work

Many thanks 

Richi


----------



## polypx (Feb 23, 2010)

Richi, you need to get rid of all those question marks.


----------



## richimusic (Feb 23, 2010)

Hi Polypx,

you are right !
No more Question marks and no more problems to Apply the Script.

Thank you very much !!!!

Now i can figure out how it works.
I will post a feedback soon.

Regards Richi


----------

