prime-render
Pure sample-level audio scan loop — fold a stateless step function over N audio samples. The proof that a song is a pure function of time.
Part of the prime math ecosystem.
What's inside
render— fold a mono step function over a sample bufferrender_stereo— fold a stereo step function over an interleaved bufferrender_fold— fold with an accumulator (collect events, gather analysis data)
Usage
use render;
// Step function: (state, sample_index) -> (sample, next_state)
let step = ;
let buffer = render;
Design
No audio thread, no callbacks, no mutation. The render loop is a pure fold — same initial state always produces the same buffer. Useful for offline rendering, testing, and proving that audio synthesis is deterministic.
License
MIT