So I've made this module to allow for stochastic variation of dynamic envelopes. It allows you to choose between three envelope types or determine the probability of each occuring. With the "ran"(dom) setting, the envelope lengths can be determined autonomously, or you can input a bang (third inlet) to coordinate the envelopes with other modules.
Depending on the length of the envelope, I can sometimes hear the low "resolution" of the "moderate" and particularly the "sharp" envelope, as they are only a four-point approximation of a curve. I can add more points of course, though, ideally, I should probably add a mechanism that takes the length of the envelope into consideration when determining the amount of points and the proportions of the envelope. Of course, if there are already excellent abstractions out there of which I'm unaware, I'd be happy if you could share them with me, so that I can avoid (further) re-inventing the wheel.
N.B: Open demo.pd to test the module.
P.S. It's possible that I've re-invented the wheel in multiple ways in this module, e.g. in the probability determination found in [dynamics]>[pd envelope_type]>[pd envelope_type_pool_and probability]. Any advice regarding pre-existing objects is appreciated.
EDIT: re-uploaded without [gate] and in .zip format.