COCKOS CONFEDERATED FORUMS Cockos : REAPER : NINJAM : Forums Forum Home : Register : FAQ : Members List : Search :

 Cockos Incorporated Forums Gain Reduction Meter Help
 Register Projects Search Today's Posts Mark Forums Read

 04-20-2017, 02:41 PM #1 Tunca Human being with feelings   Join Date: Apr 2016 Posts: 127 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 ConnorLRSS 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 Tunca Human being with feelings   Join Date: Apr 2016 Posts: 127 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 Tunca Human being with feelings   Join Date: Apr 2016 Posts: 127 Any advice?
 05-02-2017, 11:33 AM #5 random_id Human being with feelings     Join Date: May 2012 Location: PA, USA Posts: 306 You are using absolute values for the input, right? __________________ Website: LVC-Audio
05-02-2017, 12:10 PM   #6
Tunca
Human being with feelings

Join Date: Apr 2016
Posts: 127

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 random_id Human being with feelings     Join Date: May 2012 Location: PA, USA Posts: 306 I mean like this; peakL = std::max(peakL , std::abs(*in1)); __________________ Website: LVC-Audio
05-02-2017, 03:30 PM   #8
Tunca
Human being with feelings

Join Date: Apr 2016
Posts: 127

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 ConnorLRSS 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 Tunca Human being with feelings   Join Date: Apr 2016 Posts: 127 Hi, Still need about GR meter. When input level is low,meter not showing reduction correctly.
09-07-2017, 03:27 PM   #11
bozmillar
Human being with feelings

Join Date: Sep 2009
Posts: 566

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.
__________________
http://www.bozdigitallabs.com

09-08-2017, 05:25 AM   #12
Tunca
Human being with feelings

Join Date: Apr 2016
Posts: 127

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?

09-08-2017, 01:37 PM   #13
bozmillar
Human being with feelings

Join Date: Sep 2009
Posts: 566

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.
__________________
http://www.bozdigitallabs.com

09-09-2017, 01:14 AM   #14
Tunca
Human being with feelings

Join Date: Apr 2016
Posts: 127

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 bozmillar Human being with feelings     Join Date: Sep 2009 Posts: 566 Well, it's hard to help without seeing your code. How are you calculating the gain reduction in the compressor algorithm? __________________ http://www.bozdigitallabs.com
 09-10-2017, 12:50 AM #16 Anomaly Human being with feelings     Join Date: Sep 2007 Posts: 634 EDIT: Never mind, read incorrectly what Tunca was asking... __________________ ___________________________ Sonic Anomaly | free JSFX & VST Plugins Last edited by Anomaly; 09-10-2017 at 12:57 AM.
09-10-2017, 02:09 AM   #17
Tunca
Human being with feelings

Join Date: Apr 2016
Posts: 127

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
Anomaly
Human being with feelings

Join Date: Sep 2007
Posts: 634

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..?
__________________
___________________________
Sonic Anomaly | free JSFX & VST Plugins

Last edited by Anomaly; 09-10-2017 at 06:11 AM.

09-10-2017, 01:13 PM   #19
Tunca
Human being with feelings

Join Date: Apr 2016
Posts: 127

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 Tunca Human being with feelings   Join Date: Apr 2016 Posts: 127 I'm really stucked...
09-13-2017, 03:07 PM   #21
bozmillar
Human being with feelings

Join Date: Sep 2009
Posts: 566

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?
__________________
http://www.bozdigitallabs.com

09-14-2017, 12:39 AM   #22
Tunca
Human being with feelings

Join Date: Apr 2016
Posts: 127

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 BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General Discussion     General Discussion (aka spam trap) REAPER Forums     REAPER General Discussion Forum     REAPER OS X Forum     REAPER Color Themes and Icon Sets     REAPER Q&A, Tips, Tricks and Howto     REAPER Compatibility     REAPER Bug Reports     REAPER Feature Requests     REAPER Non-English Speaking User Forums         Forum de REAPER en français         Foro de REAPER en Español         Fórum do REAPER em português         Forum di REAPER in italiano         Deutschsprachiges REAPER Userforum         Pyccкоязычный фopyм REAPER     Dstruct's Casa De Nitpicks     Recording Technologies and Techniques     MIDI and other music/audio protocols     JSFX and ReaScript Discussion     REAPER Music/Collaboration Discussion     newbieland     REAPER Developer Forum     REAPER Pre-Release Discussion     REAPER lounge NINJAM Discussion     User Discussion     NINJAM Developer Discussion Cockos and Friends Software Discussion     WDL users forum     LICEcap Discussion     SnapEase Discussion     OSCII-bot forum     PathSync Discussion     Assniffer Discussion     TunnelVision Discussion     LanMon Discussion     Debris Discussion     Wifight Discussion     The Camel Farm     Stashbox & Shup

All times are GMT -7. The time now is 10:12 AM.

 -- Cockos ---- REAPER 5 ---- Reaper 3 ---- Reaper 2 ---- Reaper 1 Contact Us - Çockos Incorporated - Archive - Top