# Script help



## andreasrusso (Jun 7, 2007)

Hello,
i found a script that would allow me to do what I actually want to do a while ago on this forum, but I'm not able to find it back.
What I would like to do is to press a key and let a certain instrument play, then pressing the key a second time and making that instrument play with a new one, and then, each time I press the key again, there's alway just the firs instrument.

In a few words: I'd like an instrument to play ONLY the second time I hit a key, not the first, nor the third, nor the fourth...

Is it possible?


----------



## kotori (Jun 7, 2007)

Hi Ice-Man,
I'm not completely sure what you mean when you say "new one". New what? Sample?
Do you mean Big Bob's UltraTKT script which alternates between samples by transposing and pitch-shifting back?


----------



## andreasrusso (Jun 7, 2007)

sorry, I explained like a dog.
I edited the post: I'd like an instrument to play ONLY the second time I hit a key, not the first, nor the third, nor the fourth.


----------



## tfishbein82 (Jun 7, 2007)

So you want it to play like this:

A) 1 2 3 4 1 2 3 4 1 2 3 4 ...
.......X..........X..........X

or

B) 1 2 3 4 5 6 7 8 9 10 11 12 ...
.......X

??


----------



## andreasrusso (Jun 7, 2007)

```
123456789
-x-------
```


----------



## kotori (Jun 7, 2007)

I'm still not sure I understand why one would like to do that. Do you mean that you want it to be impossible to trigger the sample ever again after you have played the key twice?


----------



## andreasrusso (Jun 7, 2007)

i would like the sample to be played only the second time the key is hit.

it should be:

firs hit: mute
second: play
third: mute
fourth: mute
fifth: mute
ecc...

it's because I play a bass guitar with my hands, while I play a Roland PK-5 with my feet... so I need some particular conditions...


----------



## tfishbein82 (Jun 7, 2007)

Here you go. Didn't test this, cause I don't have access to my DAW at the moment, but it should work.

Drop the .zip extension, then compile with Nils' KScript Editor.

Set the number to the hit you want. Hit reset to start over.


----------



## andreasrusso (Jun 7, 2007)

Thanks for the script, but unfortunately I'm not able to unzip the archive... is it because I'm on a Mac?


----------



## tfishbein82 (Jun 7, 2007)

You don't need to unzip. You need to change the file extension. I'm note sure how this works on mac, but on Windows you just rename as .txt instead of .txt.zip


----------



## andreasrusso (Jun 7, 2007)

pardon me... I'm a noob... it does work now...
but could you tell me which parameter to modify?

one more thing: kontakt is telling me that there's an error in the second line

(declare ui_value_edit ve_play(0,1000,1)


----------



## tfishbein82 (Jun 7, 2007)

Right now, it doesn't do much.

If you set "Play On Hit" to 2. It will play the note the second time you strike it. If you hit "Reset", it will start over so that the 2nd time you hit it again, the note will be sounded.

When I'm in front of my DAW later, I'll give you something that works a little smoother than this.


----------



## andreasrusso (Jun 7, 2007)

"play on hit"... which line is it?
btw, thank you so much for your interest...


----------



## tfishbein82 (Jun 7, 2007)

Try to re-download.


----------



## tfishbein82 (Jun 7, 2007)

Are you having success yet? Here's the steps you need to do:

-Download
-Change extension to just .txt
-Open or paste in Nils' KScript Editor
-Compile (Script -- Compile)
-Paste into a Kontakt Script slot
-Click Apply
-In GUI, set "Play On Hit" parameter to 2


----------



## andreasrusso (Jun 7, 2007)

I apologize to you...
I missed some steps because I am a NOOB.
Now it seems very simple to be used.
What do the parameters RESET CC and WHEN do?


----------



## tfishbein82 (Jun 7, 2007)

Ice-Man @ Thu Jun 07 said:


> I apologize to you...
> I missed some steps because I am a NOOB.
> Now it seems very simple to be used.
> What do the parameters RESET CC and WHEN do?


They're for setting a continuous controller to do the same function as the reset button.

You pick the CC# and the value it needs to hit to Reset. For example if you set RESET CC to 1 and WHEN to 127, then every time you rolled your mod wheel to the top it would reset the sequence.

Does this make sense?


----------



## andreasrusso (Jun 7, 2007)

It is ok for me as it is now, cause I only need to trigger the note ONCE in the whole song, BUT, just to understand, what is a CC#?
I'm not able to sequence the reset...

and THANK YOU VERY MUCH, once again.


----------



## tfishbein82 (Jun 7, 2007)

Continuous Controllers trigger midi events that can be used to manipulate the sound. To get a basic idea of midi and CC's, you can read on the subject here or here and then http://improv.sapp.org/doc/class/MidiOutput/controllers/controllers.html (here).


----------



## andreasrusso (Jun 7, 2007)

wow... it requires a certain concentration...
maybe I'm gonna get on this sooner or later...
but I think I understood quite a bit...
one last thing: isn't there a way to automatize the resetting?
like, say, each 6 hits...


----------



## tfishbein82 (Jun 7, 2007)

Re-download and follow all steps again.

Then set 'Auto Reset' value to whatever you'd like. If set to 6, it will reset after the 6th hit, so you'd get the following sequence:

1 2 3 4 5 6 1 2 3 4 5 6 ...
...X................X

If set to 0, it will not auto-reset.


----------



## andreasrusso (Jun 7, 2007)

there was a little error on line 5:

declare ui_value_edit ve_controller(1,127,1) := 16

I simply erased the " := 16" part, and it works perfect now.
THANK YOU THOUSEND!


----------

