Closed cordial closed 3 years ago
I think i maybe should be using a LFO as a control input?
could you provide an example of this issue or more context? i'm unable to recreate it on my end.
Here's a simplified example of randomly changing the attack length on each retrigger: https://codesandbox.io/s/priceless-minsky-z3ik5?file=/src/index.ts
Thanks for the reply. What I was trying to do maybe doesn't make sense. If you take in an oscillator input which is constantly on, is a way to apply a ADSR to it?
Context
This would be the machine diagram -
OSC1 OSC2 OSC3 OSC4 (with panners) going into FILTER going into ENVELOPE going to destination.
Like this - https://codesandbox.io/s/strange-ganguly-gjju2?file=/src/index.ts
I see where my original code was wrong as it wasn't doing the envelope attack method at the right moment. However...
So this is an isochronic machine. It has an on / off button. When you press on, all the oscillators turn on. However, the machine also has knobs to twist for the envelope object for the attributes ADSR (attack, release...). So idea being when you turn them it changes the envelope on the fly. Is that possible? Does it even make sense as a concept? The more I think about it, it just seems wrong (not my idea).
It's fine to leave the oscillators on. The output amplitude is gated by the envelope, so you won't hear them which seems to be the desired outcome.
not sure i fully understand the idea of changing the envelope on the fly, you could definitely attach a knob to the envelope's parameters and alter those between each re-triggering. There's currently no way to alter an envelope which has already been triggered though.
Hope that helps clarify things
If I use AmplitudeEnvelope, I have two issues - i) If I use oscillator.chain( panner, filter, envelope, Tone.Destination); there is no noise from the oscillator. nb if i remove envelope, i hear 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) -
newAttack correctly has a new value you in it but there is no change of noise (i initially tried without the triggerAttack part).
Originally posted by @cordial in https://github.com/Tonejs/Tone.js/issues/875#issuecomment-820329875