Skip to the content.

Preview / export truth contract

Beatform aims for one creative result across preview and export. “Exact” has a narrow meaning here. This document defines what code guarantees, what release tests measure, and what hardware timing prevents from being identical.

Guaranteed

Deterministic export timeline

Segment exports rebase the clip, not the creative result

A segment export (“export this slice”, the Canvas-loop path) slices the decoded audio so the rendered clip starts at t = 0. Every time-bearing structure the exporter hands the core is rebased with it — timeline scenes and automation keyframes, the beat grid, section boundaries, vocal spans, lyric lines and the words inside them, stem envelopes, the audiogram waveform overview — so the clip resolves the same creative frame at the same musical moment as the preview does at absolute track time.

Two values stay ABSOLUTE, deliberately, because they record where the clip sits on the track rather than describing something inside it:

AudioFeatures.time itself stays CLIP time on both halves of a segment export. It is frame / fps by definition, and everything listed above has already been rebased to match it; making it absolute would shift all of them twice. The renderer’s clock is a separate value, derived from it — the two never merge.

Deliberately clip-relative, and not part of the above: the audiogram’s progress bar and clock (a 40 s segment reads 0:00 / 0:40, with the waveform strip sliced to match), the lyric and overlay compose timings, and the fixed 60 Hz feedback state grid, which is anchored to the clip’s first frame.

On the live path and on full-track exports timeOrigin is absent or 0, so the arithmetic is exactly what it is without segments.

Shared creative definition

Preview and export use the same project document, preset WGSL, parameter defaults, frame resolver, modulation functions, post settings, and overlay composition code. Loudness normalization changes encoded audio only; it does not change export analysis or rendered pixels.

Repeatable export input

Given the same app build, project, decoded PCM, export settings, GPU/driver, and output dimensions, the raw frame walk is deterministic. Encoded MP4/WebM bytes are not promised to be byte-identical: hardware encoders, drivers, and container metadata may differ without changing decoded content.

Measured parity, not identity

Audio analysis

Both paths use Beatform’s RealFFT, bin mapping, and FeaturePipeline. The responsive detector transform is separate from the optional longer drawn-spectrum transform: changing display resolution, axis, or interpolation cannot retune bands, sync, or onset decisions. Long display FFTs refresh on the same fixed 60 Hz analysis ticks and are held between them.

Windowing differs by purpose. Detector transforms keep the symmetric Hann window unchanged — beat, onset, band, and every derived feature stay byte-identical. The longer display-only transforms use an asymmetric window (half-Hann rise, half-Hann fall over the last N/8) whose peak weight sits round(N/8) samples from the window end, so a 171/341 ms display window no longer reads a transient half a window late:

Sample acquisition differs:

Result: preview/export reaction should be perceptually aligned and must not drift, but transient placement is not promised at the same millisecond.

Pixels

Exact preview/export pixel equality is not promised across different:

Release validation therefore uses canonical fixtures, timestamps, dimensions, and tolerance-based decoded-pixel comparisons. It separately requires zero WGSL compile errors and zero uncaptured WebGPU errors.

Not promised

Release gates

Any change to analysis, feedback, shaders, render graph, timeline resolution, or overlays must pass:

  1. focused behavior regression tests;
  2. full TypeScript/Vitest/Rust gates;
  3. real WebGPU compilation for every built-in preset and style;
  4. canonical real-GPU pixel baselines across every built-in preset and style;
  5. fixed-clock and preview/export event traces across 24/30/48/60/90/120/144 Hz fixtures where applicable;
  6. device-runtime smoke tests, including system-audio silence, known audio, and sustained loopback capture when loopback code changed.

If a gate has not run, release notes must say so. Source snapshots alone prove shader text stability, not compilability or pixel correctness.