Gate
class Component ↳ extends ToneAudioNode<GateOptions>
Gate only passes a signal through when the incoming signal exceeds a specified threshold. It uses Follower to follow the ampltiude of the incoming signal and compares it to the threshold value using GreaterThan.
const gate = new Tone.Gate(-30, 0.2).toDestination(); const mic = new Tone.UserMedia().connect(gate); // the gate will only pass through the incoming // signal when it's louder than -30db
Constructor
Section titled “Constructor”new Gate(threshold?: number, smoothing?: Time)Parameters
-
threshold
numberoptionalThe threshold above which the gate will open.
-
smoothing
TimeoptionalThe follower’s smoothing time
new Gate(options?: Partial<GateOptions>)Parameters
- options
Partial<GateOptions>optional
Properties
Section titled “Properties”read-only
input: ToneAudioNodeThe input node or nodes. If the object is a source, it does not have any input and this.input is undefined.
output
Section titled “output”read-only
output: ToneAudioNodeThe output nodes. If the object is a sink, it does not have any output and this.output is undefined.
smoothing
Section titled “smoothing”smoothing: TimeThe attack/decay speed of the gate.
See also: Follower.smoothing
Methods
Section titled “Methods”getDefaults()
Section titled “getDefaults()”static
getDefaults(): GateOptionsReturns all of the default options belonging to the class.
Returns GateOptions
Inherited members
Section titled “Inherited members”- From
ToneWithContext: context, blockTime, sampleTime, get(), immediate(), now(), set(), toFrequency(), toSeconds(), toTicks() - From
Tone: debug, version, disposed, toString() - From
ToneAudioNode: channelCount, channelCountMode, channelInterpretation, numberOfInputs, numberOfOutputs, chain(), connect(), disconnect(), fan(), toDestination(), toMaster()