4 ms·
Haha, sorry about that. I think your preview sounds a lot better than my version and the code is impressive. I need to make a few changes to my app, one of the
by errozero 10y ago
Haha, sorry about that. I think your preview sounds a lot better than my version and the code is impressive. I need to make a few changes to my app, one of the main ones is the fact that you cant adjust the cutoff whilst the envelope is in progress but I have recently come across this technique which I am going to implement:
http://stackoverflow.com/questions/30019666/web-audio-synthesis-how-to-handle-changing-the-filter-cutoff-during-the-attack http://stackoverflow.com/questions/30019666/web-audio-synthe...
My Acid Machine app has been built in a way so that all of the instruments are self contained modules, you could possibly create an instrument that would be compatible with the whole UI and step sequencer etc of my app quite easily.
- a1k0n 10y agoWell, 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.