# Custom legato interval samples like in LASS



## Galfaroth (Jun 12, 2010)

Dear community,
I would wish to sample my own ethnical instrument and make it playable in Kontakt.
I have sustain notes samples and different intervals, how can I make it play alltogether?

Does anybody know how is it done in LASS? It works there great. I know they've interval samples because everytime you play legato, the correct interval name is shown and because of that they should be having the legato intervals samples.
When you hit one note, one note sample is played. If you hit another note while the last one is still pressed, the interval sample is played and after that, the new sustain note sample.
Is it done by fastly switching the groups from sustain -> legato interval -> sustain?
Are they using any crossfades to do that? Similar things was done in Garritan's Stradivari I think.

How easily can I do that in KSL? Using fade_in and fade_out? Or there is an easier way to do that maybe even without KSL?


----------



## MacQ (Jun 12, 2010)

Good question. I'd like to know this as well, for my own sampling tests. I think now that the technology is there and many developers are using it, users expect to see it.

But I don't know if there's a "standard" approach or if each developer is using their own tricks for achieving this. I'm of the personal opinion that scripts that can do this should be available in a sort of open-source with tutorials, as it only benefits our community at large to have these features included in every new library.

Hopefully someone can offer some advice.

~Stu


----------



## EvilDragon (Jun 12, 2010)

You should take a look at SIPS script to get an idea of how it could be done. It's not easy at all, I can't figure it out still, although I do know the principle behind.

You have two sustained notes played in succesion. Before the second note is actually reached, you need to fade in the legato interval sample (by using equal-power fade in and fade out, and this is done by using Big Bob's math library), then fade out the legato interval and fade in the second note.


----------



## Thonex (Jun 12, 2010)

Hi Galfaroth,

Thanks for the kind words regarding LASS.

There are a lot of things I did with LASS that I would consider trade secrets. From the charts to the approach of the sessions to the actual editing and programming of the patches.

But I will say one thing regarding Legato sampling:* There are no shortcuts*.

I wrote a complex custom script, and perhaps more importantly, spent months finessing the legato patches one sample at a time. It really is a mind-numbing experience... but... the results can be compelling.

So.. my advice... take your time... you'll "know" when it sounds right... and keep A/Bing with the "real thing".

I hope this helps.

Cheers,

Andrew K


----------



## Tod (Jun 12, 2010)

I don't have a clue about LASS or how Andrew did it but I did this back 2-1/2 to 3 years ago and it's not a simple matter. I suppose you might be able to do something with the envelopes but I doubt the results would be very satisfactory.

My objective was to use only two sustain groups rather then spliceing all the intervals to the sustains makeing a huge patch.

What I did was use volume envelopes in my DAW to match each destination sustain with all the all the intervals going to it in both directions up/down. I don't remember offhand how many octaves of intervals I had but it was quite a few.

Doing it this way only two groups of sustains were needed, one for the intervals and one for the regular attacks.

At the time there was a script floating around for dealing with this but I ended up totally modifying it to end up with my own. With this old brain of mine I don't remember what all I did with the script. I sort of remember the script floating around used 2 octaves of keyswitches and mine only needed one octave. I also added some things to deal with the envelopes at different BPMs because all the intervals were recorded at one BPM, although I couldn't deviate to far from the original BPM without being noticable.

It worked good but I never did quite finish it because of the BPM thing. Also Big Bob came out with SIPS about that time. o/~ 

Tod


----------



## Galfaroth (Jun 13, 2010)

Okay I started to make the script. What it does is playing first sample, then legato one and then a new note.
1. How to make everything be quiet once all keys are released? Because 2nd note is still being played even if I release the first key. This is of course for testing purposes. Tried many times in many ways.

Here is what I have:

```
on init
    declare $startid
    declare $secondnote
    declare $state
end on

on note
    inc($state)
    message($state)
    if $state = 1
        $startid := $EVENT_ID
        {message($EVENT_NOTE)}
        wait(600000)
        {note_off($startid)}
        play_note(73,100,0,200000)
        wait(200000)
        $secondnote := play_note(67,100,0,0)
        wait(100000)
        {fade_out($secondnote,100000,0)}
    end if
end on

on release
    {message($state+1000)}
    {message($EVENT_NOTE)}
end on
```


----------



## Galfaroth (Jun 14, 2010)

MozillaUser, thank you so much for such a long and informative post. You showed some legato standard and the one from Vsl is simple the one I wish to sample and program. I'm not going to use the one with granular or non gliss/port simply because they will never sound as natural as the real sampled legato. Once I arrive at home I will give a try your script method and post there the results and probably some questions.


----------



## MozillaUser (Jun 16, 2010)

First, a short message to Thonex ('coz I'm sure he reads this topic and he laughs his a-- off about my assertions regarding his script 
Well, Thonex, I stand corrected: I expressed the supposition you use a "non-granular" glissando in your script. Now I had a real careful listening to the demos, and I admit I was wrong: it's granular (that is, on the successive half-tone thing, roughly said....and when I say "roughly said" you know what I mean, of course) , and it's endless customized  There is a possibility that not only in layerings, but even for a single section - for instance, violin A or B or C - you use simultaneously 2 or 3 different timings and ways of customize them. Anyway: your legato, glissando and portamento sound better than every other script I heard, including my own, and I hate you endlessly for that  That was a joke, of course. And you were right in one thing: I bet you have spent months to customize each detail of the legato script.
I take off my hat. Your script is more than intelligent, more than shrewd, it's wise. Congrats!
....föck...now I must start working again on mine... I hoped I was through with the legato... :-(

---------

Now to Galfaroth:
Friend: instead of blindly trying to re-invent the wheel, why don't you do what all of us mortals do? You said you want to implement a VSL-type legato. Why don't you make a search in this forum for "VSL legato" or for "Guga Bernardo", have a long look to the thing and learn as much as you can from Guga's script? I could have posted here my own version, but mine is so crowded with additional things, even I have to scratch my head one hour before I start to understand in detail what I was doing.


----------



## Galfaroth (Jun 16, 2010)

Dear MozillaUser. Thank you very much for your answer. Why I didn't simply look for the script is I didn't know it was written for Kontakt . I thought you're talking about the real Giga VSL Library's script.

Anyway here is the script:
http://www.northernsounds.com/forum/showthread.php?t=49951 (http://www.northernsounds.com/forum/sho ... hp?t=49951)

It's not totally working as I expect but I think I will be able to maintain some of it's solutions. I will be writing the script in a few days and post there the progress.


@Your code MozillaUser . You better comment it better :D.


----------



## MozillaUser (Jun 16, 2010)

Galfaroth @ Wed Jun 16 said:


> It's not totally working as I expect but I think I will be able to maintain some of it's solutions. I will be writing the script in a few days and post there the progress.



Good luck 

[quote="Galfaroth]
@Your code MozillaUser . You better comment it better :D.[/quote]
Hehe  it's commented very extensively, but there are so many functions ... Guga's code for "on note" has - how many? - 200 lines of code, maybe 300? well, mine has several thousands lines. The ".txt" file is 93 kb long, so you can imagine  No, stick to Guga's, it's kinda basical and I remember it does the job pretty well.
Good luck again!


----------



## MozillaUser (Jun 16, 2010)

Oh, I forgot something important regarding Guga's script: it mimmics the behaviour of the original VSL Giga script (it expects the "legato folders" to be mapped 4 octaves higher ) so you either map your samples the VSL way, or you have to modify those "$EVENT_NOTE + 48"
good luck again
Mozil


----------

