Tone.AmplitudeEnvelope↳ EXTENDS Tone.Envelope
Tone.AmplitudeEnvelope is a Tone.Envelope connected to a gain node. Unlike Tone.Envelope, which outputs the envelope’s value, Tone.AmplitudeEnvelope accepts an audio signal as the input and will apply the envelope to the amplitude of the signal. Read more about ADSR Envelopes on Wikipedia.
CONSTRUCTORnew Tone.AmplitudeEnvelope ( [
The amount of time it takes for the envelope to go from 0 to it’s maximum value.
The period of time after the attack that it takes for the envelope to fall to the sustain value.
The percent of the maximum value that the envelope rests at until the release is triggered.
The amount of time after the release is triggered it takes to reach 0.
.numberOfInputs↝ Number READONLY #
The number of inputs feeding into the AudioNode. For source nodes, this will be 0.
.numberOfOutputs↝ Number READONLY #
The number of outputs coming out of the AudioNode.
.channelInterpretation↝ String READONLY #
channelInterpretation determines how individual channels will be treated when up-mixing and down-mixing connections to any inputs to the node. The default value is “speakers”.
.context↝ Tone.Context READONLY #
Get the audio context belonging to this instance.
.channelCount↝ Number READONLY #
channelCount is the number of channels used when up-mixing and down-mixing connections to any inputs to the node. The default value is 2 except for specific nodes where its value is specially determined.
.channelCountMode↝ String READONLY #
channelCountMode determines how channels will be counted when up-mixing and down-mixing connections to any inputs to the node. The default value is “max”. This attribute has no effect for nodes with no inputs.
.sustain↝ NormalRange #
The sustain value is the value which the envelope rests at after triggerAttack is called, but before triggerRelease is invoked.
.attack↝ Time #
When triggerAttack is called, the attack time is the amount of time it takes for the envelope to reach it’s maximum value.
.value↝ Number READONLY #
Read the current value of the envelope. Useful for syncronizing visual output to the envelope.
.attackCurve↝ String or Array #
The shape of the attack. Can be any of these strings: <ul> <li>linear</li> <li>exponential</li> <li>sine</li> <li>cosine</li> <li>bounce</li> <li>ripple</li> <li>step</li> </ul> Can also be an array which describes the curve. Values in the array are evenly subdivided and linearly interpolated over the duration of the attack.
.decay↝ Time #
After the attack portion of the envelope, the value will fall over the duration of the decay time to it’s sustain value.
.decayCurve↝ String #
The shape of the decay either “linear” or “exponential”
.release↝ Time #
After triggerRelease is called, the envelope’s value will fall to it’s miminum value over the duration of the release time.
.releaseCurve↝ String or Array #
The shape of the release. See the attack curve types.
.chain ( )#
Connect the output of this node to the rest of the nodes in series.
.toMaster ( )#
Connect ‘this’ to the master output. Shorthand for this.connect(Tone.Master)
.disconnect ( )#
Either the output index to disconnect if the output is an array, or the node to disconnect from.
disconnect the output
.fan ( )#
connect the output of this node to the rest of the nodes in parallel.
.triggerRelease ( )#
When the release portion of the envelope should start.
Triggers the release of the envelope.
.getValueAtTime ( )#
Get the scheduled value at the given time. This will return the unconverted (raw) value.
.triggerAttack ( )#
When the attack should start.
The velocity of the envelope scales the vales. number between 0-1
Trigger the attack/decay portion of the ADSR envelope.
.triggerAttackRelease ( )#
The duration of the sustain.
When the attack should be triggered.
The velocity of the envelope.
triggerAttackRelease is shorthand for triggerAttack, then waiting some duration, then triggerRelease.