4 ms·
Well, in your case you're using the webkit exponentialRampToValueAtTime or whatever it's called, so you could just recompute the envelope (it's an exponential s
by a1k0n 10y ago
Well, in your case you're using the webkit exponentialRampToValueAtTime or whatever it's called, so you could just recompute the envelope (it's an exponential sweep... actually it's sort of double-exponential, which is another thing I need to fix in mine) and issue new filter sweeps every time the knobs move, right? you could set it based on when the envelope was triggered in the past and it should work fine.
edit: nevermind, I thought you could specify a startTime in addition to endTime but you can't. so you'd have to use audioContext.currentTime to figure out where the sweep should be now, ramp to there, and exponential sweep down to the final value at the end time.
- errozero 10y agoI've not tried the technique linked to yet but it makes it sound like you don't need to make any calculations yourself if you connect a gain node to the filter input and adjust that instead of directly adjusting the filter. I'm guessing it takes that input and adds it to the current value of the envelope.