Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Dynamic EQ
No permission to create posts
September 5, 2017
3:47 am
Avatar
Stefan
Member
Members
Forum Posts: 3
Member Since:
September 5, 2017
sp_UserOfflineSmall Offline

Hello, guys!

Smile

I'm new here. It's my first post, so take me easy. 

I try to implement a dynamic equalizer. I have the equalizer and the compressor/expander implemented already, but I can't find a way to take the output of the dynamic processor and multiply it with the gain knob from a band of the equalizer.

In my mind, and from what I read in other places, the signal provided by the dynamic processor in the side-chain path must be multiplied with the gain knob from a band of the equalizer you choose in the parametric equalizer. 

I mention that I used this block diagram for implementing: 

Image Enlarger

I don't know if this is the only way you can implement a dynamic equalizer, but I'm open to suggestions.

September 5, 2017
8:59 am
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

I'm new here. It's my first post, so take me easy. 

LOL - this is usually a pretty mellow Forum so don't worry about that! I try to keep it the opposite of those other message boards and forums out there (you know which ones...), unless someone is really abusing the Forum. 

If you are using my FX book, you will see that the output of my gain computer is always between 0 (full gain-reduction = off) and 1.0 (no gain-reduction = on) because the compressor and downward-expander implement gain reduction algorithms. You will need to use this unipolar value to modulate the gain control of your EQ so you will need to decide whether your modulation is one-sided (boost or cut only) or two-sided (boost and cut). Then, you will need to map the unipolar value to a boost/cut value for the EQ using the same kind of modulation code as the flanger (unipolar) or the chorus (bipolar). So it isn't really a multiplication, but rather a mapping of values. You can find examples of that in the FX book chapter on flanger/chorus.

The equation for a bipolar mapping can be found here, and can be modified to work as a unipolar version pretty easily:

http://www.willpirkle.com/foru.....structure/

Hope that helps - 

Will

September 6, 2017
5:18 am
Avatar
Stefan
Member
Members
Forum Posts: 3
Member Since:
September 5, 2017
sp_UserOfflineSmall Offline

I love the book. It combines the mathematical principles with the implementation of the code and makes it easy to understand.

Anyway, about the dynamic EQ, I'm not sure I understand exactly what you said, so correct me if I am wrong.

In order to create the dynamic EQ (or in other words to make the Gain value of a band to oscillate) I need to use the signal provided by the compressor, instead of LFO signal and feed the delay line of the flanger effect (Fig. 10.3a). But I can't understand why I need the delay line and I can't see a way to use the code that describes the flanger functionality for my dynamic EQ.

Also, I read the chapter with the modulated filter effects and I was thinking if I could modulate the gain instead of the cutoff frequency using the same code presented there.

My head is a mess right now, so please explain me in the simplest way you can. I mean I know how a dynamic EQ works, I know the block diagram and the signal flow. In this case, what I can't understand is how I make use of the code from the book.

 

Thank you very much! 

September 6, 2017
12:59 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Yeah, I usually assign a class project for a dynamic filter in my Plugins class (using the FX book). Last year, I assigned a high-frequency enhancer that modulated the gain of a high-shelf filter; there was also a parametric EQ in the sidechain. Let me see if I can dig that project up. 

September 7, 2017
8:27 am
Avatar
Stefan
Member
Members
Forum Posts: 3
Member Since:
September 5, 2017
sp_UserOfflineSmall Offline

I think I made it. I don't know exactly how can I measure if it works. I mean, I hear some differences in the audio signal but I don't know if the differences are the right ones. 

I list the code, so you can take a look and tell me if I'm wrong somewhere. I took the EnvelopeFollower.prj and I made some changes. Now, the filter is a peak filter with constant Q and the values from the envelope detector are inserted in the function to change the gain values.

//CODE//

// set our Min and Max Modulation points
m_fMinGainR = -20.0;
m_fMaxGainR = 0.0;

float CEnvelopeFollower::calculateGainReduction(float fEnvelopeSample)
{
// modulate from min upwards
if (m_uDirection == UP)
return fEnvelopeSample*(m_fMaxGainR - m_fMinGainR) + m_fMinGainR;
else

// modulate from max downwards
return m_fMaxGainR - fEnvelopeSample*(m_fMaxGainR - m_fMinGainR);

return m_fMinGainR;
}

//Calculate Left Peak Filter Constant Q
void CEnvelopeFollower::calculate_LeftConstantQ(float fCutoff, float fQ, float fGain)
{

//m_fGain - slider value 
float K = tan((pi*fCutoff) / (float)m_nSampleRate);

float V0 = pow(10.0, (m_fGain) / 20.0);

V0 *= pow(10.0, fGain / 20.0);

float d0 = 1 + K / fQ + K*K;
float e0 = 1 + K / (fQ*V0) + K*K;

float fAlpha = 1 + (V0*K) / fQ + K*K;
float fBeta = 2 * (K - 1)*(K + 1);
float fGamma = 1 - (V0*K) / fQ + K*K;
float fDelta = 1 - K / fQ + K*K;
float fEta = 1 - K / (V0*fQ) + K*K;

if (m_fGain > 0)
{<calculate coefficients>}
else
{<calculate coefficients>}
}

//Calculate Right Peak Filter Constant Q
void CEnvelopeFollower::calculate_RightConstantQ(float fCutoff, float fQ, float fGain)
{

//m_fGain - slider value 
float K = tan((pi*fCutoff) / (float)m_nSampleRate);

float V0 = pow(10.0, (m_fGain) / 20.0);

V0 *= pow(10.0, fGain / 20.0);

float d0 = 1 + K / fQ + K*K;
float e0 = 1 + K / (fQ*V0) + K*K;

float fAlpha = 1 + (V0*K) / fQ + K*K;
float fBeta = 2 * (K - 1)*(K + 1);
float fGamma = 1 - (V0*K) / fQ + K*K;
float fDelta = 1 - K / fQ + K*K;
float fEta = 1 - K / (V0*fQ) + K*K;

if (m_fGain > 0)
{<calculate coefficients>}
else
{<calculate coefficients>}
}

//PROCESS AUDIO FRAME//

bool __stdcall CEnvelopeFollower::processAudioFrame(float* pInputBuffer, float* pOutputBuffer, UINT uNumInputChannels, UINT uNumOutputChannels)
{
smoothParameterValues();

// Do LEFT (MONO) Channel; there is always at least one input, one output
float fGain = pow(10, m_fPreGain_dB/20.0);
float fDetectLeft = m_LeftDetector.detect(fGain*pInputBuffer[0]);

// set mod gain to minimum (un-triggered)
float fModGainLeft = m_fMinGainR;

// threshold triggered - the threshold is in dB values
if (fDetectLeft >= pow(10.0, m_fThreshold / 20.0))
fModGainLeft = calculateGainReduction(fDetectLeft);

m_fGRL = 1.0 - pow(10.0, fModGainLeft / 20.0);

// use the mod gain 
calculate_LeftConstantQ(m_fCutoff, m_fQ, fModGainLeft);

// do the BiQuads
pOutputBuffer[0] = m_LeftConstantQ.doBiQuad(pInputBuffer[0]);

// detect the other channel
float fDetectRight = m_RightDetector.detect(fGain*pInputBuffer[1]);

// set mod gain to minimum (un-triggered)
float fModGainRight = m_fMinGainR;

// threshold triggered - the threshold is in dB values
if(fDetectLeft >= pow(10.0, m_fThreshold / 20.0))
fModGainRight = calculateGainReduction(fDetectRight);

m_fGRR = 1.0 - pow(10.0, fModGainRight / 20.0);

// use the mod gain 
calculate_RightConstantQ(m_fCutoff, m_fQ, fModGainRight);

// Mono-In, Stereo-Out (AUX Effect)
if(uNumInputChannels == 1 && uNumOutputChannels == 2)
pOutputBuffer[1] = pOutputBuffer [0];

// Stereo-In, Stereo-Out (INSERT Effect)
if(uNumInputChannels == 2 && uNumOutputChannels == 2)
pOutputBuffer[1] = m_RightConstantQ.doBiQuad(pInputBuffer[1]);
}
return true;

}

///////////////////////////////////////////////////////////////////////////

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 476

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 482

Posts: 1876

Newest Members:

sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143