Skip to content
Tone.js

Scale

class Signal ↳ extends SignalOperator<Options>

Performs a linear scaling on an input signal. Scales a NormalRange input to between outputMin and outputMax.

const scale = new Tone.Scale(50, 100);
const signal = new Tone.Signal(0.5).connect(scale);
// the output of scale equals 75
new Scale(min?: number, max?: number)

Parameters

  • min number optional

    The output value when the input is 0.

  • max number optional

    The output value when the input is 1.

new Scale(options?: Partial<ScaleOptions>)

Parameters

input: InputNode

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: "Scale"

output: OutputNode

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

max: number

The maximum output value. This number is output when the value input value is 1.

min: number

The minimum output value. This number is output when the value input value is 0.

↳ 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

static

getDefaults(): ScaleOptions

Returns all of the default options belonging to the class.

Returns ScaleOptions