Closed cordial closed 3 years ago
Tone.Envelope is actually an envelope generator, just has an output but no input. If you want an amplitude envelope, you can either connect the envelope signal output to Tone.Gain
or simpler would be to use Tone.AmplitudeEnvelope
.
If I use AmplitudeEnvelope, I have two issues - i) If I use oscillator.chain( panner, filter, envelope, Tone.Destination); as before, there is no noise from the oscillator. ii) If I use oscillator.connect(envelope) for testing/isolating purposes I can hear the oscillator noise but when I try and change attack, release, sustain, decay while its running the noise doesnt' change. I have tried this via a combination of (with attack example) -
function handleAttackChange(name, newAttack, envelope) { envelope.attack = newAttack; envelope.triggerAttack();
newAttack correctly has a new value you in it but there is no change of noise (i initially tried without the triggerAttack part).
Describe the bug
When I try and chain a filter, envelope and panner to an oscillator I get an error
To Reproduce
In Wrapper Machine component -
Envelope is then passed into the Oscillator component (the italic line is where the error is thrown when you add in the envelope component)
Expected behavior Envelope changes the wave shape of the filtered oscillator
Additional context Error message displayed -
Here is the goal in diagram form (although we are ok with just one Volume Shaper now which is an ADSR on the overall sound output, rather than two different ones with one on each output).