electro-smith / DaisySP

A Powerful DSP Library in C++
https://www.electro-smith.com/daisy
Other
903 stars 143 forks source link

Add hard retrigger to adenv #202

Open charlieb opened 9 months ago

charlieb commented 9 months ago

Description

Added hard retriggering option to the adenv envelope type. I added an additional "Trigger" method that takes a "hard" boolean so as not to break any existing code.

Testing

I'm using it in my increasingly inaccurately named polysynth pod project: https://github.com/charlieb/podsynth Specifically I'm using it in note.h to make sure that a fast arp with a too-long AD sequence actually restarts the notes correctly. Without this functionality it's all too easy to saturate the envelope so it's always outputting 1.

Demos / Example Code

https://github.com/charlieb/podsynth/blob/93c24e7bcd7d021277bda945dd85646bc7dfe752/note.h#L46