Simple Compressor class (C++)

Type : stereo, feed-forward, peak compressor
References : Posted by Citizen Chunk
Linked file :
Notes :
Everyone seems to want to make their own compressor plugin these days, but very few know where to start. After replying to so many questions on the KVR Dev Forum, I figured I might as well just post some ready-to-use C++ source code.

This is a C++ implementation of a simple, stereo, peak compressor. It uses a feed-forward topology, detecting the sidechain level pre-gain reduction. The sidechain detects the rectified peak level, with stereo linking to preserve imaging. The attack/release uses the EnvelopeDetector class (posted in the Analysis section).

- Make sure to call initRuntime() before processing starts (i.e. call it in resume()).
- The process function takes a stereo input.
- VST params must be mapped to a practical range when setting compressor parameters. (i.e. don't try setAttack( 0.f ).)

(see linked files)
from : tl_163[AT]hotmail[DOT]com
comment : This code works perfectly, and I have tried a number of sound and each worked correctly. The conversion is linear in logarithm domain. The code has been written in such a professional style, can not believe it is FREE!! Keep it up. Two super huge thumbs up. Ting

from : scuzzphut[AT]gmail[DOT]com
comment : source file seems to be down :-( anyone have a local copy ???

from : citizenchunk[ at ]chunkware[ dot ]com
comment : there are some updates: mainly, there is now a SimpleGate class, which implements a simple gate. other than that, minor changes to the code -- but all public functions should work the same. *** NEW FILE NAME:

from : jinjing20012001[AT]yahoo[DOT]com
comment : hello everybady! I am a Chinese student, I want to download the code from but because the server can not do his job well,I have no chance to download the code.I really hope kind people who have been have the code can tansfer a copy to me!I will be appreciated very much. my emial is listed as following: I am looking for your reply as soon as possible.

from : citizenchunk[ at ]chunkware[DOT]com
comment : sorry about the link. the new source is at

from : ben[AT]benvesco[DOT]com
comment : MIRROR: This code has been missing for some time at the posted locations. I found someone with a copy and am now mirroring these files for download on my server. I believe the software license allows this mirroring. The code is unchanged and belongs to the original owner.

from : jed_hubic[AT]yahoo[DOT]com
comment : Thank you Ben! This help me wrap my head around DSP a bit more. It's a shame this site is essentially dead...

from : thewjew[AT]gmail[DOT]com
comment : is this code still available?

from : christian[DOT]schragen[AT]gmail[DOT]com
comment : I'm new in programming. how do I embed this code to my project? vst sdk is already loaded from the steinberg developer site. can somebody give me a step by step guide?

from : jamie[AT]jamiebullock[DOT]com
comment : It loos like the Chunkware code can now be found on GitHub:

from : mike[AT]mikegazzaruso[DOT]com
comment : Hi, may i know the range of values to set in SimpleComp? Expecially those for Threshold and Ratio. I set them to 2 and -30 but my sound get incredibly distorted after that. Thanks.