Using reverb object in process block


#1

So I have my UI that can set the parameters for the juce reverb object/parameter object.

How exactly do I use the method

reverbObject.processMono();

in the process block? I mean more likely what should I be putting in as parameters?

I know it takes in (float *const samples, const int numSamples), but as a beginner whose just looking through documentation, what should I be using as those parameters?

buffer.getSample? I’m not sure. Just a beginner looking to get on the right track.

Figured it all out.


#2
reverb.processMono(buffer.getWritePointer(0), buffer.getNumSamples());

Note however, that if you want to get stereo output (even just a duplicated mono output for the both channels), you can not just call that same method on the same reverb object again with buffer.getWritePointer(1) because the reverb has internal state that has advanced when you made the previous processMono call.

To process in stereo you can do (your plugin must of course have 2 output channels in order for this to work) :

reverb.processStereo(buffer.getWritePointer(0),buffer.getWritePointer(1), buffer.getNumSamples());

#3

Oh weird, I actually had that exactly right. My plugin was just outputting very strange results so I figured I did this wrong but it must be something else. Thanks again!


#4

You of course have the reverb object as a member variable of your AudioProcessor and you are not creating the reverb in the processBlock call?


#5

Yes, the reverb object and parameter objects are members of the processor. It all compiled just fine and I should be able to find the issue once I tinker with the project some more. It’s most likely a small issue.


#6

It may be that the reverb object can’t be directly used like I wrote above, if the plugin IO layout is more complicated than a simple stereo in/stereo out one…(Which may happen if you use the JUCE multibus stuff instead of the old simple channel layouts thing.)


#7

So I have everything working but none of the parameters really do anything besides the “dry level”. Do I need to set up a ReverbAudioSource object or something? The parameters are changing and the reverb object is doing stereo process function in the process block, but nothing is changing in the actual output. Just the dry level and my separate gain knob work but no other parameters affect the signal.


#8

How are you changing the parameters of the reverb? Are you setting the parameter object for the reverb object each time when you want a parameter changed? (The setParameters method of the reverb does not internally keep the parameters as a reference/pointer, it makes a copy of the parameters. So each time you want a parameter changed, you have to set the whole parameter object again.) Are you scaling the parameter values correctly for the reverb object? (It looks like those need to all be in the 0.0-1.0 range, maybe you are trying to use some other values?)


#9

Here’s an example of how I’m doing it with each slider…

(slider == &drySlider){
        //Set dry to value of drySlider
        processor.parameters.dryLevel = drySlider.getValue();
    
    //update reverb parameters
    processor.reverbObject.setParameters(processor.parameters);

And how I’m calling it in the process block…
reverbObject.processStereo(buffer.getWritePointer(0),buffer.getWritePointer(1),buffer.getNumSamples());


#10

I believe that should work…What value ranges you have in your Sliders?


#11

0.0 to 1.0, all done as the documentation refers to.


#12

It’s worth noting that the algorithm the reverb uses may require extreme parameter settings to get discernible changes in the sound. Did you try setting the parameters near zero and near one?


#13

I have tried it at 0 and at 1.

I just checked the actual value of the parameters by setting a text object to their value.

reverbObject.getParameters().roomSize showed the value was equal to what was on the sliders, which I tried at 0 and I tried at 1, and everything in between.

The strange thing is that the dry level works fine. At 0 it is inaudible and at 1 it is very loud. However none of the other parameters seem to actually affect the signal.

I have confirmed that the values of the parameters are indeed changing and I can set them to 0 or to 1. Dry level does what it should, though nothing else does. So I’m left wondering why only one parameter is functioning even though all of them go through the same processing and all of the parameters are in fact changing. Hmmm…


#14

Okay so I basically got rid of everything in my project that wasn’t related to the reverb and it turned out there was some strange bypass thing happening with a different part of my project.