Function onNote range [Level:Beginner]
-
[Level:Beginner]
Hello!
I'm trying figure out how to make a non-repetitive round robin for each drum. So, I decided just to split drums into separate Sampler modules.Then I made a script in each:
"on init"const var SamplerOpen = Synth.getSampler("SamplerOpen"); SamplerOpen.enableRoundRobin(false); reg counter = 0; reg lastCount = 0;
Next, to separate the round-robin counter for both each drums I though of cutting the note range for "onNote".
So, for one of my drums in the "onNote" section I tried:function onNoteOn(60, 64) { counter = (lastCount - 1 + Math.randInt(2, 5)) % 4; SamplerOpen.setActiveGroup(counter + 1); lastCount = counter; }
and it gave me this error:
"Line 1, column 19: Found Literal when expecting ')'.Does anyone know what's wrong here and what would be a better approach?
-
@Shinami-Sound I think I just replied to you on YouTube, but I'll respond here too.
function onNoteOn(60, 64)
This is not valid. The on note on function definition can't be modified.
You need to either add a separate note filter script before your round robin script or incorporate the filter into your RR script. I suggest using a separate script. If you don't want to write your own you can use this one but I encourage you to try doing it yourself first.