Sounds like you do things the right way, @three. And the rest of the code, for playback, is working?
I did a sampler for my OscPocketD/Base project (OscPocketD/Base 1+2/MIDI - fx unit, synth, sampler, modulator), where I started by filling the sample buffer with a triangle wave:
void fillBuffer()
{
Oscillator osc;
osc.Init(sysSampleRate);
osc.SetWaveform(osc.WAVE_TRI);
osc.SetFreq(440.0f);
osc.SetAmp(0.1f);
for (uint32_t i = 0; i < BUFFER_MAX; i++)
{
sBufferR[i] = osc.Process();
sBufferL[i] = sBufferR[i];
}
}
Just for checking the playback.
Does the playback work ok with something like this? Sorry if I am rambling, just trying to help and I don’t have your complete code!