Receiving a message when envelope is finished

Hi everyone,
I need to know when an envelope is finished, or when the voice of the synth is free.
Ideally I would love to receive a massage from the server or from the synthdef.
I need it to update a light in a midi controller.

If anyone knows a way, it could be really helpful!

Thanks!

You can use Done to create a trigger for SendReply.

Not tested as on mobile.

1 Like

You can do it like this provided your code allows you to free the synth when the envelope is done.

SynthDef(\test, { Env.perc(0.5, 0.5).kr(2) }).add
x = Synth(\test).onFree{ \envDone.postln }
1 Like

onFree is basically a shortcut to handle n_end notifications automatically.

n_end is documented here: Server Command Reference | SuperCollider 3.12.2 Help

hjh

1 Like