Skip to content
Tone.js

Negate

class Signal ↳ extends SignalOperator<ToneAudioNodeOptions>

Negate the incoming signal. i.e. an input signal of 10 will output -10

const neg = new Tone.Negate();
const sig = new Tone.Signal(-2).connect(neg);
// output of neg is positive 2.
new Negate(options?: Partial<ToneWithContextOptions>)

Parameters

input: Multiply<"number">

The input and output are equal to the multiply node

read-only

name: string

The name of the class

Default: "Negate"

output: Multiply<"number">

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

dispose(): this

clean up

Returns this this