Why does my compressor sound THAT bad???

Official support for: sonicbirth.sourceforge.net
Post Reply New Topic
RELATED
PRODUCTS

Post

Hey there!

I'm currently building some sort of cheap compressor.
The problem is, that it sounds pretty bad :(

I think it's because of the comparator. If I pass the signal directly through the compression circuit it sounds ok.
So if anyone knows a workaround please help! (Already tried change slower...)


Image

This is what I got so far...
I used the Equation to have only values between 0 and 1 ;)

Post

I couldn't immediately see what might be going on. I'll take a closer look later. But in the mean time, here is a link to a compressor plug I made a year and a half ago in SB. The SB file, the exported AU and some notes are included in the zip file.

It's much too complicated to be a single plug and would be better as four or five separate compressor plugs but I was trying to get everything in one place to start.

It's a CPU hog but definitely sounded very good and was capable of all sorts of different colours.

I remember spending a lot of time trying to figure out how to get it to sound like a real compressor and using little tricks to avoid denominators ever equaling zero among other things.

If you can sort through all the extra crap I put in the plug the basic way the compression is applied is common to all the models and might help.

Link here: http://www.mediafire.com/?8haizwtjywy

Post

Thanks a lot dscro ... After some hours of work :hihi: I could isolate the circuits that do the compression.
I took a slightly wrong approach to that compression thing.
By the way, your compressor is a very cool thing. But as you already mentioned it's somehow overdone. It offers too much options ;) Well, 3-4 plugs would have been better.

But now I could figure out how it works. I tried to create some sort of mastering plugin...
Sounds pretty good to a certain point. My only problem now is the limiter section.
It doesn't seem to work like it should.

When I tested the plug in GarageBand the limiter actually didn't limit the signal. I used the circuit provided in one of the plugins that come with sonicbirth.

When I set the threshold to -0.1dB the meters in GB indicate that the signal is too loud.
In theory the plugin should work. So if anyone has a solution for that problem or could point me into the right direction...

Post

I didn't decompose the entire circuit so, sorry if I'm off --

It seems the approach (i0+1)/2 is going to cause problems for *somebody*. The input equation in the circuit assumes the levels are always below 0dBFS - when they exceed 0dB (that is, they clip on a level meter placed directly before they enter this circuit), audible errors will occur. Signals exceeding 0dBFS are common.

Example: a constant signal (say a sinusoid) modulating at +/-6dB will return the results for the equation given the min and max values:

Max (or pos maximum): (2+1)/2 = 1.5
Min (or neg maximum): (-2+1)/2 = -0.5 (<-- problem

Continuing the path of the signal, and assuming the compression level always outputs a value in the range of 0...1 (silence and no effect, respectively). If we take a value of .5 for the compression amount/effect:

Max = .75
Min = -.25 (<-- problem

The inverse equation at output ((i0*2)-1) results in:

Max: .5
Min: -1.0625 (<-- problem

If you plug a scope into this, you will probably see this *warp* when the signals extends below -1. Or maybe the signal is limited before it enter this circuit so it is not an issue...

J

Post

Thx eigentone.
I noticed that problem when I tried to create the limiter section from scratch.
The prebuilt one is nice but with all those lookaheads en envfollowers it uses lots of cpu power.
So I created my own. It lacks a soft knee but thats no problem.

But to get good results I devided the signal in positive and negative values with min, max.
Works great and makes debugging easier...

I'm currently thinking about using that in the compressor cricuit.
Are angels poultry???

Post

Great. Just remember to keep test oscillators and scopes/frequency analyzers within reach as you work - they help debugging tremendously (at least, they have helped me).

J

Post

I have a custom envelope follower that works well and is decent on CPU. It allows for separate attack and release settings too. It's built from wave rectifiers and a low pass filter. Let me know if you want it.

Post

dscro wrote:I have a custom envelope follower that works well and is decent on CPU. It allows for separate attack and release settings too. It's built from wave rectifiers and a low pass filter. Let me know if you want it.
Sounds great! Could I have a look???
It's always useful to see how other people do things ;)
Are angels poultry???

Post

Here is a link to the enveloper.

http://www.mediafire.com/?t4xwpdgmezx

I works like this.

I included a sine wave generator so you can see how a simple waveform is affected by varying the attack and release sliders. I didn't hook up the audio input to the circuit.

A direction module decides whether the audio waveform is increasing (positive slope) or decreasing (negative slope). A separate low pass filter is applied to the increasing portion of the waveform and to the decreasing portion. The cutoff frequency of the filters then act as attack and release controls.

Lowering the cutoff effectively raises the attack or release time. So you can configure a separate slider to do this in the traditional way. Just figure out the algebra so that when the attack time is raised, the cutoff freq. decreases from 500Hz to 20Hz. I don't know how to calibrate it in msec like traditional compressors would have. Maybe look at the oscilloscope display and do it visually since you know the width of the window in time and/or the frequency of the sine wave you put into it.

The The modified rising and falling portions of the waveform are later rejoined and a fixed freq. low pass filter is used to smooth the joining.

A particularly nice thing would be if you could use a DC blocker filter after the low pass. But I tried it and the DC filter in SB made the thing unusable.

Anyway, it works no better than the stock SB enveloper but it was interesting to see if I could make one from scratch, since I was thinking about coding a native compressor plug from scratch as an audio unit using C++ code.


Keep in mind that a simple RMS enveloper without attack and release controls is easy to make and can sound really good in a compressor. Just square the waveform, low pass filter and then take the square root. Square root functions behaved weird for me in SB so I found it better to use 1.4*ln(x) where x is the squared waveform. It amounts to the same thing. You have to add a constant before taking the log to avoid negative values since ln(.99) <0

So what I did is after squaring the waveform, I added 1.1 and then too 1.4*ln of that. I left the low pass frequency as a slider to be the general "speed" control of the compressor. I liked the sound of my compressor better with this kind of enveloper than with the stock SB one or with the one that I'm sending you.

Post

Just read this post about envelopers, and wanted to pass on that chaining two or more envelope followers works well for smoothing them out. I've made several compressor type plugs doing that. They tend to be a little processor heavy, but oh, well. Just use your attack and release sliders as the input to two or three envelope functions, then feed the output from the first into the second, etc. Run it through a scope to see how it smoothes it out considerably.

Generally, running audio through a comparator will sound bad, but running a parallel signal, then multiplying it by your comparator's output will often solve it. Not sure if that's clear, but basically you want to do it like a real hardware compressor. You split the signal, using one side for analysis, then use the output of that side as the input to an amplifier (multiplication,) which is the only function that your audio signal goes through before going to the output.
Image

Post Reply

Return to “SonicBirth”