Cartoon Compressor

A demo I'm wrting to help me better understand the effects of audio compressor controls. (I wanted something that would respond instantly to changes, without having to wait to view/hear the effects via the usual modify-play-record-listen/view loop.)

Note: Works best on Chrome and Safari browsers. (Firefox is slow. I don't care enough to fight with it.)


Peak Detection / Envelope / Sidechain:

Many methods are used for this; the simplest being charging and discharging RC circuits for attack and release, respectively.

...This "input envelope" then gets sent to the "gain stage"...

Gain Stage:

Knee Width
Make-Up Gain

...which (instantly) modifies the the envelope (all lag occurred earlier in envelope detection in the sidechain) and then generates the output waveform: