I’m creating a Synthesiser which plays sound files using an AudioAppComponent, an overridden SamplerSound class and a SamplerVoice. Everything works fine, except I’m getting a ridiculous high volume when I play the sounds if I don’t gain it (my left and right ear have now merged together in the middle of my head :p)
I want to lower/rise the gain for each sound/voice depending on note in renderNextBlock in the voice. My problem is that the volume gets even louder or no audio at all depending on the value.
void FreedrumSamplerVoice::renderNextBlock(AudioBuffer& outputBuffer, int startSample, int numSamples)
SamplerVoice::renderNextBlock(outputBuffer, startSample, numSamples);
float gain = Decibels::decibelsToGain(-30.0);
Can anyone tell me what I am doing wrong ?
applying master gain in the getNextAudioBlock in the AudioAppComponent works fine