MiniPEG-style envelope in Gen~ not returning to 0 in one-shot mode (issue with go.uni.gauss?)

Macs 7appa's icon

I tried to build this envelope generator as a replica of the Eurorack MiniPEG module. The signal is driven by a main phasor that controls the envelope length, and there’s the option to use the envelope either in loop mode or as a single shot.

The envelope shape is based on window envelope functions from the GO book by Wakefield and Taylor

, which approximate quite closely the shapes available in the original project. The issue is that for some parameter values (i.e., certain shapes), in one-shot mode, if I don’t receive any trigger I don’t get 0 at the output.

By design this happens for shape parameter ranges around [0, ~0.15] and [~0.5, ~0.8].

I suspect the problem is caused by the shaping function go.uni.gauss. I tried other functions, but none of them work as well as this one in terms of matching the desired shapes. Does anyone have an idea how this could be fixed?

miniPeg_test.maxpat
Max Patch