Round Robin Release triggers

Kelson
Kelson Member Posts: 3 Newcomer

Hello, I'm currently developing my first library, I scripted all of the round robin groups and key switches, however I found that i could add groups for release triggers without scripting therefore i did so. set up 10 groups, toggled on release trigger button, and group start random from every group. to my surprise it worked like a charm, however I now want to add a switch to turn these release triggers off, so I suppose I have to script the release triggers. I'm maybe 40% there, i have the release triggers scripted but all the groups are playing at once. How can I script these groups to randomly round robin?

Comments

  • stephen24
    stephen24 Member Posts: 252 Advisor

    Maybe you don't need to script them at all.

    Why not try with your original Group Start Options and add another condition using and, e.g. an unused cc to turn them on and off.

  • noY_T
    noY_T Member Posts: 37 Member
    edited August 2023

    It is certainly possible.

    This example works for an instrument with 10 groups that are all adjacent to another in terms of group number.

    on init
     // This could be a menu of course
     declare $selectedGroup := 0
    
     declare $startGroup := 0
     declare $lastGroup := 10
     declare ui_button $allowRR
     declare $rrID
    end on
    
    on note
     ignore_event($EVENT_ID)
     $rrID := play_note($EVENT_NOTE,$EVENT_VELOCITY,0,0)
     // Disallowing playback of this event for all groups
     set_event_par_arr($rrID,$EVENT_PAR_ALLOW_GROUP,0,$ALL_GROUPS)
     // Allowing it for either a selected one or a random one
     if ($allowRR=0)
       set_event_par_arr($rrID,$EVENT_PAR_ALLOW_GROUP,1,$selectedGroup)
     else
       set_event_par_arr($rrID,$EVENT_PAR_ALLOW_GROUP,1,random($startGroup,$lastGroup))
     end if
    end on
    
Back To Top