Hello Everyone,
First post here, apologies in advance if this is very basic.
Im trying to make a sampler synthesiser using JUCE and am running into a run time error - JUCE Message Thread (1): EXC_BAD_ACCESS (code=1, address=0x8) pointing to the following line from the juce_Sampler.cpp file -
I can’t quite seem to find out what it is that I’m not doing(or doing incorrectly).
I’m following the AudioSynthesiserDemo from the DemoRunner and the ‘Build a MIDI Synthesiser’ tutorial to try and combine bits of code from the two to arrive at a sampler instrument that I can then use in my sampler audio application. I’m also using this sampler tutorial for reference.
I’ve put my SynthAudioSource class on an online text editor for reference - https://onlinegdb.com/HJQ9W72pH
In my MainContentComponent class (inheriting from AudioAppComponent) I’m calling the setUsingSampledSound() method which throws this error. However, setUsingSineWaveSound() results in a working sine wave synthesiser.
I know that I’m using a ScopedPointer which is now deprecated, however I believe this is not the cause of the error. From my little knowledge of C++, I understand that the error message means that I’m trying to access something that is not valid.
I would appreciate any advice on solving this issue.
Thanks !

