Login / Register  0 items | $0.00 NewWhat is KVR? Submit News Advertise
390 posts since 26 Mar, 2015

Postby tunca; Wed Sep 13, 2017 8:59 am Re: Calling variable from inl to cpp (WDL-OL)

stratum wrote:
But my gain reduction working really weird.Meter shows reduction with no reduction.

It can't show exact values while compressing...

Looks like a design problem only you can know.

I'd try to measure the input level average and the output level average and show the difference in between in decibels, but that would be my design, and I don't know what might be wrong with yours.

What if i subtract output from input?

I'm trying to do that but with low input levels,meter not showing correct values.Only shows correct values after -3dB.

I'm trying to normalize input which i want to send meter.

Any method for normalize?

Code: Select all

Not working for me...
http://analogobsession.com/ VST,AU for WIN & MAC
1262 posts since 29 May, 2012

Postby stratum; Wed Sep 13, 2017 9:57 am Re: Calling variable from inl to cpp (WDL-OL)

The last time that I had made an audio compressor (a few years ago, never released as a plugin and wasn't a plugin) the level detection algorithm was based on the fact that unlike float point arithmetic running integer summation is exact. i.e. assume that you want to know the summation of the last 100 samples. To do so, for each iteration I had added the absolute value of the current sample and subtracted the absolute value of [t-100]'th sample. If you divide that number with length(100), you'll have a voltage average of the last 100 samples. Alternatively you can square sample values and have an energy average (power estimate). This wasn't made to make a GR meter because I didn't have any meters or any fancy GUI. It was used as an input to determine the current gain level to achieve the necessary compression ratio, but it should be possible to use the same algorithm to make a GR meter. Just measure both input and output using the same method and the gain reduction is the ratio between them converted to decibels. You'll need to convert floats to integers and make sure that the conversion (and running summation) does not overflow integer value range or lose too much precision.

Not that I'm an expert of the subject matter anyway but just an idea you could try..

p.s. you don't need to delay audio by 100 samples just to do this :wink:
p.s2. you can try very large summation window lengths if you want, because all will run in O(1) time anyway.

Alternatively you can rectify both input and output and lowpass filter the results and take the ratio between these two, that is the same idea with floating point arithmetic.

Moderator: Moderators (Main)

Return to DSP and Plug-in Development

Who is online

Users browsing this forum: cyberheater