# Looking for a script which alternates samples ...



## Waywyn (Apr 17, 2006)

Hi all,

now we have this section i thought it might be the best place to ask 

i saw a script somewhere but can't remember anymore who did it nor where i saw it. i should have downloaded it back then but i guess i was too lazy.

anyway, this script looked like you could load in all the groups you want, e.g. stacc 1+2 and then it alternates between these two groups automatically.

so i think it would be really cool to create cool runs with having 0.5 and 0.3 samples from the opus stuff, or having different marcato samples for sam etc.

however there was no limit to two groups, it looked like you could load 4 or 6 groups into it and the script would alternate it.

does anyone maybe know what i am talking about?


----------



## kotori (Apr 17, 2006)

Hi Alex,
I don't know exactly what script you're refering to. For short note alternation in Opus there's already a script on the 1+2 instruments that does alternation.

Anyway, here's a simple script that alternates between all groups of an instrument. Everything it does can already be done by using round-robin as group start option, but I thought someone could still be interested for pedagocial purposes. The script can be loaded on any instrument containing multiple groups (any number). As scripts cannot override group start options you'll have to remove any group start options which might interfer with it.


```
on init
  declare $group
end on

on note
  if (num_elements(%GROUPS_AFFECTED) > 0)
    disallow_group($ALL_GROUPS)
    allow_group($group)
    $group := ($group + 1) mod num_elements(%GROUPS_AFFECTED)
  end if
end on
```

Cheers,
Nils


----------



## Waywyn (Apr 17, 2006)

wow, cool. thanks a lot. i definitely try that one as soon as possible!


----------



## TheoKrueger (Apr 17, 2006)

What a coincidence... i think it could be this thread, i was looking at it today:

http://www.northernsounds.com/forum/showthread.php?t=33443 (http://www.northernsounds.com/forum/sho ... hp?t=33443)


----------



## Waywyn (Apr 17, 2006)

yeh this thread is very old ... once upon a time before i was banned 

(sorry, no ranting or bashing shit, it just came to my mind when i saw that old post of mine a little bit more at the top - no bad thoughts though in the back of my head)

but the script i saw a while ago was with a litte edit window similar to the big bobs script


----------



## Thonex (Apr 17, 2006)

Big Bob @ Mon Apr 17 said:


> Hey Nils,
> 
> re:
> 
> ...



It's on page 56 of the Kontakt Script Language Manual .pdf


----------



## Hans Adamson (Apr 17, 2006)

Thonex,

It's not in my manual. Could you send me a copy of your pdf? I kind of had a feeling that my manual wasn't up to date....


----------



## Hans Adamson (Apr 17, 2006)

Thonex sent me his version of the Kontakt Scripting Manual. It is evidently newer than the one I got with my Kontakt2 update, because it includes the entry groups_affected which my manual doesn't. So get the newer version Bob. There may be more useful stuff there.


----------



## Big Bob (Apr 17, 2006)

Yes indeed, I just looked for it again and it's not in my manual. I guess I got K2 too long ago, darn. Hey Andrew, could you possibly email me a copy of your .pdf or is that not a good idea?

Bob


----------



## Thonex (Apr 17, 2006)

Big Bob @ Mon Apr 17 said:


> Yes indeed, I just looked for it again and it's not in my manual. I guess I got K2 too long ago, darn. Hey Andrew, could you possibly email me a copy of your .pdf or is that not a good idea?
> 
> Bob



Done!!


----------



## kotori (Apr 17, 2006)

Hans Adamson @ Tue Apr 18 said:


> Thonex sent me his version of the Kontakt Scripting Manual. It is evidently newer than the one I got with my Kontakt2 update, because it includes the entry groups_affected which my manual doesn't. So get the newer version Bob. There may be more useful stuff there.



Wow, you surprised me here guys - I didn't know there were different versions. :shock: 
Hans, sorry to mislead you on this one when I said I thought the manual covered all things in the updates.
If I get you right you have the latest update of Kontakt but still didn't have the newest PDF, right? :???:

%GROUPS_AFFECTED can be quite useful. By the way it just struck me that maybe it can be used to detect which groups are release groups by correlating its elements to the timing of note presses/releases... I'll have to check that out.


----------



## Thonex (Apr 17, 2006)

kotori @ Mon Apr 17 said:


> By the way it just struck me that maybe it can be used to detect which groups are release groups by correlating its elements to the timing of note presses/releases... I'll have to check that out.



You gotta love this site!!!!!  

I feel good things coming...

T


----------



## kotori (Apr 17, 2006)

kotori @ Tue Apr 18 said:


> It just struck me that maybe %GROUPS_AFFECTED can be used to detect which groups are release groups by correlating its elements to the timing of note presses/releases... I'll have to check that out.


Unfortunately the release trigger groups count as affected groups both on note press and note release so it's not possible to tell them apart after all. It was a thought anyway.


----------



## Hans Adamson (Apr 18, 2006)

kotori @ Mon Apr 17 said:


> Hans Adamson @ Tue Apr 18 said:
> 
> 
> > Thonex sent me his version of the Kontakt Scripting Manual. It is evidently newer than the one I got with my Kontakt2 update, because it includes the entry groups_affected which my manual doesn't. So get the newer version Bob. There may be more useful stuff there.
> ...



Nils,

No problem, I don't think there is much difference except for this omission.


----------

