A couple more notes here:
-
If using an audio bus for the amplitude (no zipper noise), you can leave out the
HPZ1-ifpart because audio busses (unlike control busses) auto-reset to 0 between cycles. Other effects are possible, e.g. “notches” in amplitude for “sidechain compression”, with an appropriate variation onmenv(e.g. not taking the max but e.g. the min). -
This idea can be encapsulated in a Pproto fairly easily, so a longer sequence of envelopes builds and tears down the main signal synth. When doing that, one needs to be a bit careful with the last envelope event so it has a enough
dur, i.e.>= sustain + rlsso that the Pproto cleanups don’t stop the synths prematurely.