Now in stereo!
Just a short little proof-of-concept for streaming PCM output in Picotron. Could stand to be streamlined and cleaned up a fair bit (and commented better!), but hopefully this gets the idea across. The idea is to set up a few different sfx instruments playing different wavetables on adjacent rows of a pattern, use stat()
calls to track the currently playing row, and update non-playing rows with new samples. There are a few gotchas to work around - setting up the instruments is a little fiddly, and Picotron crossfades instruments between rows so some samples need to be written to multiple instruments.
Use the left and right arrows to change the audio buffer size. Values >=8 seem to work well on web, and it looks like I can go as low as 3 on desktop Picotron on my machine.
0.1.0h seems to have broken part of the visualization here - probably just an API change I haven't caught up with yet.
IF YOU WANT TO USE PCM IN YOUR OWN CODE: copy pcm.lua from this cart, and check out how main.lua uses pcm_init, pcm_callback, pcm_start, and pcm_stop. I'll probably document this better at some point.
[Please log in to post a comment]