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
Constructor
Section titled “Constructor”new Scale(min?: number, max?: number)Parameters
-
min
numberoptionalThe output value when the input is 0.
-
max
numberoptionalThe output value when the input is 1.
new Scale(options?: Partial<ScaleOptions>)Parameters
- options
Partial<ScaleOptions>optional
Properties
Section titled “Properties”input: InputNodeThe 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”output: OutputNodeThe output nodes. If the object is a sink, it does not have any output and this.output is undefined.
max: numberThe maximum output value. This number is output when the value input value is 1.
min: numberThe minimum output value. This number is output when the value input value is 0.
Methods
Section titled “Methods”connect()
Section titled “connect()”↳ inherited from SignalOperator
connect(destination: InputNode, outputNum?: number, inputNum?: number): thisconnect the output of a ToneAudioNode to an AudioParam, AudioNode, or ToneAudioNode
Parameters
-
destination
InputNodeThe output to connect to
-
outputNum
numberoptional default0The output to connect from
-
inputNum
numberoptional default0The input to connect to
Returns this
getDefaults()
Section titled “getDefaults()”static
getDefaults(): ScaleOptionsReturns all of the default options belonging to the class.
Returns ScaleOptions
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(), disconnect(), fan(), toDestination(), toMaster()