I went through the RLP examples and see what you mean. One can create a time-slice with a call-back from the RLP back to the managed world to do things while RLP is idle.
I can imagine RLP might be idle in between outputting the analog value from the array, but not for very long. At 8 KHz, there would only be 125 microseconds - hardly enough time to complete a callback in MF. Am I missing something? Can RLP give back time to regular MF threads in slices to complete a longer job (like reading the next chunck of data from SD card)?
I’ll probably try and do something where MF passes a 10k buffer to RLP, then RLP sets up a timer interrupt to output the value to analog “in the background”. It signals MF to get ready for the next block - and MF places the next block in memory and it runs as a double-buffer or a circular buffer between the two. As long as RLP doesn’t read faster than MF can fill the buffer it should be fine. The trick is not to take more than 125 microseconds to switch from one block to the next otherwise there will be a “blip” in the stream. That should be doable with RLP speed.
What would be really cool as a feature is virtual memory - where the framework uses a swapfile on SD card as memory that it can share with RLP functions. The MF programmer will simply see it as a large memory block and the GHI magic underneath takes care of moving the data around.
Alternatively, a non-blocking library function that can stream from block storage (or network stream) at a predictable rate would be awesome. Something like AnalogOut.Stream(fromstream, samplerate);
The magic here is that the heavy lifting and time-critical stuff is done “on the metal” and not in MF. Setting up the stream is an ideal job for MF - so it should be a good partnership.