Repository Public
1//! ORIX Sonata2//! File: crates/sonata-runtime/src/lib.rs3//! Description: Real-time safe execution: prepared plans, voices, mixer, transport, hot swap, analysis taps.4//!5//! Author: Simon-Pierre Boucher6//! Contact: contact@spboucher.ai7//!8//! # Model9//!10//! [`PreparedProgram::prepare`] turns a `Program` and its `DspGraph` into a plan that owns every11//! buffer, instrument and effect it will need (all allocation happens there, off the audio12//! thread). [`engine`] creates a [`Controller`] / [`Processor`] pair joined by lock-free queues.13//! The audio callback calls [`Processor::process`]; everything else goes through the controller14//! or reads [`Shared`] atomics.15//!16//! The processor renders in chunks of at most [`QUANTUM`] frames, cut on a fixed grid of the17//! engine clock and at every note and automation boundary, independently of the host block size.18//! Offline rendering drives the same code, so both produce the same samples.19//!20//! # Mixer conventions21//!22//! * Faders are in dB; -144 dB and below is silence. Changes are smoothed (5 ms time constant);23//! automated faders follow their lane exactly, ramping linearly inside each chunk.24//! * Pan law: constant power, -3.01 dB at centre (`gL = cos θ`, `gR = sin θ`, `θ = (pan + 1)·π/4`)25//! on tracks and buses. The master strip has no pan stage.26//! * Solo applies to tracks: when any track is soloed, the other tracks are silenced; buses pass.27//! * Insert effects run fully wet; dry/wet, bypass and the latency-aligned dry path are handled28//! here, so a bypassed effect keeps its latency.29//! * Non-finite output of an instrument or effect is replaced by silence, the component is reset30//! and the event is counted in [`Shared::scrubbed_samples`].3132pub mod engine;33pub mod plan;34pub mod shared;35pub mod spsc;36pub mod testing;3738pub use engine::{engine, Controller, EngineConfig, Processor};39pub use plan::{AssetProvider, AudioAsset, EffectInfo, Factory, Limits, NoAssets, PreparedProgram, ProgramInfo, RegistryFactory, StripInfo, TapPoint, QUANTUM};40pub use shared::{meter_slot, MeterBallistics, MeterSnapshot, ScopeRing, Shared, TimingSnapshot, TransportState, MAX_BUSES, MAX_TRACKS, SCOPE_FRAMES};41