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.
Under this change, we add state for each BP_SET that records which segment it was in (
synth[osc].current_seg[bp_set]
), and has a dynamic field for the start value of the current envelope segment (synth[osc].seg_start_val[bp_set]
). Whencompute_breakpoint_scale
detects that the envelope is in a new segment, it setsseg_start_val
to the most recently-returned scale value (last_scale
) and the envelope segment proceeds from there.This is quite nice in that it subsumes the previous behavior of release segments (which started from wherever you had gotten to) and extends it to the attack segment of retriggered notes. If you want to always restart your attacks from 0, simply add a
'0,0,'
prefix to your envelope spec.This was to allow smooth retriggering of waveforms as suggested by @vijaymarupudi on Discord.