Hi!
I was getting started with some of the examples on writing a audio plugin. My problem is that when I call buffer.getReadPointer in my processBlock, it returns a null value.
Here is the code.
void FishTankAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
const int totalNumInputChannels = getTotalNumInputChannels();
const int totalNumOutputChannels = getTotalNumOutputChannels();
// If it ever becomes the point that there are more ouputs then inputs,
// Then regenerate this file, and see what they did for that sitch :)
// This is the place where you'd normally do the guts of your plugin's
// audio processing...
// Set up variables
//AudioSampleBuffer mainInputOutput = busArrangement.getBusBuffer(buffer, true, 0);
float sr = m_sampleRate;
for (int chan = 0; chan < buffer.getNumChannels(); chan++)
{
for (int samp = 0; chan < buffer.getNumChannels(); samp++)
{
// Test values
float testReadPointer = buffer.getReadPointer(chan)[samp];
float testValue = calculate(buffer.getReadPointer(chan)[samp]);
// Actual code.
buffer.getWritePointer(chan)[samp] = calculate(buffer.getReadPointer(chan)[samp]);
}
}
Does anything appear to be abnormal, or could there be a problem elsewhere? Thanks!