Skip to main content

Module render

Module render 

Source
Expand description

Deterministic graph → samples renderer.

Rendering is a pure function of (graph, seed, sample_rate). Each node is evaluated into a block of f32 samples; combinators combine those blocks. Processors transform the signal flowing through a chain.

Structs§

LayerStats
Post-fader, pre-master snapshot of one layer’s contribution to the stereo bus — the balance numbers an agent mixes by. “Pre-master” matters: a master compressor / reverb reshapes the bus AFTER these are measured. Energy and peak are measured per channel (pan-invariant: hard-panned and centered layers of equal power read equal).
RenderProduct
A finished render: the mono mid (what analysis and mono export consume) plus the true stereo bus when the document is a tracks mixer. Producing both from ONE render keeps the author/refine/export paths from paying the full synthesis cost twice. Plain documents carry no pair here — their stereo treatment (Haas / Wide) is applied at write time by stereoize.
TracksRender
A finished mixer render: the stereo bus plus per-layer contribution stats captured from the same pass (free — no extra render).

Functions§

loop_seam_db
The loop-seam discontinuity in dB: the sample jump from the last sample back to the first (lower ⇒ a cleaner seamless loop).
make_loop_buffer
Extract the loop region [start_secs, end_secs) and equal-power crossfade its last crossfade_secs onto its head, returning a buffer that repeats seamlessly. The output length is the region minus the crossfade.
render
Render a sound document to normalized mono samples in [-1, 1].
render_product
Render a sound document once, yielding the mono mid plus the stereo bus for mixer documents. Every consumer that needs both (analysis + the WAV on disk) should call this instead of rendering twice.
render_tracks
Render a tracks document to a finished stereo pair: each track is rendered mono and equal-power panned onto the bus (sampler tracks keep their native stereo), the master chain runs per channel (the reverb with decorrelated tails), then loop/normalize apply jointly.
stereoize
Turn a finished mono render into a stereo (left, right) pair per the doc’s Stereo mode. Mono is the identity; Haas / Wide add width. The pair is jointly peak-limited so widening never clips.