Hell breaks loose if you kill real events artificially issue
-
I have this simple little script. If I play the same note twice in a row I get the "all hell breaks loose" message on line 9 where I'm calling
Synth.noteOffByEventId(eventIds.getValue(n));
. Even though I'm checking beforehand that the artificial event is active. It's like that check is failing completely.function onNoteOn() { local n = Message.getNoteNumber(); local v = Message.getVelocity(); Message.ignoreEvent(true); if (Synth.isArtificialEventActive(eventIds.getValue(n))) Synth.noteOffByEventId(eventIds.getValue(n)); eventIds.setValue(n, Synth.playNote(n, v)); Synth.noteOffDelayedByEventId(eventIds.getValue(n), 1000); }
eventIds
is a midi list declared inon init
HiseSnippet 1326.3oc6Xs0aaTDEd1XOkZ2VDszG3EP6C7fCJJxqiyEDBgyEm1HhSshCQ7V0zYGaOpqmY0LyZvTw+I9IzeR7O.Nytqsm0woj5jBHD9AKetsmu4blyk0cURJSqkJjW0KlDyPdOD2ahvL7vgDt.cxQHumhUrHFQyLJ9fALkgoMnClDSzZVHxyqzyrZ5UoLJ8yu+cGPhHBJaNKD5RImxNkOhalysaqumGEcLIjcAeji1MacBUJNTFIS.TUBWGESnulLfcFwp1ZXzyI5gHuuBGFzLn+dTxN6EzrAk1Xuca706RYj98Y6Dr8tM2qey9DZ8FHu60NjajpdFBfdjW4CjgS5MT9ShLGbIWyeUDyRDf5AdNi8wxnP6QzxEc3PdTX2ogKMB4g6NO3UJK38TbGdHeF+4AwOIUf+bKbCfdqUDdkJ.u.W3U2AdKARdNPpbFjdLtGUwiMykXwyCvmHLLEDdXEfRltHu2hOTBJHLaNh7Z1wJfXlA01od8M7guV+a5mHnFtT3KEmIMrWHpsd02TsR0esp+hh52eoxrtQIihXpkJ1d0P8tLrlHYzqXpM7GShRXyTDN9Eio3qOl5lxoYmZGEkhSDbyKhYhq6h.JOTA+5GN4HhgXSD47.8hgRFtEBdGwFCkAYokJ3iX5WajwPgvUxYvsEYXRDwT7JjsPKW.DCJj2rIGglal3VHdmcu5lBwGi6xMzgKGiqsDLBQpODXLuZ7Q31Pq.pYN.KiO9G+vT5459OOy8OA2ynXjQbwfdjQwvU7TLTEmSEbWzEM9F2EsKzFWRB6w+EG0daqCRfXjpH2eqUpq1ejLQTvW4H+bVLiXfzriM2u04m+LkLIdQq9xVoWJtPAcwgPg6Y7EBFDqMtmwCURstObbReVZWQcSTCrwp4bNmMlozE4cVxHHeKDrHaUuWIaUolYyubZGBLC6mc0N0K0ufjligQKozAKP2XA5sVft4Bzau.8NKPu6b5r.ZGRr8lwWfGRFA86XgGkDQsc9NUJFbd1zW8UZo8Q2rVZvCuKABGNZd.evLGmwwcT2rTPJLcFStjAN26C0Lvx2rC2bbe6lG9o4bmitFKat3Zn0vPYk13C27fQhgZ+u0usX.Wv1jB05Fl8HdJWapcsCGijTRju.LrC3HXulMGvLVENKcRFX3TcFWTmKg5WJz9zpQ0JSEvGHjJVaKbpYTvHPv7pU388qktG2lb89v7m9bJmDkp09.nFypM8.j9jsyNqIVe80qVoRlYhrY1GLocldKWevWfylIROSzF9YOl3HxD6YyxY75YXqfCNhAZvBe29YC+f510M9+EK9O1hEEJPqLEi831dSsEigK7.GKFeBbp5SRhLS4Vb3YGoPFOTJ3zhiGxekEWruzCz9FCLcZNmm1Juq6LV9uo0oPUNQUbp26UrH38d48klu9LbFb8s2g8uM4sx2r71698ftSVNrzMZ4v6b7t5KJ92Zn6iyWYzG7tx7u777CwoK43a2I8eJndtLw.6ZNceuGAiV6AKBSYtqFdOaG1L55VZKf5wDgoD+A7IWXfk1KWXvBBa3ZYiEDtkqkasfvltV1bAga6Z41SEhnSgObxy+c5bAuRLgcYsz2yJBFgF4VFogU7sggx3PNB89a2CvZXk9vmKg7vJX9CwZCrTqrKgqtRpAuzTyZ2pTCZDgpjujlMH2FrteJG.uhz+CoJ3NVZ+.T5vcWPOB1e6kTZwG0ULrwpZ3VqpgMWUC2dUMbmU0vcWUC26u1P6506mXjixlffPc51N6pnW6YWEKg9S.9VrqE
-
@d-healey Yeah, that's a whole weird world with artificial notes.
-
@d-healey I think it's because your ignoreEvent call prevents it from going further down the tree (like into the queue), and noteOff wants to kill it, even though it
- isn't there
- is a real event
Could be the combination of the two?
-
@aaronventure ignore event just disregards the real event but it doesn't prevent the code progressing. If you remove the note off with delay call then the problem goes away.
-
@d-healey it doesn't prevent the code progressing, but it prevents the event front being added to the queue or for it to be propagated to child processors.
And your noteOff method will only be executed in the child processors (I. E. The note off function would only fire in the child processors, not the processor you're calling it from) and once it gets past all of them, it will attempt to remove the event (by id) from the queue, but your event never ever made it to the queue.
-
@aaronventure Not sure what you mean exactly. In this case there is no child processor beyond this script. I'm only working with artificial notes, so ignoring the message shouldn't make a difference - in fact if you remove the ignoreEvent line the issue still occurs.
The line that checks if the event ID is artificial (which is must be because it is only ever populated from a call to Synth.playNote) seems to be returning the wrong response.
-
@d-healey ah sorry, brain fart, I thought you were offing the real event.
-
@d-healey yeah I've found these checks to be really unreliable....