New: Compressor plugin

Discussion in 'Effects and the DSP' started by Russ, Mar 13, 2007.

  1. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I am not sure what has become of eYagos, and I found myself in need of a lightweight compressor in 3538m (the APS Compressor does not seem (to me) to work quite right), so I took the APS Compressor and modified it in such a way that it works more like I expect it to. It used the same GUI, but I changed the way the parameters are calculated (in part because I do not understand the calculations that the APS Compressor uses (i.e. they look to be reverse engineered using a debugger rather than using some common formula)), and I modified the microcode in such a way that makes more sense to me (in order for it to work the way I expect it to, etc). In any case, I thought I would share it. You can download the plugin from here.

    -Russ
     
    Last edited: Nov 9, 2009
  2. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Since different compressors work a little differently, (and without knowing how a particulair compressor works makes it difficult to use) I thought I should add some basic info as to how this one works.

    For the most part, this compressor does not apply any gain to signal levels below the threshold, with the exception of the output gain. Also, you should think of the output gain as being seperate from the compressor (i.e. it is like a GainHQ connected to the output of the compressor), such that it applies a constant gain to the output.

    With the above in mind, the controls work as follows:

    Attack: This determines how fast the compressor turns on (i.e. how fast it responds to in increase in level).

    Release: This determines how fast the compressor turns off (i.e. how fast it responds to a decrease in level).

    The above may sound simple enough, but the effects of different attack/release times are hard to explain, so rather than trying to fully explain it, I would suggest looking up that info on the internet, where you should be able to find a better explanation than what I can offer.

    Output Gain: This determines the amount of gain that is applied to the output of the compressor.
    [ a suggestion for (the starting value) setting Output Gain = (1/Ratio * abs(Threshold) - abs(Threshold)) /2 (you might want more gain with faster attack times) ]

    Threshold: This determines the level at which the compressor starts compressing. i.e. Signal levels above this level are compressed (reduced) by an amount determined by the Ratio setting.

    Ratio: This determines how the signal is compressed when it goes above the Threshold level. The setting is the amount the level must go above the Threshold level, in order to increase in gain by 1 dB. i.e. With a Ratio setting of 2, the level (out of the compressor) goes up by 1 dB, for every 2 dB that the signal level is over threshold. So if the level is 10 dB over the Threshold value, it is reduced in gain by 5 dB (thus it is 5 dB above the threshold value).

    PreDelay: This determines how much the input is delayed and can be used to help offset the attack delays.

    Here are some graphs (input -vs- output) to help show the effect of different Ratio settings, and how Output Gain is applied (with a input level ranging from -60 dB to +12 dB). BTW: The graphs depict an Attack setting of 0 (must be 0 for hard limiting).

    Threshold -20 dB, Ratio 2:1
    Threshold -20 dB, Ratio 5:1
    Threshold -20 dB, Ratio 100:1

    BTW: It should be noted that the slopes do not continue to rise past the end (top and right sides) of the graphs (i.e. +12 dB is the max possible input value, anything above that is clipped/saturates (so the lines end (max values) where they would end in the DSP)).

    Again, this is modeled after how I think the APS Compressor is supposed to work, and offers no extra functionality beyond that.

    -Russ
     
    Last edited: Feb 18, 2011
  3. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I see that some people still use the APS Compressor, and it seems that they are unaware of the issues with it, so I am curious as to how people are determining what settings to use. For this reason I thought I would list some of the issues that I noticed (some of them are due to the fact that it was not written specifically for kX), and how it differs from this version:

    APS Compressor:
    It should be used with a x4 plugin before it's inputs, and a div4 plugin at the output (in all of the DSP screenshots that I have seen (that I can recall anyway) that include the APS Compressor, the x4/div4 plugins are not included (so again, I wonder how people determine what settings to use)).

    It has 2 GPRs that serve no purpose at all with kX.

    An attack setting of 0, is not really 0, which makes it impossible to use for full limiting.

    The level detection uses an average of the Left/Right inputs, which can throw off the level detection if there is a big difference between the levels of the 2 inputs (also makes it hard to use as a limiter).
    This version:
    No need for x4/div4 plugins (this saves 4 GPRs).

    The unused GPR's (as well as a couple of temps) were removed, so it uses 4 less GPRs.

    An Attack setting of 0 is 0 (again, necessary for full limiting).

    The level detection uses which ever input is greater, instead of the average of both (again, works better this way when used as a limiter).
    Other than the above, they should be very similair.

    i.e.
    Screenshot (using default settings)

    -Russ
     
    Last edited: Mar 25, 2007
  4. Doug W

    Doug W Active Member

    Joined:
    Mar 7, 2003
    Messages:
    975
    Likes Received:
    1
    Trophy Points:
    28
    I did not know about the X4 and div4 required before and after the APS compressor. I will have to reinstall 3538m on my other computer and give your compressor a run.

    Thanks
     
  5. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
    >>An Attack setting of 0 is 0 (again, necessary for full limiting).
    I haven't treid your compressor but I'm curious/puzzled about the above statement.

    If attack is truly 0 (as in 0 msec) and ratio set high, then you will get hard clipping(distortion) instead of limiting.
    Limiting (in compressor context) is; output signal does not exeed threshold but without clipping/distortion

    Just some thoughts.
     
  6. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Thats my point, it seems many people do not realize this, which makes me wonder how they adjust the settings, and how the judge whether it is working the way they want it to, etc.

    In any case, I noticed that I can get rid of 2 instructions, and I am considering adding a mono version, so I will probably add an update when I have the chance.
     
  7. JGSF

    JGSF New Member

    Joined:
    Jul 13, 2004
    Messages:
    454
    Likes Received:
    1
    Trophy Points:
    0
    A mono version would be great! :D
     
  8. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    But I see no possible way for the signal to never exceed the threshold without an attack setting of true 0 (with any non-zero setting some samples get by before the compressor 'turns on', and as such are not compressed).

    i.e.
    Try this with the APS Compressor (do not forget x4/div4 plugins).
    Attack: 0.
    Threshold: -36.
    Ratio: 100.

    Feed it a signal of 0 dB from the Wave Generator (same signal to both inputs).

    Mute/unmute the WaveGen plugin a few times to simulate quick changes in level and you will see spikes that reach to approx. -12.1 dB, which is 23.9 dB over the threshold.

    The above is not an unrealistic situation.

    i.e.
    I use it often as a compressor and full limiter for late night TV watching (connected to Line In), and without an attack of true 0, I would get quick loud bursts that were unacceptable to me. There may be some distortion, but I really have not noticed noticed anything with my TV tests (but I do not have exactly high quality speakers). Additionally, no-one has to use an attack setting of zero.

    In any case, thanks for the feedback, it is always appreciated.

    -Russ
     
  9. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
    Yes ofcourse, this is known as 'overshoot'.
    The better compressors designs compensate for this.
    (i.e; use a feedforward topology with lookahead)

    Anyway, attack 0 produces distortion and is as such (in most cases) undesirable/useless.
    Sure, the release will prevent some of the distortion, but not all.
    Usualy there's this crispy little fuzz tone superposed onto the signal if attack is truly 0.

    EDIT:
    Also note that minimum Attack time is quite dependant on Low Freq. content.
    Much LF content needs longer attack time.

    EDIT2:
    Lol, yes I guess in your example with that TV signal it doesnt matter
    if signal distorts a bit.
    On the other hand, I can't believe that a simple feedforward compressor
    with ~2msec attack time produces peaks that makes you 'jump out of your chair' :)
     
    Last edited: Mar 25, 2007
  10. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Yes, I understand that (actually I have read an article from the Dolby website about Dolby Noise Reduction, which gives some good details about such things), but again, for late night TV watching, for me, keeping the vocals at an audible volume, while preventing *any* volume spikes is more important, and again, people can use whatever setting they want to.

    Hehe, it is more that I do not want to wake other people up :)

    <edit>
    BTW: The other thing is that I use the output_gain to boost the lower end, and it also boosts the spikes (making them even louder).
    </edit>
     
    Last edited: Mar 25, 2007
  11. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I updated the plugin and added the mono version (will show as Compressor (m) on the plugin list).

    -Russ
     
  12. JGSF

    JGSF New Member

    Joined:
    Jul 13, 2004
    Messages:
    454
    Likes Received:
    1
    Trophy Points:
    0
  13. JGSF

    JGSF New Member

    Joined:
    Jul 13, 2004
    Messages:
    454
    Likes Received:
    1
    Trophy Points:
    0
    edit: nevermind, it was the release time that was set too low... Working great. Thanks, Russ! ;)
     
    Last edited: Mar 30, 2007
  14. guyinco6nito

    guyinco6nito New Member

    Joined:
    Apr 11, 2007
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    I believe I might be noticing a bug in the stereo version of this compresser.

    I'm using a SB0610 10k2 card with kX project 3538m.
    Using the ProFX plugins, I've connected some music piping through Winamp through the APS Compresser+ as well as the Compressor from this thread.

    I've connected oscilliscopes to the outputs of each compresser and I'm noticing something strange.

    The output of the Compressor from this thread randomly jumps up all the way to the top of the oscilliscope. The APS Compressor+ does not do this. When I hook up the output of this compressor to some speakers, they sound quite well, so this might just be a bug with oscilliscoping the compressed output?

    Does anyone else notice this?

    Thanks!
    -guyinco6nito
     
  15. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Did you use the 'x4' and 'div4' plugins with APS Compressor when you were testing?
     
  16. guyinco6nito

    guyinco6nito New Member

    Joined:
    Apr 11, 2007
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    No, I did not use them.

    I had figured if someone was going to make a plugin, they would include everything that plugin needs. How wrong I was. :)

    I'll read though this thread and make sure I'm using the plugins correctly, and see if I can't emulate the wierd spikes I'm noticing when using the APS compressor properly.

    Thanks!
    -guyinco6nito
     
  17. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    In most cases they do, but some of the plugins were ported from the APS Drivers or the Creative drivers without being optimized for kX.
     
  18. canjian

    canjian New Member

    Joined:
    Feb 15, 2014
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    hello!
    Can you update
    Under the kx3552 does not work
     
  19. Hugo Santos

    Hugo Santos Member

    Joined:
    Mar 13, 2014
    Messages:
    39
    Likes Received:
    1
    Trophy Points:
    8
    Yeah, Russ, if you're still around it would be really nice to have an update. I can get you a paypal donation.
     

Share This Page

visited