Tone.WaveShaper↳ EXTENDS Tone.SignalBase
Wraps the native Web Audio API WaveShaperNode.
CONSTRUCTORnew Tone.WaveShaper (
The function used to define the values. The mapping function should take two arguments: the first is the value at the current position and the second is the array position. If the argument is an array, that array will be set as the wave shaping function. The input signal is an AudioRange [-1, 1] value and the output signal can take on any numerical values.
The length of the WaveShaperNode buffer.
.curve↝ Array #
The array to set as the waveshaper curve. For linear curves array length does not make much difference, but for complex curves longer arrays will provide smoother interpolation.
.oversample↝ string #
Specifies what type of oversampling (if any) should be used when applying the shaping curve. Can either be “none”, “2x” or “4x”.
.setMap ( )#
The function used to define the values. The mapping function take two arguments: the first is the value at the current position which goes from -1 to 1 over the number of elements in the curve array. The second argument is the array position.
Uses a mapping function to set the value of the curve.
.connect ( )#
The output number to connect from.
The input number to connect to.
When signals connect to other signals or AudioParams, they take over the output value of that signal or AudioParam. For all other nodes, the behavior is the same as a default