Hi there,
I have a problem while trying to use Synthesiser and SamplerSound.
My code is based on the JUCE demo code AudioSynthesiserDemo.h
and is a static library for an iOS app.
I managed to play audio files using Synthesiser and SamplerSound. However my problem is that the resultant sound always has a noise near the end of the playback duration. It’s a white noise that is initially not noticeable but gets really loud in the end. I also tried using the cello.wav
file that comes with the JUCE demo, and the same noise can be observed.
Does anyone know the cause of the white noise and how it can be removed?
Some more info about my code…
I didn’t use MidiMessageCollector like in AudioSynthesiserDemo.h
and simply called synth.noteOn(midiChannel, midiNoteNumber, velocity);
to play a note. My getNextAudioBlock of AudioSource has
juce::MidiBuffer incomingMidi;
synth.renderNextBlock (*bufferToFill.buffer, incomingMidi, 0, bufferToFill.numSamples);
… which supplies an empty MidiBuffer and I’m not sure if that’s right or not, but I don’t know what else to set.
I also tried using different velocity values and the result seems to be the same.
Thanks!