0
0

Hey guys :)

i’m trying to dynamically change the waveform created in the pcmreadcallback function. for example i create a sine wave with frequency 220, and in the main loop i add 0.1 or anything else to the frequency to change the sound, but the sound is only changing after a new callback call..
if i debug the frequency in the callback function its something like this:
220 220 … 220 224.5 224.5 … 224.5 227.5

and thats no nice pitch slide.. more like a jump. 😉
the frequency is saved in a global variable btw. and i dont think lowering the decodebuffersize is a good solution because then theres noise between the changes.. isnt there any way to change the value while callback is running?

Thanks for your help
Tobi

  • You must to post comments
0
0

If I follow you correctly, you are talking about Channel::setFrequency?

This will apply at the start of each callback, the only way decrease the stair stepping is by lowering the DSP buffer size via System::setDSPBufferSize. You may need to increase the number of DSP buffers to compensate.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.