How can I achieve Multiple Round Robins, velocities and Mics rooted to a single key

caevizcarra
caevizcarra Member Posts: 5 Newcomer
edited October 2024 in Scripting Workshop

A big noob here. Can anybody help me with a script or steps to accomplish this?

I have a snare sampled with 3 mics, each mic have 5 round robins with 8 velocities per RR (40 zones each mic/group as you can see in the picture) So that I have made 3 groups for the mics (Snare-top, snare-bottom and snare-room)... my question is how can I play/root all this 3 groups in a single key (i.e C1) and cycle the RR aswell. Thanks in advance :)

This picture is for the snare-top group/mic, the other 2 groups are exactly the same.

Comments

  • caevizcarra
    caevizcarra Member Posts: 5 Newcomer

    I meant  *each mic have 9 round robins with 8 velocities per RR (72 zones each mic/group as you can see in the picture)

  • medusa
    medusa Member Posts: 98 Helper
    on init
        declare $Snare_Key := 38  { D1 }
        declare $Snare_Robin     { a robin counter for Snare }
        declare %Snare_Groups[3] := (0, 1, 2)  { an array with all snare groups }
        declare $counter {a general counter }
    end on
    
    on note
        ignore_event($EVENT_ID)
        disallow_group($ALL_GROUPS)
    
        if($EVENT_NOTE = $Snare_Key)  { if we play a Snare note }
            for $counter := 0 to num_elements(%Snare_Groups)-1   { allow the groups you need for snare}
                allow_group(%Snare_Groups[$counter])
            end for
    
            play_note($Snare_Robin, $EVENT_VELOCITY, 0, -1) { play the note of the robin you're on }
    
            inc($Snare_Robin)   {  increment the robin, you could also do a random or other scheme}
            if($Snare_Robin > 8)
                $Snare_Robin := 0
            end if
        end if
    end on
    
  • caevizcarra
    caevizcarra Member Posts: 5 Newcomer

    Thank you so much medusa! Will give it a try, and let you know :)

  • caevizcarra
    caevizcarra Member Posts: 5 Newcomer

    Hi Medusa, I can't make it work. :( Maybe I don't understand the script correctly.

    declare %Snare_Groups[3] := (0, 1, 2)
    

    How does the array should be written? This are my groups: Snare-top, snare-bottom and snare-room

    for $counter := 0 to num_elements(%Snare_Groups)-1 
    

    Im getting an if/else error here.


    I guess I'm too noob lol, thanks

  • medusa
    medusa Member Posts: 98 Helper

    Ah, the 'for loop' assumes you're using Sublime KSP. If not, you can remove:

            for $counter := 0 to num_elements(%Snare_Groups)-1   { allow the groups you need for snare}
                allow_group(%Snare_Groups[$counter])
            end for
    

    and instead put

            $counter := 0
            while < num_elements(%Snare_Groups)   { allow the groups you need for snare}
                allow_group(%Snare_Groups[$counter])
                inc($counter)
            end for
    


    The %Snare_Groups array needs to be initialised with the three groups you're using. Numbers 0, 1, 2 are the first three groups (start from 0), but your Snare groups may be different numbers.

  • caevizcarra
    caevizcarra Member Posts: 5 Newcomer

    Hi, thank you for the response, I accomplish 0 errors now, but got no sound, and D1 not playing any aswell. :(

This discussion has been closed.
Back To Top