a compressor
  • Hey everyone!

    Recently I had a lot of time to fiddle with this app, and I came back to my original compressor that I had made a while back. Something that had bothered me about it was that the attack and release times were linked, so I made a new one from scratch.

    Compressors are not exactly simple, but they're not terribly complex either. This compressor sidechain looks like this: [level detector] - [gain computer] - [ballistics] - [Gain stage].

    [Level Detector] - basically abs(x) peak detection. The ballistics will smooth out the response.
    [Gain Computer] - calculates the value past the threshold based on ratio (and knee)
    [Ballistics] - Attack and Release times.
    [Gain Stage] - Adding the gain reduction to the original signal with a makeup gain.

    Here is a great slideshow of all this info that i based this compressor off of:
    http://c4dm.eecs.qmul.ac.uk/audioengineering/compressors/documents/Reiss-Tutorialondynamicrangecompression.pdf
    (Caution - I think some of those equations are wrong for Audulus...)


    One thing I've been trying to figure out is what settings specific compressors have. A sneaky part about a lot of compressors is the sidechain eq filter. Compressors will EQ before the Level Detector to alter the way the compressor reacts to high and low frequencies. I've built one in to roll off lows and boost highs. This gives the compressor a "fat" sound, I guess...

    Another thing is attack/release times for specific models of compressors. A lot of famous compressors (1176,LA-2A) actually have program dependent times. I'm not sure if this is the intrinsic nature of their analog components, or if they're built that way specifically, but that's the next step on this compressor journey.


    I've added a CV OUT which is the gain reduction value. This would be a cool way to modulate signals, and not just the dynamics of the audio. Maybe a LPF or something. I don't know. You guys are smarter than me.

    ANYWAYS - here it is.
    Gravity mkII.audulus
    246K
  • Very nice dsp! It's good to add another @SteveX module to the collection. I still bust out the time dilator on occasion.

    @stschoen posted that very slide show awhile back! I had been meaning to explore it more fully, but I had been getting OK results with my derp simple compressor which just calculates a threshold and then slews the output into an attenuator at a given ratio. But the built-in sidechaining is very interesting and the independant attack/release will definitely come in handy.

    It should be easy enough to add an eq filter before the signal goes into the compressor with the biquad, HPF, or LPF nodes, shouldn't it?

    I was wondering if there was some way to extrapolate an envelope follower from your patch. I find the one that comes with audulus often outputs an audio rate signal, which makes patching with it awkward.

    Anyways, thanks again for another interesting and useful patch :)

    edit: looks like @stschoen posted another interesting document on dynamic compressors you might find interesting if you haven't seen it already:https://www.researchgate.net/publication/277772168_Digital_Dynamic_Range_Compressor_Design-A_Tutorial_and_Analysis
  • I just posted a link to the paper that the author of the slideshow wrote. It's ironic but I just finished version one of a compressor today based on the same material. I noticed that @SteveX used the smoothed branching peak detector where I chose the smoothed decoupled version.
  • @RobertSyrett Thank you! I saw you guys talking about compressors after I had started work on this, so I’m glad to be a part of it!

    The filter is in there with the low shelf and high shelf, I just don’t know what is the best way to set it.

    What is the purpose of the envelope filter you’re looking for? I’m sure that a -inf threshold and low ratio will get you somewhere in the ballpark. Of course the output needs to go through an (1-x) expression.

    @stschoen I was trying to avoid the attack and release times reacting with each other, which is why I went went the branching style. I’d like to see your compressor!
  • @SteveX, I posted it in a separate thread. I've had a look at yours and there are a lot of similarities, which isn't surprising. Nice work! If you haven't checked out the paper @RobertSyrett mentioned, it's worth reading. It's by the author of the slide show and fills in some of the details. The envelope filter was in reference to the additive harmonic oscillator I posted. I was looking for a way to keep the output relatively constant. I have a crude limiter which keeps it from clipping, but waveforms that have significant destructive interference between the harmonics like a square wave are lower in output than I like. That kind of started the discussion about compressors, although I guess in this case I would actually need an expander :)