How to play a specified RR group based on the distance between two notes?
-
@Christoph-Hart said in How to play a specified RR group based on the distance between two notes?:
ah so just use setVelocity(targetNoteNumber)
This affects all velocity modulators further down the line - unless you use a global velocity modulator.
-
@d-healey If you put the script in the sampler it shouldn't affect its sibling samplers. If it's a global script, then sure.
-
@Christoph-Hart
When I press the key I get an error like this, what should I do?
-
@CatABC you haven't declared activeGroup.
Unlike the interface script where you can basically declare variables and constants wherever, with realtime, you should declare them in the on init part so that the note on function just needs to read them (as they would get destroyed after the function execution).
declare activeGroup in the on init part of your realtime script. Use reg, as it's faster than var.
reg activeGroup = -1;
-
@aaronventure Thank you very much, I solved this problem, but I have a new problem, how to play the correct RR group according to the interval?
-
@Christoph-Hart
Hi,Christoph, Thank you for providing me with the method,I tried using the script, but it seems like there is no way to change the group I want to play based on the interval? For example, I press C2-D2 and it plays RR48, I press C-D#2 and it still plays RR48,How can I improve this?And when my melody goes down, the descending legato should be played, which will overlap with the ascending legato RR group. This is a headache for me. Please help me. -
@CatABC
I think I found the answer, thanks a lot to everyone who helped me,I love you all -
@CatABC you know the rules, you gotta post the solution or the forum police comes knocking on your door.
-
@aaronventure Hahaha, thank you for your reminder. but I am still confirming whether it has achieved my expected purpose.
-
@CatABC I think I have confirmed that I can use fewer RR groups to achieve my purpose. I set up variables to store the key I pressed first, then calculated the interval, and set the group I wanted to play based on the interval. This should be simple for everyone. As a beginner in HISE, it took me a lot of effort. Anyway, thank you for your help! Following is my test code
local a = Message.getNoteNumber(); if(Synth.isLegatoInterval()) { leginterval = a - lastNote; Message.setNoteNumber(lastNote); if (leginterval == 2) { Sampler.setActiveGroup(2); } } else { Sampler.setActiveGroup(-1); } lastNote = a;