I am trying to add reverb to my primitive synth. After borrowing some code from the MultiEffect sample, everything sounded great for most of my samples. However, a number of my samples are quiet and when dry/wet is set to anything more than 0.2, nothing is heard once the reverb takes place.
I am wondering if there is some sort of gate in the ReverbSc algorithm that prevents signals under some threshold to be processed. A few fragments from my rather pedestrian code:
void AudioCallback(AudioHandle::InputBuffer in,
AudioHandle::OutputBuffer out,
size_t size)
{
pod.ProcessDigitalControls();
ProcessButtons();
for(size_t i = 0; i < size; i++)
{
float outl = 0;
float outr = 0;
float signal = synth.Process();
GetReverbSample(outl, outr, signal, signal);
OUT_L[i] = outl;
OUT_R[i] = outr;
}
}
void GetReverbSample(float &outl, float &outr, float inl, float inr)
{
float drywet = midiEngine.GetDryWet();
rev.Process(inl, inr, &outl, &outr);
outl = drywet * outl + (1 - drywet) * inl;
outr = drywet * outr + (1 - drywet) * inr;
}
float sample_rate = pod.AudioSampleRate();
rev.Init(sample_rate);
//reverb parameters
rev.SetLpFreq(18000.0f);
rev.SetFeedback(0.85f);
The dry/wet parameter is controlled via MIDI CC and its value is between 0 and 1.0f.
I also check the source code of the reverb and it looks the problem may be related to a gain constant set to a magic value (below).
static const float kOutputGain = 0.35;
Thanks