pub struct Program {
pub program_version: u32,
pub schema_version: u32,
pub engine_version: u32,
pub hash: u64,
pub target: CompileTarget,
pub doc: SoundDoc,
pub meta: ProgramMeta,
pub estimates: ResourceEstimates,
pub warnings: Vec<Diagnostic>,
}Expand description
A compiled song: validated, resolved, hashed. Built by
Song::compile; reloaded by
Program::from_json.
Fields§
§program_version: u32The bundle revision (see PROGRAM_VERSION).
schema_version: u32The resolved document’s effective schema version.
engine_version: u32The resolved document’s effective engine revision.
hash: u64Canonical semantic hash. Version 1 covers the document; version 2 covers every serialized semantic field except this hash.
target: CompileTargetThe target this program was compiled for (offline or runtime).
doc: SoundDocThe resolved document — renders through the exact same engine as everything else; nothing new in the render path.
meta: ProgramMetaThe musical metadata a transport (or a host deciding how far ahead to schedule) needs — preserved at compile time, not reconstructed.
estimates: ResourceEstimatesBounded resource estimates the runtime preallocates from (ADR 0005).
warnings: Vec<Diagnostic>Offline compile warnings: streaming blockers re-derived from the resolved document on load (a pure function of it), never stored. Runtime-target compilation rejects these blockers instead.
Implementations§
Source§impl Program
impl Program
Sourcepub fn render_mono(&self) -> Vec<f32>
pub fn render_mono(&self) -> Vec<f32>
Render the full program to mono samples through the standard engine.
Sourcepub fn render_stereo(&self) -> (Vec<f32>, Vec<f32>)
pub fn render_stereo(&self) -> (Vec<f32>, Vec<f32>)
Render the full program to a stereo pair. A compiled song always has a stereo mix; a defensively duplicated mono pair is returned if it somehow doesn’t.
Sourcepub fn render_range_frames(&self, start: u64, end: u64) -> (Vec<f32>, Vec<f32>)
pub fn render_range_frames(&self, start: u64, end: u64) -> (Vec<f32>, Vec<f32>)
Render a frame range [start, end) as a stereo pair — a slice of the
full render, so a note or tail crossing the range boundary sounds
exactly as it does in the full mix (this is why ranges render through,
not from, the boundary). Out-of-range requests clamp.
Sourcepub fn render_range_bars(
&self,
start_bar: u32,
end_bar: u32,
) -> (Vec<f32>, Vec<f32>)
pub fn render_range_bars( &self, start_bar: u32, end_bar: u32, ) -> (Vec<f32>, Vec<f32>)
Render a bar range [start_bar, end_bar) through the program’s meter
map (see Self::render_range_frames).
Sourcepub fn render_stems(&self) -> Vec<Stem>
pub fn render_stems(&self) -> Vec<Stem>
Render per-track and per-bus stereo stems (pre-master-chain — see
render::Stem): every track stem plus every bus stem, in
declaration order. Muted tracks are silent stems.
Sourcepub fn is_streamable(&self) -> bool
pub fn is_streamable(&self) -> bool
Whether the resolved document streams natively (no warnings is the same signal — blockers are the only warnings compilation produces).
Sourcepub fn capabilities(&self) -> Vec<&'static str>
pub fn capabilities(&self) -> Vec<&'static str>
The machine-readable capability list: what this program can do on a
host — "offline-render" and "stems" always; "streaming" when the
resolved document streams natively. Derived from the warnings (a pure
function of the document), so it’s identical from any loader.