using exponentialApproachValueAtTime

This commit is contained in:
Yotam Mann 2017-09-20 19:04:49 -04:00
parent 0723f50796
commit 6d38440379

View file

@ -185,7 +185,7 @@ define(["Tone/core/Tone", "Tone/core/Buffer", "Tone/source/Source", "Tone/core/G
if (this.curve === "linear"){
this._gainNode.gain.linearRampToValueAtTime(this._gain, time + fadeInTime);
} else {
this._gainNode.gain.setTargetAtTime(this._gain, time, this._gainNode.gain.getTimeConstant(fadeInTime));
this._gainNode.gain.exponentialAppraochValueAtTime(this._gain, time, fadeInTime);
}
} else {
this._gainNode.gain.setValueAtTime(gain, time);
@ -268,7 +268,7 @@ define(["Tone/core/Tone", "Tone/core/Buffer", "Tone/source/Source", "Tone/core/G
if (this.curve === "linear"){
this._gainNode.gain.linearRampToValueAtTime(0, time);
} else {
this._gainNode.gain.setTargetAtTime(0, startFade, this._gainNode.gain.getTimeConstant(fadeOutTime));
this._gainNode.gain.exponentialAppraochValueAtTime(0, startFade, fadeOutTime);
}
} else {
this._gainNode.gain.setValueAtTime(0, time);