How to ignore Modwheel for a sampler
-
I was trying to use Message.Ignore CC1 of some kind but couldn't figure out on my own.
there is some code on the sampler in the onController for custom Sustain Pedal actions so maybe that's why.
Any help would be great! Thanks.
-
In the onController callback you check if the incoming CC is CC1, if it is you ignore it.
if (Message.getControllerNumber() == 1) { Message.ignoreEvent(true); }
-
@d-healey Thank you!
I put the ignore message in the same script processor as the sustain pedal behavior script and indeed the modwheel still triggers note 13....the sample gets triggered at every step of moving the modwheel up.
I tried using a seperate script processer in slot 2 and still the same thing. Any ideas?
Here's the code in a single processor:
function onController()
{
const eventId = Synth.playNote(12, 127)
Synth.noteOffByEventId(eventId);if (!Synth.isSustainPedalDown()) Synth.playNote(13, 127); if (Message.getControllerNumber() == 1) { Message.ignoreEvent(true); }
};
-
@virtuscapeaudio The script is processed in order from top to bottom. Try putting the part that ignores the note above the part that plays the note.
-
@d-healey I tried that and still nothing...the note actually gets triggered on Pitchbend as well...
funnily...I opened the same project one day and it was working and ignoring all controllers except CC64 which is what i want.
Any ideas?
-
@virtuscapeaudio You'll need to put the sustain stuff in the else clause of the mod-wheel section. Or use a return statement.
if (Message.getControllerNumber() == 1) { Message.ignoreEvent(true); } else { if (!Synth.isSustainPedalDown()) Synth.playNote(13, 127); }
-
@d-healey Flawless, David! Thank you.
And if i wanted to ignore ALL CCs except 64?
Would I use the setControllerNumber for an array with all CCs?
I'm slowly wrapping my brain around HISE scripting, ugh ;)
I've plenty of notes for HISE Scripting 101 haha
-
if (Message.getControllerNumber() != 64) { Message.ignoreEvent(true); } else { if (!Synth.isSustainPedalDown()) Synth.playNote(13, 127); }
-
@d-healey oh I see... it's the (!).
Thanks a ton!
-