Hi Andrew, I greatly appreciate your response, and I was able to get closer to implementing the Vinne Falco DSP Filters. I now am able to call the library from processBlock. I wanted to spend due time trying things out myself before getting back in touch with you, or posting on the forum about this.
While DSPFilters does now seem properly included, I have not been successful implmenting the functions, and I've spent more time than I would like to admit. During my searching, I have seen many posts where people have had this problem over the years. I even found a post where Vinnie Falco said that when he had some extra time, he would try to improve the way these functions are called, although I'm not sure he was referring to the specific problem I'm having. Of course, kudos to him for building such an incredible library.
I try this code and I can hear some lowpass being applied, however it has alot of distortion in the signal:
void RevealAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
float* audioData[2];
int numSamples = buffer.getNumSamples();
audioData[0] = buffer.getWritePointer(0);
audioData[1] = buffer.getWritePointer(1);
// create a 2-channel RBJ Low Pass with parameter smoothing
// and apply it to the audio data
{
// "1024" is the number of samples over which to fade parameter changes
Dsp::Filter* f = new Dsp::SmoothedFilterDesign <Dsp::RBJ::Design::LowPass, 2> (1024);
Dsp::Params params;
params[0] = 44100; // sample rate
params[1] = 4000; // cutoff frequency
params[2] = 1.25; // Q
f->setParams (params);
f->process (numSamples, audioData);
}
}
My problem seems to come down to what the DSPFilters process function wants. The DSPFilters documentation example lists the following as the way to set up audioData to be accepted into the f->process (numSamples, audioData) function:
void UsageExamples ()
{
// create a two channel audio buffer
int numSamples = 2000;
float* audioData[2];
audioData[0] = new float[numSamples];
audioData[1] = new float[numSamples];
Seeing that made me think I needed to create a multidimensional array to get audioData set up for the process function. The line audioData[0] = new float[numSamples]; would seem to create a new array starting at audioData[0][0] with each sample value of channel 0 being held at audioData[0][1] and so on.
I tried that, together with an example I saw in the DSPFilters code, and got something that created even more distortion:
void RevealAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
float* audioData[2];
int numSamples = buffer.getNumSamples();
//Make multidimensional array to contain all the samples
audioData[0] = new float[numSamples];
audioData[1] = new float[numSamples];
audioData[0][0] = buffer.getWritePointer(0)[0];
audioData[1][0] = buffer.getWritePointer(1)[0];
// create a 2-channel RBJ Low Pass with parameter smoothing
// and apply it to the audio data
{
// "1024" is the number of samples over which to fade parameter changes
Dsp::Filter* f = new Dsp::SmoothedFilterDesign <Dsp::RBJ::Design::LowPass, 2> (1024);
Dsp::Params params;
params[0] = 44100; // sample rate
params[1] = 4000; // cutoff frequency
params[2] = 1.25; // Q
f->setParams (params);
f->process (numSamples, audioData);
}
}
Excuse the length of my post and all the pasting -- I wanted to be sure to state my problem clearly and so that if someone else is searching any part of this, this forum post would come up.