c++ callback for voice stop?
-
I want to find out when voices have stopped (note off AND release phase has finished) in a c++ synth node.
Is there a way to do that?I'm wanting to save the phase of each voice, at the moment a voice stops playing, which requires detection of voice stop.
I'm guessing noteOff is not a reliable way to detect this, since hise envelopes may keep the voice playing during the release phase.
-
(it's possibly not so important... for my use case I realised if I can keep track of global time, I can calculate the phase by looking at how much time has passed since the Noteoff and other factors)
Still, it would be simpler if I could. -
@griffinboy can you use an envelope inside the network? then you could attach a global_cable to the CV output which will be shut off when the actual release is done.
another option would be to just use the internal voice state of the voice: once it stops rendering it will not be incremented further, so you should be able to pick that up at any time.
-
@Christoph-Hart said in c++ callback for voice stop?:
once it stops rendering it will not be incremented further, so you should be able to pick that up at any time.
Where is this dealt with? Or is the burden on my code?
I don't really understand how voices are dealt with in Hise! I've not managed to locate the scripts that manage voices.
I guess another question I'd like to ask you then is if there is a clock I can tap into? because I don't know if Process() always runs and can be used for a clock. I have the feeling it gets optimized and doesn't always run, from behaviour that I've seen. I might be wrong. But if that's the case, it's probably what's been tripping up my efforts.
-
edit* Rephrased into a more answerable question hopefully!