I am trying to create a synth. There is a Bad Access Error pointing to this peice of code below where the sample rate is set to sr,
sr = 44100 set in a function just above.
void OscillatorBase::setSampleRate (float sr)
{
sampleRate = sr;
setFrequency (frequency); //just to update the phaseInc
}
In the audio class, an instance of the oscillator base class is called like so:
Atomic<OscillatorBase*> oscillatorBasePtr;
Along with the error, this is shown as:
this OscillatorBase * NULL 0x0000000000000000
I believe it’s an issue with the way the classes are communicating. I have the correct #includes in place etc. Any input is much appreciated.
Thanks.