|
04-20-2017, 02:41 PM
|
#1
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
Gain Reduction Meter Help
I'm tring to use vu meter as gain reduction meter.Used vu meter from MultiTarget example.
As vu meter,it's working good.But not as gr meter.
My gr meter working like this; "in - out".Just simple idea.It's working but if input signal is low level,meter doesn't work properly.
For example when input level around 0 dB with -6 dB reduction,meter shows reduction properly.But when input level around -6 dB with -6 dB reduction,meter shows 2 dB or less reduction.So when input signal low,gr meter not showing correctly...
What is your method?Are you using simple meter example or another one?
I really need help about that.
Thanks.
|
|
|
04-28-2017, 09:15 AM
|
#2
|
Human being with feelings
Join Date: Mar 2017
Location: Halifax, NS, Canada
Posts: 11
|
For my GR meter, I input GR values from each frame into an envelope follower to get the correct rise and fall motion. Then I normalize the value of the envelope and use it to position the needle.
I'm not quite sure what you're trying here. It would really help if you could post some code.
|
|
|
04-29-2017, 02:50 PM
|
#3
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
My meter code like this;
const double METER_ATTACK = 0.6, METER_DECAY = 0.05;
double xL = (peakL < prevL ? METER_DECAY : METER_ATTACK);
double xR = (peakR < prevR ? METER_DECAY : METER_ATTACK);
peakL = peakL * xL + prevL * (1 - xL);
peakR = peakR * xR + prevR * (1 - xR);
prevL = peakL;
prevR = peakR;
peakL = std::max(peakL , *in1 ); (unprocessed)
peakR = std::max(peakR , input ); (processed)
But when input level is low,GR meter show half value.
|
|
|
05-02-2017, 09:56 AM
|
#4
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
Any advice?
|
|
|
05-02-2017, 11:33 AM
|
#5
|
Human being with feelings
Join Date: May 2012
Location: PA, USA
Posts: 356
|
You are using absolute values for the input, right?
|
|
|
05-02-2017, 12:10 PM
|
#6
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
Quote:
Originally Posted by random_id
You are using absolute values for the input, right?
|
Absolute value?
I'm not doing anything with input signal.
|
|
|
05-02-2017, 03:25 PM
|
#7
|
Human being with feelings
Join Date: May 2012
Location: PA, USA
Posts: 356
|
I mean like this;
peakL = std::max(peakL , std::abs(*in1));
|
|
|
05-02-2017, 03:30 PM
|
#8
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
Quote:
Originally Posted by random_id
I mean like this;
peakL = std::max(peakL , std::abs(*in1));
|
Oh.Now tried that but still same.
|
|
|
05-03-2017, 09:10 AM
|
#9
|
Human being with feelings
Join Date: Mar 2017
Location: Halifax, NS, Canada
Posts: 11
|
Sorry for the late response.
Is "*in" the input sample and "input" the gain reduction?
If so, are you taking the absolute value of input as well?
Because if your gain reduction is negative, then your peak value will never descend.
For instance:
input = -6 and peak = 2
prev = peak
prev = 2
peak = max(2, -6)
peak = 2
then...
xL = (peak < prev ? METER_DECAY : METER_ATTACK)
xL = METER_ATTACK
peak = peak * METER_ATTACK + prev * (1 - METER_ATTACK)
peak = 2 * 0.6 + 0.4 * 2
peak = 2
Then this will repeat. Peak will always stay at 2 until the gain reduction goes above 2. Do you see what I mean?
This is my code for a VU meter. I'm not sure if this is conventional but it seems to work.
Code:
double VUEnvelopeFollower::Process (double input)
{
double absInput = fabs(input);
if (absInput > envelope) {
absInput *= (1.0 + overshoot);
envelope = attackCoeff * (envelope - absInput) + absInput;
}
else {
absInput *= (1.0 - overshoot);
envelope = releaseCoeff * (envelope - absInput) + absInput;
}
return envelope;
}
Where:
Code:
#define LOG_POINT_ZERO_ONE -4.60517018599
attackS = 0.3 // Rise time in seconds
releaseS = 0.3 // Fall time in seconds
attackCoeff = exp(LOG_POINT_ZERO_ONE / (attackS * sampleRate));
releaseCoeff = exp(LOG_POINT_ZERO_ONE / (releaseS * sampleRate));
overshoot = 0.0125;
I hope this helps!
Last edited by ConnorLRSS; 05-03-2017 at 04:32 PM.
|
|
|
09-07-2017, 01:12 PM
|
#10
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
Hi,
Still need about GR meter.
When input level is low,meter not showing reduction correctly.
|
|
|
09-07-2017, 03:27 PM
|
#11
|
Human being with feelings
Join Date: Sep 2009
Posts: 623
|
Quote:
Originally Posted by Tunca
Hi,
Still need about GR meter.
When input level is low,meter not showing reduction correctly.
|
It won't show the correct value if you are just subtracting. Gain reduction is a scalar, which means you need to divide, not subtract.
If the gain reduction is 6dB, then the output will be input/2, no matter what the input level is. Of course, this will break when you get to zero.
Why not just use your actual gain reduction value to send to meter instead of trying to recalculate it? I would assume that if you are applying some amount of gain reduction, you have already calculated that gain reduction value. Just convert that value to dB and send it to your meter.
|
|
|
09-08-2017, 05:25 AM
|
#12
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
Quote:
Originally Posted by bozmillar
It won't show the correct value if you are just subtracting. Gain reduction is a scalar, which means you need to divide, not subtract.
If the gain reduction is 6dB, then the output will be input/2, no matter what the input level is. Of course, this will break when you get to zero.
Why not just use your actual gain reduction value to send to meter instead of trying to recalculate it? I would assume that if you are applying some amount of gain reduction, you have already calculated that gain reduction value. Just convert that value to dB and send it to your meter.
|
I can't send gr value to meter.My recfier and gr in .inl file.I can't assign it in my main.cpp.How can i do that?
Can you show the way,please?
|
|
|
09-08-2017, 01:37 PM
|
#13
|
Human being with feelings
Join Date: Sep 2009
Posts: 623
|
Quote:
Originally Posted by Tunca
I can't send gr value to meter.My recfier and gr in .inl file.I can't assign it in my main.cpp.How can i do that?
Can you show the way,please?
|
make your compressor return the gain reduction value so you can apply it to the graphics.
|
|
|
09-09-2017, 01:14 AM
|
#14
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
Quote:
Originally Posted by bozmillar
make your compressor return the gain reduction value so you can apply it to the graphics.
|
How can i do that? Can you tell me,please?
|
|
|
09-09-2017, 01:28 PM
|
#15
|
Human being with feelings
Join Date: Sep 2009
Posts: 623
|
Well, it's hard to help without seeing your code. How are you calculating the gain reduction in the compressor algorithm?
|
|
|
09-10-2017, 12:50 AM
|
#16
|
Human being with feelings
Join Date: Sep 2007
Posts: 642
|
EDIT: Never mind, read incorrectly what Tunca was asking...
Last edited by Anomaly; 09-10-2017 at 12:57 AM.
|
|
|
09-10-2017, 02:09 AM
|
#17
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
Quote:
Originally Posted by bozmillar
Well, it's hard to help without seeing your code. How are you calculating the gain reduction in the compressor algorithm?
|
It's easy.
Transfer function is this;
gr = maxdB * ( ratio - 1 )
My rectifier and gain reduction calculation in another file.I need to call it in main .cpp.I don't know how to call it..
|
|
|
09-10-2017, 06:00 AM
|
#18
|
Human being with feelings
Join Date: Sep 2007
Posts: 642
|
Quote:
Originally Posted by Tunca
It's easy.
Transfer function is this;
gr = maxdB * ( ratio - 1 )
My rectifier and gain reduction calculation in another file.I need to call it in main .cpp.I don't know how to call it..
|
Even if your compressor classes are on different file(s), you still need to call them within your plugin's main class. As soon as you do that, your "external" classes and their public methods/variables are accessible to your main plugin class.
class MyPlugin : public IPlug
{
private:
MyExternalClass *extClass;
}
extClass = new MyExternalClass();
Then: gr = extClass->myGainReductionValue;
But maybe I misunderstood your problem..?
Last edited by Anomaly; 09-10-2017 at 06:11 AM.
|
|
|
09-10-2017, 01:13 PM
|
#19
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
Quote:
Originally Posted by Anomaly
Even if your compressor classes are on different file(s), you still need to call them within your plugin's main class. As soon as you do that, your "external" classes and their public methods/variables are accessible to your main plugin class.
class MyPlugin : public IPlug
{
private:
MyExternalClass *extClass;
}
extClass = new MyExternalClass();
Then: gr = extClass->myGainReductionValue;
But maybe I misunderstood your problem..?
|
I implemented your code to my code...
class OSS : public IPlug
{
private:
__GR_METER_INL__ double gr;
};
double gr = new __GR_METER_INL__
if (GetGUI()) {
GetGUI()->SetControlFromPlug(mMeterIdx_L , gr );
};
But if (GetGUI)) giving me "expected a type" error.
|
|
|
09-12-2017, 05:02 AM
|
#20
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
I'm really stucked...
|
|
|
09-13-2017, 03:07 PM
|
#21
|
Human being with feelings
Join Date: Sep 2009
Posts: 623
|
Quote:
Originally Posted by Tunca
I implemented your code to my code...
class OSS : public IPlug
{
private:
__GR_METER_INL__ double gr;
};
double gr = new __GR_METER_INL__
if (GetGUI()) {
GetGUI()->SetControlFromPlug(mMeterIdx_L , gr );
};
But if (GetGUI)) giving me "expected a type" error.
|
Maybe this is letting my programming ignorance show, but is that proper syntax?
|
|
|
09-14-2017, 12:39 AM
|
#22
|
Human being with feelings
Join Date: Apr 2016
Posts: 264
|
Quote:
Originally Posted by bozmillar
Maybe this is letting my programming ignorance show, but is that proper syntax?
|
Now i can call my gain reduction.I solved that.
But response is really weird...
How do you send your sidechain to meter?
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 11:53 PM.
|