Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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