Class: Signal

Signal

new Signal(value)

constant audio-rate signal Tone.Signal is a core component which allows for synchronization of many components. A single signal can drive multiple parameters by applying Scaling. For example: to synchronize two Tone.Oscillators in octaves of each other, Signal --> OscillatorA.frequency ^--> Tone.Multiply(2) --> OscillatorB.frequency Tone.Signal can be scheduled with all of the functions available to AudioParams
Parameters:
Name Type Argument Description
value number <optional>
(optional) initial value
Source:

Members

<private> _syncRatio :number

the ratio of the this value to the control signal value
Type:
  • number
Source:

output :GainNode

the output node
Type:
  • GainNode
Source:

scalar :GainNode

scales the constant output to the desired output
Type:
  • GainNode
Source:

Methods

cancelScheduledValues(startTime)

Cancels all scheduled parameter changes with times greater than or equal to startTime.
Parameters:
Name Type Description
startTime Tone.Time
Source:

exponentialRampToValueAtTime(value, endTime)

Schedules an exponential continuous change in parameter value from the previous scheduled parameter value to the given value.
Parameters:
Name Type Description
value number
endTime Tone.Time
Source:

exponentialRampToValueNow(value, endTime)

Schedules an exponential continuous change in parameter value from the current time and current value to the given value.
Parameters:
Name Type Description
value number
endTime Tone.Time
Source:

getValue() → {number}

Source:
Returns:
the current value of the signal
Type
number

linearRampToValueAtTime(value, endTime)

Schedules a linear continuous change in parameter value from the previous scheduled parameter value to the given value.
Parameters:
Name Type Description
value number
endTime Tone.Time
Source:

linearRampToValueNow(value, endTime)

Schedules an linear continuous change in parameter value from the current time and current value to the given value at the given time.
Parameters:
Name Type Description
value number
endTime Tone.Time
Source:

setCurrentValueNow() → {number}

creates a schedule point with the current value at the current time
Source:
Returns:
the current value
Type
number

setTargetAtTime(value, startTime, timeConstant)

Start exponentially approaching the target value at the given time with a rate having the given time constant.
Parameters:
Name Type Description
value number
startTime Tone.Time
timeConstant number
Source:

setValue(value)

set the value of the signal right away will be overwritten if there are previously scheduled automation curves
Parameters:
Name Type Description
value number
Source:

setValueAtTime(value, time)

Schedules a parameter value change at the given time.
Parameters:
Name Type Description
value number
time Tone.Time
Source:

setValueCurveAtTime(values, startTime, duration)

Sets an array of arbitrary parameter values starting at the given time for the given duration.
Parameters:
Name Type Description
values Array.<number>
startTime Tone.Time
duration Tone.Time
Source:

sync(signal)

Sync this to another signal and it will always maintain the ratio between the two signals until it is unsynced
Parameters:
Name Type Description
signal Tone.Signal to sync to
Source:

unsync()

unbind the signal control will leave the signal value as it was without the influence of the control signal
Source: