NoteOffByEventID always firing....
-
I always reset my ids to
-1
because I think0
could be a valid event ID (I could be wrong though). I also always put a check before turning off notes.if (id != -1) Synth.noteOffByEventId(id);
Edit: I just looked at your snippet and saw that you do have a safe check. hmm... I will do further tests.
-
With that snippet I get a different error to you.
onNoteOn() - Line 15, column 39: Hell breaks loose if you kill real events artificially!
And it works fine if I run the drone once to populate the droneID.
-
@d-healey actually its getting worse, if you turn OFF MIDI Input and toggle the Run button it will start to play a note, whihc is correct, you can play any other note and its fine - but play the SAME note (which should have a completely different ID) and it turns off the drone note...
I cant seem to get my head around this MIDI model...
-
Hehe I see the problem. I've made this mistake before too. You have a semicolon at the end of your
if ()
-
@d-healey oh yeah....thanks... lets see if that fixes problem I started with... thanks mate..
-
@Lindon yep that fixes that problem - now how to fix this turning off my drone note when I dont want it off...
-
@Lindon I shall investigate
-
The only time drone ID is set is when you start the drone. You need to update it in on note.
Actually ignore that.... more investigating
-
@d-healey
ok so adding this:function onNoteOff() { Console.print("an OFF event"); Console.print("droneID is:" + droneID); Console.print("this event ID is:" + Message.getEventId()); };
tells me the droneID and the eventID turning it off are different:
Script Processor1: droneID is:139 Script Processor1: this event ID is:151
-
I think I've figured it out.
If you turn off the run button and replace everything in your on note callback with
Message.setNoteNumber(60);
Then play a note, and then hold down a second note. When you release the second note the first note is cut-off too. This implies that there is some internal thingy that says you may only have one voice per note with the sine wave generator.You'd need your script to retrigger your drone in note off if the user presses/releases the drone key.
-
@d-healey riiiiight.... wow thats very bad I think from a scripting notes basis..... Its not just the sine wave generator - I just replaced my sampler with the SWG so I could post the snippet....
-
With a sampler you should be able to choose what happens with the retrigger settings.
I just tested it with a sampler and it worked as expected. The voice count went up to 5 which is how many keys I was holding down and they were all triggering note 60.
-
@d-healey ahhh! OK I'll give it a try...
-
@Lindon OK well that sorta fixed it I think. Which is a bit of a relief as a whole truck load of CR and AudioReward instruments use "granular like" multiples-of-the-same-note-playing techniques...