omx.comp~ makes no sense

swieser1's icon

Is it just me, or does omx.comp~ not work right at all? I've been testing the object out using the patch below, and it is not doing what I'd expect it to do. Here's what I'm expecting it to do, let me know if this is unreasonable:

- Create a 1kHz sine wave at -6dBFS (6dB below full scale) and put it into omx.comp~
- Set the compression threshold to -12dBFS
- Set the compression ratio to 3:1
- Expect to see a sine wave come out the output of omx.comp~ at -10dBFS (the signal should only be allowed to get 1dB louder for every 3dB over the threshold, so 6dB over the threshold on input = 2dB over the threshold on output)

I don't get that value, and in addition the output level of the compressor changes when I change the attack and release times? Like, if I let the compressor sit at one value for a few minutes, then the only thing I change is the attack time, the output level will go up or down. How does that make sense? Also, if I make the ratio quite large, it will attenuate the output signal to well below the threshold. With any compressor I've ever used, no matter what the ratio is, the output signal never gets attenuated to below the threshold. If I have an input signal at -3dBFS and a threshold of -12dBFS and a ratio of infinity:1, then I should get an output signal at -12dBFS, not -100dBFS.

Max Patch
Copy patch and select New From Clipboard in Max.

Can anyone explain what's going on? Here's my test patch:

andrea agostini's icon

omx.comp~'s input values are not expressed in dB and linear ratio, there are some conversions to do.

unfortunately this is not explained in the doc page or the help file, but you can find the details in the "tweaking compression" tutorial (in the compression section of the MSP tutorials).

you also have to take care of the "range" parameter. to have an easy-to-predict behaviour I usually keep it very low (-90 dB or so), otherwise you end up with an auto-makeup which makes your actual output level quite erratic.

hope this helps
aa

swieser1's icon

hmm ok i'm having a look at that tutorial and i'll try to decipher the conversions. It is quite confusing though, because in the documentation for the threshold message, it specifically says: "The word agcThreshold, followed by a number, sets the compressor threshold (in dB below full scale)." This is clearly not true.

I think that tutorial will help, although I still don't think it explains why changing the attack and release times changes the output level of an otherwise stable signal. And it's not just that I had it set to a very slow attack time and then ramped it up and saw the compressor actually kick in... I can take the attack time up and down, up and down, multiple times, and the output level goes up and down with it. Makes absolutely no sense. Is there a better compressor object out there?

swieser1's icon

Ok, well now I've gotten the threshold and ratio to work correctly by converting the "arbitrary" numbers into real world dBFS values, thanks for the tip. The other trick is to leave the "range" parameter as low as possible. I can't imagine ever having a use for such a feature. Kind of an inverse expander or something.

Are there similar formulas for converting the "arbitrary" attack/release times into milliseconds? I'm still having trouble figuring out why changing the attack and release times changes the output level from the compressor.

Macciza's icon

There are also the various 'kompressors' in Max5> examples > effects . . .
Also vcomp~ or audiounits may be an option . . .
Cheers