Reverb in Audio App

dsp_module

#1

I am trying to add a reverb to my output. I have it declared, and I am setting the parameters like this;

theReverbParameters.dryLevel = 0.2;
theReverbParameters.wetLevel = 0.8;
theReverbParameters.roomSize = 0.2;
theReverbParameters.damping = 0.2;

reverb.setParameters(theReverbParameters);

reverb.setSampleRate(sampleRate);

When It comes to adding the reverb to the output, where am I going wrong?

          outputSample = reverb.processMono(outputSample, sampleRate);

The error message here says “cannot initialise parameter of type”, I think this is to do with output sample, but I don’t know what goes in its place? Channel?

Any help would be great, thanks.
The whole audio function is below:

void Audio::audioDeviceIOCallback (const float** inputChannelData,
                                   int numInputChannels,
                                   float** outputChannelData,
                                   int numOutputChannels,
                                   int numSamples)
{
    //All audio processing is done here
    const float *inL = inputChannelData[0];
    const float *inR = inputChannelData[1];
    float *outL = outputChannelData[0];
    float *outR = outputChannelData[1];
    
    
    
    while(numSamples--)
    {
        
        float outputSample = 0.0;
        float ampEnv = 0.0;
        
        for(int i = 0; i < 4; i++)
        {
            
            float value = 0.0;
            value = oscillatorBasePtr[i].get()->nextSample();
            
            value = filter[i].lores(value, cutoffFreq[i], resonance[i]);
            
            // move to updateEnvelopes()
            ampEnv = env[i].adsr(1.0, env[i].trigger);
            if( env[i].trigger == 1 ) env[i].trigger = 0;
            
            value *= oscAmplitudes[i];
            
            outputSample += value;
            
            outputSample *= tremolo[i].nextSample() + 1;
            
        }
        
        //  outputSample = chorus.chorus(outputSample, 300.0, 0.5, 5.0, 0.5);
              outputSample = reverb.processMono(outputSample, sampleRate);
        
        outputSample *= ampEnv;
        outputSample *= 0.1;
        
        *outL = outputSample;
        *outR = outputSample;
        
        inL++;
        inR++;
        outL++;
        outR++;
    }
    
}

#2
void processMono (float *const samples, const int numSamples) noexcept

processMono() processes a block of numSamples of float… and expects a pointer to the block of float values.

Rail


#3

Thanks for your reply. Could you be more specific? I have tried this with no luck.

outputSample = reverb.processStereo(*inL, *inR, numSamples);

Cheers.


#4

http://www.cplusplus.com/doc/tutorial/pointers/

https://www.ntu.edu.sg/home/ehchua/programming/cpp/cp4_PointerReference.html

Rail