mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
more modulus optimization
This commit is contained in:
parent
5b178359fd
commit
a0fe662dcd
1 changed files with 6 additions and 3 deletions
|
@ -59,9 +59,13 @@ define(["Tone/core/Tone", "Tone/signal/Multiply"], function(Tone){
|
|||
*/
|
||||
var ModuloSubroutine = function(modulus, multiple){
|
||||
|
||||
Tone.call(this);
|
||||
var val = modulus * multiple;
|
||||
|
||||
/**
|
||||
* the input node
|
||||
*/
|
||||
this.input = this.context.createGain();
|
||||
|
||||
/**
|
||||
* divide the incoming signal so it's on a 0 to 1 scale
|
||||
* @type {Tone.Multiply}
|
||||
|
@ -77,7 +81,7 @@ define(["Tone/core/Tone", "Tone/signal/Multiply"], function(Tone){
|
|||
this._operator = this.context.createWaveShaper();
|
||||
|
||||
//connect it up
|
||||
this.chain(this.input, this._div, this._operator, this.output);
|
||||
this.chain(this.input, this._div, this._operator);
|
||||
this._makeCurve(val);
|
||||
};
|
||||
|
||||
|
@ -101,7 +105,6 @@ define(["Tone/core/Tone", "Tone/signal/Multiply"], function(Tone){
|
|||
}
|
||||
}
|
||||
this._operator.curve = curve;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue