Hi I’m experimenting with the IIRFilter and have a few questions:
1- The filters require the sample rate as a parameter, is there a way or how can I get this from the AudioSampleBuffer?
2- With the code below I have a lowpass filter at 100Hz but all I get is a weird sound that sounds ringy! and distorted What am I doing wrong? This is straight out of the vst demo, ps. for testing I’m only implementing process replacing at the moment
[code]// if we’re not accumulating, the output buffer’s contents are undefined
// (don’t assume they’re zero!) and we should overwrite it.
if (input.getNumChannels() > 0)
for (int channel = 0; channel < output.getNumChannels(); ++channel)
// for each output channel, copy the contents of the corresponding
// input channel (or if there are more outputs than inputs, just
// keep using the last input channel)
output.copyFrom (channel, 0, input, jmin (channel, input.getNumChannels() - 1), 0, input.getNumSamples()); myfilter.makeLowPass(44100,100); myfilter.processSamples(output.getSampleData(channel,0),output.getNumSamples()); } output.applyGain (0, output.getNumSamples(), gain);[/code]
Also if I replace the makeLowPass with BandPass it seems to have no effect. Any help welcome on setting up the IIRFilters.