Events and sustained envelopes

Just sanity checking on correct form for sustained envelopes with events. Note event assumes a dur of 1, so you need to do this?

a = (note: 1, dur: inf).play

a.release

And since events seem to be the way to add a synth as an NodeProxy source, so…

Ndef(\voicer).play
Ndef(\voicer)[1] = (note: 1, dur: inf)

Ndef(\voicer)[1].release

This seems to work but just want to check I haven’t missed something! :slight_smile:

The other way is to use (type: \on, note: 1) to skip the release.

Which one is better? \on doesn’t process any release at all, where sustain: inf (it’s actually the sustain property that controls the release time) does process the release, and relies on the scheduler to ignore an infinite scheduling time. The latter seems like a long way around, so on that basis \on would be preferable – but I have code in my live coding system that takes the infinite-sustain approach, so, clearly I’m not dogmatic about it :wink:

hjh

Thanks James!

Yeah I think \on makes more sense. It’s a bit of a funny use case as I’m trying to operate in NodeProxy land for various convenience reasons, but using quite complicated UGen functions so a precompiled SynthDef is the way to go to avoid lateness. An Event source seems to be the optimal source type for that since you can’t use a Synth…