Tone.TimelineSignal

↳ EXTENDS Tone.Signal

A signal which adds the method getValueAtTime. Code and inspiration from https://github.com/jsantell/web-audio-automation-timeline

CONSTRUCTOR

new Tone.TimelineSignal ( [
value
] , [
units
] )
value

The initial value of the signal

type: Number
optional
units

The conversion units of the signal.

type: String
optional

Members

.value

Number #

The current value of the signal.

</>
inherited from Tone.AudioNode

.context

Tone.Context READONLY #

Get the audio context belonging to this instance.

</>
inherited from Tone.Param

.convert

Boolean #

If the value should be converted or not

</>
inherited from Tone.Param

.lfo

Tone.LFO READONLY #

The LFO created by the signal instance. If none was created, this is null.

</>
inherited from Tone.Param

.units

Tone.Type #

The units of the parameter

</>

Methods

.cancelAndHoldAtTime ( )

#
cancelTime
type: Time
↪ returns Tone.TimelineSignal

this

Cancels all scheduled parameter changes with times greater than or equal to cancelTime and sets the output of the signal to be the value at cancelTime. Similar to (cancelScheduledValues)[#cancelscheduledvalues].

</>

.cancelScheduledValues ( )

#
startTime
type: Time
↪ returns Tone.TimelineSignal

this

Cancels all scheduled parameter changes with times greater than or equal to startTime.

</>

.connect ( )

#
outputNumber

The output number to connect from.

type: number
default: 0
inputNumber

The input number to connect to.

type: number
default: 0
↪ returns Tone.TimelineSignal

this

When signals connect to other signals or AudioParams, they take over the output value of that signal or AudioParam. For all other nodes, the behavior is the same as a default connect.

</>

.exponentialRampToValueBetween ( )

#
value

The value to ramp to.

type: Number
start

The beginning anchor point to do the exponential ramp

type: Time
finish

The ending anchor point by which the value of the signal will equal the given value.

type: Time
↪ returns Tone.TimelineSignal

this

Do a exponential ramp to the given value between the start and finish times.

</>

.getValueAtTime ( )

#
time

The time in seconds.

type: Number
↪ returns Number

The scheduled value at the given time.

Get the scheduled value at the given time. This will return the unconverted (raw) value.

</>

.linearRampToValueAtTime ( )

#
value
type: number
endTime
type: Time
↪ returns Tone.TimelineSignal

this

Schedules a linear continuous change in parameter value from the previous scheduled parameter value to the given value.

</>

.linearRampToValueBetween ( )

#
value

The value to ramp to.

type: Number
start

The beginning anchor point to do the linear ramp

type: Time
finish

The ending anchor point by which the value of the signal will equal the given value.

type: Time
↪ returns Tone.TimelineSignal

this

Do a linear ramp to the given value between the start and finish times.

</>

.setRampPoint ( )

#
time

When to set the ramp point

type: Time
↪ returns Tone.TimelineSignal

this

Sets the computed value at the given time. This provides a point from which a linear or exponential curve can be scheduled after. Will cancel events after the given time and shorten the currently scheduled linear or exponential ramp so that it ends at time . This is to avoid discontinuities and clicks in envelopes.

</>

.setTargetAtTime ( )

#
value
type: number
startTime
type: Time
timeConstant
type: number
↪ returns Tone.TimelineSignal

this

Start exponentially approaching the target value at the given time with a rate having the given time constant.

</>

.setValueAtTime ( )

#
value

The value to set the signal.

type: *
time

The time when the change should occur.

type: Time
↪ returns Tone.TimelineSignal

this

Schedules a parameter value change at the given time.

EXAMPLE

//set the frequency to "G4" in exactly 1 second from now.
freq.setValueAtTime("G4", "+1");
</>

.setValueCurveAtTime ( )

#
values
startTime
type: Time
duration
type: Time
scaling

If the values in the curve should be scaled by some value

default: 1
↪ returns Tone.TimelineSignal

this

Set an array of arbitrary values starting at the given time for the given duration.

</>

.dispose ( )

#
↪ returns Tone.TimelineSignal

this

Clean up.

</>

.exponentialRampToValueAtTime ( )

#
value
type: number
endTime
type: Time
↪ returns Tone.TimelineSignal

this

Schedules an exponential continuous change in parameter value from the previous scheduled parameter value to the given value.

</>
inherited from Tone.AudioNode

.toMaster ( )

#
↪ returns Tone.AudioNode

this

Connect ‘this’ to the master output. Shorthand for this.connect(Tone.Master)

EXAMPLE

//connect an oscillator to the master output
var osc = new Tone.Oscillator().toMaster();
</>
inherited from Tone.AudioNode

.disconnect ( )

#
output

Either the output index to disconnect if the output is an array, or the node to disconnect from.

↪ returns Tone.AudioNode

this

disconnect the output

</>
inherited from Tone.AudioNode

.connect ( )

#
outputNum

optionally which output to connect from

type: number
default: 0
inputNum

optionally which input to connect to

type: number
default: 0
↪ returns Tone.AudioNode

this

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

</>
inherited from Tone.Param

.targetRampTo ( )

#
value

The value to ramp to.

type: number
rampTime

the time that it takes the value to ramp from it’s current value

type: Time
startTime

When the ramp should start.

type: Time
default: now
↪ returns Tone.Param

this

Start exponentially approaching the target value at the given time. Since it is an exponential approach it will continue approaching after the ramp duration. The rampTime is the time that it takes to reach over 99% of the way towards the value.

EXAMPLE

//exponentially ramp to the value 2 over 4 seconds.
signal.exponentialRampTo(2, 4);
</>
inherited from Tone.Param

.getTimeConstant ( )

#
time

The time to convert

type: Time
↪ returns Number

The time constant to get an exponentially approaching curve to over 99% of towards the target value.

Convert between Time and time constant. The time constant returned can be used in setTargetAtTime.

</>
inherited from Tone.Param

.rampTo ( )

#
value
type: number
rampTime

The time that it takes the value to ramp from it’s current value

type: Time
startTime

When the ramp should start.

type: Time
default: now
↪ returns Tone.Param

this

Ramps to the given value over the duration of the rampTime. Automatically selects the best ramp type (exponential or linear) depending on the units of the signal

EXAMPLE

//ramp to the value either linearly or exponentially
//depending on the "units" value of the signal
signal.rampTo(0, 10);
 

EXAMPLE

//schedule it to ramp starting at a specific time
signal.rampTo(0, 10, 5)
</>
inherited from Tone.Param

.linearRampTo ( )

#
value

The value to ramp to.

type: number
rampTime

the time that it takes the value to ramp from it’s current value

type: Time
startTime

When the ramp should start.

type: Time
default: now
↪ returns Tone.Param

this

Schedules an linear continuous change in parameter value from the current time and current value to the given value over the duration of the rampTime.

EXAMPLE

//linearly ramp to the value 4 over 3 seconds.
signal.linearRampTo(4, 3);
</>
inherited from Tone.Param

.exponentialRampTo ( )

#
value

The value to ramp to.

type: number
rampTime

the time that it takes the value to ramp from it’s current value

type: Time
startTime

When the ramp should start.

type: Time
default: now
↪ returns Tone.Param

this

Schedules an exponential continuous change in parameter value from the current time and current value to the given value over the duration of the rampTime.

EXAMPLE

//exponentially ramp to the value 2 over 4 seconds.
signal.exponentialRampTo(2, 4);
</>
docs generated Sep 15 2019