Skip to content
Tone.js

AutoFilter

class Effect ↳ extends LFOEffect<AutoFilterOptions>

AutoFilter is a Tone.Filter with a Tone.LFO connected to the filter cutoff frequency. Setting the LFO rate and depth allows for control over the filter modulation rate and depth.

// create an autofilter and start its LFO
const autoFilter = new Tone.AutoFilter("4n").toDestination().start();
// route an oscillator through the filter and start it
const oscillator = new Tone.Oscillator().connect(autoFilter).start();
new AutoFilter(frequency?: Frequency, baseFrequency?: Frequency, octaves?: number)

Parameters

  • frequency Frequency optional

    The rate of the LFO.

  • baseFrequency Frequency optional

    The lower value of the LFOs oscillation

  • octaves number optional

    The number of octaves above the baseFrequency

new AutoFilter(options?: Partial<AutoFilterOptions>)

Parameters

read-only ↳ inherited from LFOEffect

depth: Param<"normalRange">

The range of the filter modulating between the min and max frequency. 0 = no modulation. 1 = full modulation.

read-only

filter: Filter

The filter node

read-only ↳ inherited from LFOEffect

frequency: Signal<"frequency">

How fast the filter modulates between min and max.

↳ inherited from Effect

input: Gain

The effect input node

read-only

name: string

The name of the class

Default: "AutoFilter"

↳ 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.

baseFrequency: Frequency

The minimum value of the filter’s cutoff frequency.

octaves: number

The maximum value of the filter’s cutoff frequency.

↳ inherited from LFOEffect

The type of the LFO’s oscillator.

const autoFilter = new Tone.AutoFilter().start().toDestination();
const noise = new Tone.Noise().start().connect(autoFilter);
autoFilter.type = "square";

See also: Oscillator.type

dispose(): this

Dispose and disconnect

Returns this

↳ inherited from LFOEffect

start(time?: Time): this

Start the effect.

Parameters

  • time Time optional

Returns this

↳ inherited from LFOEffect

stop(time?: Time): this

Stop the lfo

Parameters

  • time Time optional

Returns this

↳ inherited from LFOEffect

sync(): this

Sync the filter to the transport.

See also: LFO.sync

Returns this

↳ inherited from LFOEffect

unsync(): this

Unsync the filter from the transport.

Returns this

static

getDefaults(): AutoFilterOptions

Returns all of the default options belonging to the class.

Returns AutoFilterOptions