Weird behavior with Synth.isLegatoInterval() in noteOff
-
I am trying to use legato to load and play a new loop into my midi player, starting from the existing position; which seems to be accurate in the noteOn event, however I have the following code in my note off, which doesn't seem to be working. So I am holding C and then pressing D, then it loads the new loop, but when I let go of the first note, it is still hitting that Console.print("STOPPING PLAYER IN NOTE OFF"); block, even though D is still being pressed. Any idea what is going on here?
function onNoteOff() { noteNumber = Message.getNoteNumber(); velocity = Message.getVelocity(); if(Globals.play_strategy == 0) { if(!Synth.isLegatoInterval()) { Console.print("STOPPING PLAYER IN NOTE OFF"); Console.print(Synth.isLegatoInterval()); Player.stop(0); } } else { Player.stop(0); } Message.ignoreEvent(true); }
Also, I can't seem to get the player to start the new loop at the players current position, according to the docs it seems like this should be working, but it resets back to the beginning each time, any idea what's happening there also? (the isLegatoInterval works as I expect in the noteOn callback)
if(Synth.isLegatoInterval()) { Console.print("NOTE BEING HELD"); Player.setFile(filePath.toString(0), true, true); Console.print(Message.getTimestamp()); Player.play(Message.getTimestamp()); } else { Player.stop(0); Player.setFile(filePath.toString(0), true, true); Player.play(0); }
-
@thrice801 said in Weird behavior with Synth.isLegatoInterval() in noteOff:
even though D is still being pressed.
1 key down != legato.
-
@d-healey said in Weird behavior with Synth.isLegatoInterval() in noteOff:
@thrice801 said in Weird behavior with Synth.isLegatoInterval() in noteOff:
even though D is still being pressed.
1 key down != legato.
oh damn ya that had my brain all mixed up for some reason.
any idea about the second issue?
-
@thrice801 said in Weird behavior with Synth.isLegatoInterval() in noteOff:
any idea about the second issue?
No sorry, I haven't played with the MIDI player much.
-
np figured out a workaround with setPlaybackPosition instead