Hi there,
i ve just sarted using Juce and tried to implement a really simple filter. It seems to work but there is also some weird distortion going on and i just cant figure out where the problem is. Here is a file that demonstrates that behavior:
http://www.mediafire.com/listen/co4bms7q7mzeo4c/pluginTest.wav
I ve started with using the introjucer and its Audio Plug-In preset. lastSample is declared as float in the PluginProcessor.h and initialised in its constructor.
I would be grateful for any help.
void FilterAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) { for (int i = getNumInputChannels(); i < getNumOutputChannels(); ++i) buffer.clear (i, 0, buffer.getNumSamples()); for (int channel = 0; channel < getNumInputChannels(); ++channel) { float* leftData = buffer.getWritePointer(0); for (long i = 0; i < buffer.getNumSamples();i++) { leftData[i] = (leftData[i] + lastSample) / 2.0f; lastSample = leftData[i]; } } }