# Round Robin, 2 groups at a time.



## djdarko (Oct 5, 2010)

Hey everyone,

I need to do a round robin script where 2 groups are played on each note, for example

1 and 7 (first)
2 and 8 (second)
3 and 9 (third)
4 and 10 ..
5 and 11 ..
6 and 12 ..

OR

1 and 2
3 and 4
5 and 6

etc.

Thanks in advance.


----------



## polypx (Oct 5, 2010)

second option, in pairs, something like this?

disallow_groups ($ALL_GROUPS)
allow_group ($x)
allow_group ($x+1)
$x := ($x +2) mod $NUM_GROUPS


----------



## EvilDragon (Oct 5, 2010)

Oh, foolish me! I was too tired to actually see your issue. Sorry.

Remember the script I sent you? For this example, let's say you have 16 groups, and first 8 groups are for modwheel down, last 8 groups are for modwheel up. Try changing the "on note" callback with this:


```
on note
    $sweep := $First
    while ($sweep - 1 < $Last)
        if ($sweep = $count)
            allow_group($sweep - 1)
            allow_group($sweep - 1 + ($NUM_GROUPS / 2))
        else
            disallow_group($sweep - 1)
            disallow_group($sweep - 1 + ($NUM_GROUPS / 2))
        end if
        inc($sweep)
    end while

    if ($count >= $Last)
        $count := $First
    else
        inc($count)
    end if
end on
```

*** NOTE: in this case, to get 8 effective round robins, NEVER set First or Last knobs above 8!!! ***

Also, this will ONLY work if you have groups set up EXACTLY as in your first example, an even number of groups:

n groups (even number: 2, 4, 6, 8, 10...)
first n/2 groups are modwheel down
last n/2 groups are modwheel down


Works for you?


----------



## djdarko (Oct 5, 2010)

Thanks guys, I'll try this out and get back to you to see if it works.


----------



## mbietenholz (Nov 7, 2010)

If I'm understanding it correctly, you don't even need a script. Just set up the round robin groups, pick "position 1 in round robin chain" for both groups 1 and 2, pick "position 2" for groups 3 and 4 etc. You can assign as many groups as you like to any particular position in the round robin chain, and when it gets to that position in the chain, all the groups assinged to it will play. In this case, first played note will play groups 1 *and* 2, second note will play groups 3 and 4 etc.


----------



## Moonchilde (Nov 7, 2010)

mbietenholz @ November 7th 2010 said:


> If I'm understanding it correctly, you don't even need a script. Just set up the round robin groups, pick "position 1 in round robin chain" for both groups 1 and 2, pick "position 2" for groups 3 and 4 etc. You can assign as many groups as you like to any particular position in the round robin chain, and when it gets to that position in the chain, all the groups assinged to it will play. In this case, first played note will play groups 1 *and* 2, second note will play groups 3 and 4 etc.



This. You don't need scripting AT ALL for it. However, you may want to run a forum search and look for Thonex's Intelligent Round Robin script, as it helps with Up/Down bow RR patches and similar styled instruments.

I swear, and I mean this as light hearted as possible, but since so much of the population in the Kontakt forum are scripters, it seems you guys gotta make simple things so darn complicated when Kontakt has a ton of flexibility alreadybuilt in, lol! Save those script slots and do as much manually as possible, then you can jazz your instruments up with stuff Kontakt can't do natively using those precious slots.


----------



## kotori (Nov 8, 2010)

blakerobinson @ Mon Nov 08 said:


> Basically a Kontakt script allows:
> - Per note RR. This allows chords and arps (...)


Yes, and even per note and velocity layer.


----------

