A single targetRatio parameter morphs an ADSR segment's shape from near-exponential to near-linear
Instead of hard-coding exponential or linear segments, a software ADSR can parameterise curve shape with a targetRatio — an ‘overshoot’ value used to compute the per-segment rate: rate = exp(-log((1 + targetRatio) / targetRatio) / time). A small targetRatio keeps the segment near a true exponential (fast initial move, slow final approach); larger values push it toward straight linear segments, giving a versatile ‘curve’ control very simply. The rate is computed once per segment and then applied with a cheap per-sample multiply-add iteration, avoiding an exp() call on every sample.
Examples
targetRatio small (near 0) -> near-exponential decay; larger targetRatio -> approximately linear segment. A user-facing ‘curve’ knob can map to targetRatio so one control continuously reshapes attack/decay/release character, all from the same iterative multiply-add.
Assessment
What does targetRatio control in a software ADSR? How does raising it change segment shape? What computational advantage does the once-per-segment rate plus per-sample multiply-add give over calling exp() every sample?