Tone.Gate

↳ EXTENDS Tone.AudioNode

Tone.Gate only passes a signal through when the incoming signal exceeds a specified threshold. To do this, Gate uses a Tone.Follower to follow the amplitude of the incoming signal. A common implementation of this class is a Noise Gate.

CONSTRUCTOR

new Tone.Gate ( [
threshold
] , [
attack
] , [
release
] )
threshold

The threshold above which the gate will open.

optional
attack

The follower’s attack time

type: Time
optional
release

The follower’s release time

type: Time
optional

DEFAULTS

{
attack : 0.1 ,
release : 0.1 ,
threshold : -40
}

EXAMPLE

var gate = new Tone.Gate(-30, 0.2, 0.3).toMaster();
var mic = new Tone.UserMedia().connect(gate);
//the gate will only pass through the incoming
//signal when it's louder than -30db

Members

.attack

Time #

The attack speed of the gate

</>

.release

Time #

The release speed of the gate

</>

.threshold

Decibels #

The threshold of the gate in decibels

</>
inherited from Tone.AudioNode

.context

Tone.Context READONLY #

Get the audio context belonging to this instance.

</>

Methods

.dispose ( )

#
↪ returns Tone.Gate

this

Clean up.

</>
inherited from Tone.AudioNode

.connect ( )

#
outputNum

optionally which output to connect from

type: number
default: 0
inputNum

optionally which input to connect to

type: number
default: 0
↪ returns Tone.AudioNode

this

connect the output of a ToneNode to an AudioParam, AudioNode, or ToneNode

</>
inherited from Tone.AudioNode

.disconnect ( )

#
output

Either the output index to disconnect if the output is an array, or the node to disconnect from.

↪ returns Tone.AudioNode

this

disconnect the output

</>
inherited from Tone.AudioNode

.toMaster ( )

#
↪ returns Tone.AudioNode

this

Connect ‘this’ to the master output. Shorthand for this.connect(Tone.Master)

EXAMPLE

//connect an oscillator to the master output
var osc = new Tone.Oscillator().toMaster();
</>
docs generated Sep 15 2019