TonicAudio / Tonic

Easy and efficient audio synthesis in C++
The Unlicense
523 stars 63 forks source link

Make RampedValue::isFinished time-accurate for flat ramps? #233

Open morganpackard opened 10 years ago

morganpackard commented 10 years ago

Consider the following

RampedValue().target(0).length(1000).isFinished()

This will evaluate to "true" even though the length was set to 1000. I've been working on ControlRampedValue, and finding that I want to use it as a timer, but the timer capabilities break when the value doesn't change (i.e. when the ramp goes from 0 to 0). I propose making isFinished time-based, rather than value-based.

ndonald2 commented 10 years ago

That makes sense to me. Just FYI, you could also feasibly use ControlDelay or ControlPulse as a timer.