dimanche 3 mai 2015

Web Audio synthesis: how to handle changing the filter cutoff during the attack or release phase?

I'm building an emulation of the Roland Juno-106 synthesizer using WebAudio.

I'm hung up on how to handle altering some parameters while the envelope is in progress.

I have the amp envelope modeled to my satisfaction. I use timeouts to keep track of which stage of the envelope I'm in and respond appropriately. That code is found here.

And I think I'm also good with updating the filter if the envelope values are changed during the attack or release phase.

But I'm hung up on how to deal with updating the filter if the cutoff frequency or envelope modulation amount are changed during the attack or release while the filter is simultaneously being modulated by the envelope. That code is located around here. The current implementation doesn't respond the way an analog synth would, but I can't quite figure out how to calculate it.

On a real synth the filter changes immediately as determined by the frequency cutoff, envelope modulation amount, and current stage in the envelope, but the ramp up or down also continues smoothly.

How would I model this behavior?

Aucun commentaire:

Enregistrer un commentaire