# Vsl legato script



## kotori (Aug 3, 2006)

Thonex @ Thu Aug 03 said:


> Hi Evan,
> 
> I believe Kotori (Nils) has one here:
> http://nilsliberg.se/ksp/scripts/script ... lternation
> ...



Hi Andrew and Evan,
Actually that script is for progressing through a predefined order of articulations.

Evan, I know there were some attempts to implement a legato script for VSL samples due to the fact that VSL had to delay the release of their script since NI were so slow to implement the password protection they needed. Because of the waiting time and the password protection I think their legato script got kind of hyped. However, it's really easy to implement a script for sampled interval transitions.

Basically the script has to remember the last note and whether it's still pressed. When a new note is played you check whether the last notes is still held. If it is you calculate the interval between the two notes and play the corresponding transition sample, if not (or if the interval is greater than what you have recorded) you just play a normal sustained note. You can decide which group to activate by using disallow_group($ALL_GROUPS) followed by allow_group(<<the_group_to_use>>). 

Then it's possible to extend this with ghost keys and allowing notes not perfectly overlapping to still be played legato. Both the basics and these extensions are pretty simple. I hope this helps. Feel free to ask.

Nils


----------



## Evan Gamble (Aug 5, 2006)

Thanks alot Nils-guess nows the time to learn.


----------



## Evan Gamble (Aug 7, 2006)

Well Im ready youre Script Tutorial Nils. And Learning alot, though I still don't really know where to start to make a script that simply remembers the last note played even other than on init

:shock: 

Can someone point me a little more in the right direction? (sorry for my ignorance) :oops:


----------



## kotori (Aug 7, 2006)

Evan Gamble @ Mon Aug 07 said:


> Well Im ready youre Script Tutorial Nils. And Learning alot, though I still don't really know where to start to make a script that simply remembers the last note played even other than on init
> 
> :shock:
> 
> Can someone point me a little more in the right direction? (sorry for being my ignorance) :oops:



Hi Evan,
Here's a sample script:
````*on init*
``````_{ a record of the previously played note }_
``````*declare* $prev_note
````*end on*
````
````*on note*
``````*if* (%KEY_DOWN[$prev_note] = 1) _{ if previous note is still down }_
````````_{ play legato }_
``````*else*
````````_{ play nonlegato }_
``````*end if*
``````
``````_{ the current note is the next note's previous note }_
``````$prev_note := $EVENT_NOTE
````*end on*


(If you want to copy this and experiment with it, please paste it into my editor (which will remove special characters needed to make scripts look good in forum posts), and then copy that and paste it into Kontakt)

Feel free to ask if you have any questions.

Cheers,
Nils


----------



## Evan Gamble (Aug 9, 2006)

Thanks so much Nils! (goes back to studying) :razz:


----------



## JacquesMathias (Aug 9, 2006)

Evan, i will sample my bass to use in my rock/pop productions and compositions. If you get it to work, let me know, i could share a "legato" bass with people here, if someone get interested. 

Cheers.


----------

