ramp(unit, secondsFromNow, v1, v2) {
    var now = p5sound.audiocontext.currentTime;
    var tFromNow = secondsFromNow || 0;
    var t = now + tFromNow;
    var destination1 = this.checkExpInput(v1);
    var destination2 =
      typeof v2 !== 'undefined' ? this.checkExpInput(v2) : undefined;

    // connect env to unit if not already connected
    if (unit) {
      if (this.connection !== unit) {
        this.connect(unit);
      }
    }

    //get current value
    var currentVal = this.checkExpInput(this.control.getValueAtTime(t));
    // this.control.cancelScheduledValues(t);

    //if it's going up
    if (destination1 > currentVal) {
      this.control.setTargetAtTime(destination1, t, this._rampAttackTC);
      t += this._rampAttackTime;
    }

    //if it's going down
    else if (destination1 < currentVal) {
      this.control.setTargetAtTime(destination1, t, this._rampDecayTC);
      t += this._rampDecayTime;
    }

    // Now the second part of envelope begins
    if (destination2 === undefined) return;

    //if it's going up
    if (destination2 > destination1) {
      this.control.setTargetAtTime(destination2, t, this._rampAttackTC);
    }

    //if it's going down
    else if (destination2 < destination1) {
      this.control.setTargetAtTime(destination2, t, this._rampDecayTC);
    }
  }
Exponentially ramp to a value using the first two
 values from <code><a href="#/p5.Envelope/setADSR">setADSR(attackTime, decayTime)</a></code>
 as <a href="https://en.wikipedia.org/wiki/RC_time_constant">
 time constants</a> for simple exponential ramps.
 If the value is higher than current value, it uses attackTime,
 while a decrease uses decayTime.

 @method  ramp
 @for p5.Envelope
 @param  {Object} unit           p5.sound Object or Web Audio Param
 @param  {Number} secondsFromNow When to trigger the ramp
 @param  {Number} v              Target value
 @param  {Number} [v2]           Second target value
 @example
 <div><code>
 let env, osc, amp;

 let attackTime = 0.001;
 let decayTime = 0.2;
 let attackLevel = 1;
 let decayLevel = 0;

 function setup() {
   let cnv = createCanvas(100, 100);
   fill(0,255,0);
   noStroke();

   env = new p5.Envelope();
   env.setADSR(attackTime, decayTime);
   osc = new p5.Oscillator();
   osc.amp(env);
   amp = new p5.Amplitude();

   cnv.mousePressed(triggerRamp);
 }

 function triggerRamp() {
   // ensures audio is enabled. See also: `userStartAudio`
   osc.start();

   env.ramp(osc, 0, attackLevel, decayLevel);
 }

 function draw() {
   background(20);
   text('tap to play', 10, 20);
   let h = map(amp.getLevel(), 0, 0.4, 0, height);;
   rect(0, height, width, -h);
 }
 </code></div>