I lack knowledge with pointers. I am in the middle of making a synth plugin and need to access the sample date in the AudioBuffer to a custom visual scope.
In PluginProcessor.cpp there is;
void MySynthAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
and inside there I know I can loop through the samples using;
for (int sample = 0; sample < buffer.getNumSamples (); sample++)
{
outputWaveLeft[outputPlot] = buffer.getSample (0, sample);
outputWaveRight[outputPlot] = buffer.getSample (1, sample);
outputPlot++;
if (outputPlot >= scopeSize) outputPlot = 0;
The scope function is in a JUCE component, and is called from PluginEditor via a Timer 30 times a second.
So my questions is; how do I access the AudioBuffer data in another JUCE component? I think I have to make a global pointer, or at least one that is accessible both in my Scope component and PluginProcessor, but don’t know how.