Add a config option to boost reverb output

This commit is contained in:
Chris Robinson 2011-07-20 22:26:16 -07:00
parent b889823b21
commit 1e8a379a03
4 changed files with 26 additions and 1 deletions

View File

@ -564,6 +564,9 @@ static void alc_initconfig(void)
if(DefaultResampler >= RESAMPLER_MAX || DefaultResampler <= RESAMPLER_MIN)
DefaultResampler = RESAMPLER_DEFAULT;
ReverbBoost *= aluPow(10.0f, GetConfigValueFloat("reverb", "boost", 0.0f) /
20.0f);
devs = GetConfigValue(NULL, "drivers", "");
if(devs[0])
{

View File

@ -135,6 +135,11 @@ typedef struct ALverbState {
ALfloat *Gain;
} ALverbState;
/* This is a user config option for modifying the overall output of the reverb
* effect.
*/
ALfloat ReverbBoost = 1.0f;
/* This coefficient is used to define the maximum frequency range controlled
* by the modulation depth. The current value of 0.1 will allow it to swing
* from 0.9x to 1.1x. This value must be below 1. At 1 it will cause the
@ -602,6 +607,8 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection
ALuint index;
ALint pos;
Gain *= ReverbBoost;
// Attenuate non-directional reverb according to the number of channels
ambientGain = aluSqrt(2.0f/Device->NumChan);
@ -1106,7 +1113,8 @@ static ALvoid VerbUpdate(ALeffectState *effect, ALCcontext *Context, const ALeff
// Update channel gains
gain = Slot->Gain;
gain *= aluSqrt(2.0/Device->NumChan);
gain *= aluSqrt(2.0f/Device->NumChan);
gain *= ReverbBoost;
for(index = 0;index < MAXCHANNELS;index++)
State->Gain[index] = 0.0f;
for(index = 0;index < Device->NumChan;index++)

View File

@ -18,6 +18,8 @@ enum {
};
extern ALboolean DisabledEffects[MAX_EFFECTS];
extern ALfloat ReverbBoost;
typedef struct ALeffect
{
// Effect type (AL_EFFECT_NULL, ...)

View File

@ -150,6 +150,18 @@
#layout_61CHN = fl=-30, fr=30, fc=0, sl=-90, sr=90, bc=180
#layout_71CHN = fl=-30, fr=30, fc=0, sl=-90, sr=90, bl=-150, br=150
##
## Reverb effect stuff (includes EAX reverb)
##
[reverb]
## boost:
# A global amplification for reverb output, expressed in decibels. The value
# is logarithmic, so +6 will be a scale of (approximately) 2x, +12 will be a
# scale of 4x, etc. Similarly, -6 will be about half, and -12 about 1/4th. A
# value of 0 means no change.
#boost = 0
##
## ALSA backend stuff
##