How to know if a Note ID is still valid


Is there a way to know if a given NoteID is still valid or if the voice has stopped playing completely (after the envelope release phase)? Thanks.

Probably not, at least not directly.

There are functions like waitForRelease and isNoteHeld which can help you find out if note has received a note off message. But if the envelope is set to oneshot mode then it’s possible the voice will be released (stop playing) even if the note is still held. There are couple of functions that deal with used voices. So you could keep track of the number of used voices and update the value with each new note on and note off. You could also read the values of amp envelope and work out the total time you need to wait since note on and then check for used voices. However this can get complicated if you use quick controls to offset envelope times.

Thank you for the reply. Yeah I thought about checking the amp envelope values, but I can’t find anything that I could use to check if the envelope has finished. It’s a pity that Halion doesn’t provide a function to query any kind of information about a given Note ID.