Reference ramp()

ramp()

Exponentially ramp to a value using the first two values from <a href="/reference/p5.Envelope/setADSR/">setADSR(attackTime, decayTime)</a> as time constants for simple exponential ramps. If the value is higher than current value, it uses attackTime, while a decrease uses decayTime.

Examples

Syntax

ramp(unit, secondsFromNow, v, [v2])

Parameters

unit
Object:

p5.sound Object or Web Audio Param

secondsFromNow
Number:

When to trigger the ramp

v
Number:

Target value

v2
Number:

Second target value

Notice any errors or typos? Please let us know. Please feel free to edit lib/addons/p5.sound.js and open a pull request!

Related References