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 Topic RSS sp_TopicIcon
14.1 TremoloPanner fMonoIn
Avatar
stonerichnau@gmail.com
New Member
Members
January 4, 2016 - 12:32 pm
Member Since: January 4, 2016
Forum Posts: 1
sp_UserOfflineSmall Offline

Hi

What is the meaning of fMonoIn variable? It doesn't seem to get used to produce output.

stone

Avatar
W Pirkle
Admin
January 4, 2016 - 8:18 pm
Member Since: January 29, 2017
Forum Posts: 573
sp_UserOfflineSmall Offline

Hi Stone

Thanks for catching this! The Panner code, as it stands, is actually modulating the "Balance" when the input is a stereo signal - on a stereo input a pan control really is a balance control. The original plugin summed the inputs together when the input is stereo, then pans that signal. Some prefer modulating the balance as it preserves the stereo signal. But the book example is supposed to be a true panner. The corrected code is here:

// branch
if(m_uMode == Tremolo)
{
fGnL = calculateGainFactor(fYn);

// do MONO (Left) channel
pOutputBuffer[0] = pInputBuffer[0]*fGnL;
}
else // panner sums inputs
{
if(uNumInputChannels == 1)
fMonoIn = pInputBuffer[0];
else
fMonoIn = 0.5*(pInputBuffer[0] + pInputBuffer[1]);

calculatePannerGainFactor(fYn, &fGnL, &fGnR);

// do MONO (Left) channel
pOutputBuffer[0] = fMonoIn*fGnL;
}

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

// Stereo-In, Stereo-Out (INSERT Effect)
if(uNumInputChannels == 2 && uNumOutputChannels == 2)
{
// branch
if(m_uMode == Tremolo)
{
// do right channel, use same gain as left
pOutputBuffer[1] = pInputBuffer[1]*fGnL;
}
else
{
// do right channel, its value
pOutputBuffer[1] = fMonoIn*fGnR;
}
}

Thanks again!

Will

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 51

Skyler: 48

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

clau_ste: 39

jim: 34

JimmyM: 33

Gwen: 32

Member Stats:

Guest Posters: 1

Members: 696

Moderators: 1

Admins: 5

Forum Stats:

Groups: 13

Forums: 41

Topics: 757

Posts: 2894

Newest Members:

Jas, Rowan, sojourn, fabhenr, rg1, Niklas, Wutru, Tim Campbell, Danny Jonel, Valentin

Moderators: W Pirkle: 573

Administrators: Tom: 74, JD Young: 80, Will Pirkle: 0, W Pirkle: 573, VariableCook: 3