Expand description
prime-render — Pure sample-level scan loop.
This is the ADVANCE evaluator for the temporal assembly thesis. A rendered buffer is the result of folding a pure step function over time:
output[n] = f(state_n, t_n) where state_{n+1} = step(state_n, t_n).sample_raterender is the only place in PRIME where ADVANCE is the explicit design.
Everything else in PRIME is LOAD + COMPUTE (single-step). Here we fold N steps.
§Temporal Assembly in PRIME
LOAD ← initial_state, sample_rate, num_samples, step fn
COMPUTE ← fold: (state, sample_index) → (sample, next_state)
APPEND ← push each sample into the output buffer
ADVANCE ← repeat for every sample — this is the scan loopThe step function is always LOAD + COMPUTE only. It never calls render
recursively, never mutates, never reads the clock. Same inputs → same output.
Functions§
- render
- Render a mono audio buffer by folding a pure step function over time.
- render_
fold - Render a buffer and reduce it to a scalar — useful for envelope integration and level metering without allocating the full output.
- render_
stereo - Render a stereo audio buffer by folding a pure step function over time.