Skip to content
Tone.js

Distortion

class Effect ↳ extends Effect<DistortionOptions>

A simple distortion effect using Tone.WaveShaper. Algorithm from this stackoverflow answer. Read more about distortion on [Wikipedia](https://en.wikipedia.org/wiki/Distortion_(music).

const dist = new Tone.Distortion(0.8).toDestination();
const fm = new Tone.FMSynth().connect(dist);
fm.triggerAttackRelease("A1", "8n");
new Distortion(distortion?: number)

Parameters

  • distortion number optional

    The amount of distortion (nominal range of 0-1)

new Distortion(options?: Partial<DistortionOptions>)

Parameters

↳ inherited from Effect

input: Gain

The effect input node

read-only

name: string

The name of the class

Default: "Distortion"

↳ inherited from Effect

output: CrossFade

The effect output

↳ inherited from Effect

wet: Signal<"normalRange">

The wet control is how much of the effected will pass through to the output. 1 = 100% effected signal, 0 = 100% dry signal.

distortion: number

The amount of distortion. Nominal range is between 0 and 1.

oversample: OverSampleType

The oversampling of the effect. Can either be “none”, “2x” or “4x”.

dispose(): this

Dispose and disconnect

Returns this

static

getDefaults(): DistortionOptions

Returns all of the default options belonging to the class.

Returns DistortionOptions