CC filter
-
@d-healey So, I am trying to get the last piece of the hi-hat puzzle sorted. I want to have a note (that I specify) set the controller value to 0 when played. I thought I had the right code, but I am getting "Ilegal operation in audio thread: String creation" error.
This is the code:
function onNoteOn() { local number = Message.getNoteNumber() + 1; if(number == trigger.getValue() || number == trigger2.getValue()) { setControllerValue(0); } }
setControllerValue(0);
is the line of code causing the error. Am I not using it correctly? Should I use something else or am I missing something?
-
-
@d-healey No. I was looking up Api commands.
-
@d-healey In your script you defined ccValue to be Message.getControllerValue();
Should I be referring to ccValue instead of setControllerValue and if so, how do I force the ccValue to be 0? -
@gorangrooves Ah I see.
When you look up a function in the API browser you will see it listed under the class name. In this case Message or MessageHolder. That means the function can only be used on instances of those classes.
To put it another way, you need to write it like this
Message.setControllerValue(0)
However this won't work in
on note
callback because inon note
Message
refers to a MIDI note message. This function will only work in theon controller
callback.This is why I created a variable
ccvalue
and set its value in theon controller
callback. You should be able to useSynth.sendController()
in theon note
callback, I think. -
how do I force the ccValue to be 0?
ccValue = 0;
The value is only set in
on controller
when CC64 changes, so as long is it hasn't changed you can set it to whatever value you like. -
@d-healey Thank you. I am running in circles here, no closer to solving it :)
How do I get it to set the controller to 0 as soon as a particular note is pressed?
I used
Synth.sendController(64,0);
And it sets the controller to 0, but only after I press a note twice. It doesn't do it right away. What am I missing here?...
-
@gorangrooves I'd need to see the rest of the code. Make a minimal example that demonstrates the issue
-
@d-healey I am trying to do that by opening 2 HISE samplers VST's and copying from to the other, but it is not working. How do you do it?
-
@gorangrooves I always work in the standalone version unless I'm testing something in a DAW.
-
@d-healey Managed to get it copied and simplified. Here is the link to the 13MB project (includes basic samples):
https://drive.google.com/open?id=1j2HXIoMjLVOQ3nOgbS-OnRqVBL0dEdIH
There are only samples on A0, 2 types: tight close and 100% open. Use the CC64 to switch between them. The first one sounds on the bottom 20 cc values and the second one is at the top 27 cc values.
When the cc64 is somewhere between 100-127 and open hat is sounding, it should be able to be muted by pressing either F#1 or G#1. Currently, either needs to be pressed twice for the choke to take effect. We want to achieve that with a single press.
I hope I managed to explain it clearly enough. Thank you so much for taking a look at it!