relaxing optimization slightly. only when connected to an AudioParam or Param

This commit is contained in:
Yotam Mann 2018-02-05 00:15:49 -05:00
parent e767d618d2
commit 9428e6c1b8

View file

@ -114,8 +114,7 @@ define(["Tone/core/Tone", "Tone/signal/WaveShaper", "Tone/type/Type", "Tone/core
* @private
*/
Tone.Signal.prototype._isParam = function(node){
return (Tone.Signal && Tone.Signal === node.constructor) ||
(Tone.Param && Tone.Param === node.constructor) ||
return (Tone.Param && Tone.Param === node.constructor) ||
node instanceof AudioParam;
};
@ -154,7 +153,7 @@ define(["Tone/core/Tone", "Tone/signal/WaveShaper", "Tone/type/Type", "Tone/core
* @private
*/
Tone.Signal.prototype._applyAutomations = function(param){
var now = this.now();
var now = this.context.currentTime;
param.cancelScheduledValues(now);
var currentVal = this.getValueAtTime(now);
param.setValueAtTime(currentVal, now);