Skip to content
Tone.js

GreaterThanZero

class Signal ↳ extends SignalOperator<GreaterThanZeroOptions>

GreaterThanZero outputs 1 when the input is strictly greater than zero

return Tone.Offline(() => {
	const gt0 = new Tone.GreaterThanZero().toDestination();
	const sig = new Tone.Signal(0.5).connect(gt0);
	sig.setValueAtTime(-1, 0.05);
}, 0.1, 1);
new GreaterThanZero(options?: Partial<ToneWithContextOptions>)

Parameters

read-only

The input node or nodes. If the object is a source, it does not have any input and this.input is undefined.

read-only

name: string

The name of the class

Default: "GreaterThanZero"

read-only

The output nodes. If the object is a sink, it does not have any output and this.output is undefined.

↳ inherited from SignalOperator

connect(destination: InputNode, outputNum?: number, inputNum?: number): this

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

Parameters

  • destination InputNode

    The output to connect to

  • outputNum number optional default 0

    The output to connect from

  • inputNum number optional default 0

    The input to connect to

Returns this

↳ inherited from SignalOperator

disconnect(destination: InputNode, outputNum?: number, inputNum?: number): this

disconnect the output

Parameters

  • destination InputNode
  • outputNum number optional default 0
  • inputNum number optional default 0

Returns this

dispose(): this

Dispose and disconnect

Returns this