AUDIO
Source snapshot · 11 November 2026

Explicit trusted VST3 catalogues

Hosted native 32/64 aux buses and owned Graph banks

The default-disabled ravet-host/vst3-hosted-audio feature (it enables vst3-catalogue) adds vst3::instances::hosted_audio. It is an additive, exact-origin companion: the caller-linked native archive exports ravet_vst3_hosted_audio_provider_v1, whose 72-byte table (64-bit macOS) contains pointers to the exact instance ABI-v2 and rich processing-v1 tables. hosted_audio::Provider::from_raw checks size, version, every entry and both origins; preparation additionally checks pointer identity against the Instance's Library and its refreshed processing table. Existing v1/v2, state, parameter and processing layouts, result domains and f32 entry points are unchanged. Cargo still links no SDK; see the native build section above.

Catalogue and explicit profile

On a stopped child, call refresh_parameters, then refresh_processing, then refresh_hosted_audio. The returned AudioCatalogue copies every advertised audio bus in native index order (0..16 per direction): direction, main/aux type, defaultActive flag, channel count, speaker arrangement bit mask and UTF-8 name. At most one main bus per direction is admitted. Native refresh invalidates any earlier readiness, so every refresh requires preparation again.

HostedAudioProfile::new(precision, rate, maximum_frames, inputs, outputs) takes an explicit BusRequest::active(arrangement) or BusRequest::inactive(arrangement) for EVERY advertised bus; no defaultActive inference or fallback precision is applied. Rate is finite, positive and at most 768000 Hz; frames 1..=65536; at most 64 active packed channels per direction and at least one active channel overall. Mono is the SDK centre speaker bit (1 << 19), not bit 0.

prepare_hosted32 / prepare_hosted64 refuse a profile of the other precision locally. Local refusal (shape, missing bus request, stale catalogue) preserves the prior prepared profile. Once the native call begins, Rust readiness is cleared first. The native provider negotiates canProcessSampleSize, passes all advertised arrangements (inactive included) to setBusArrangements, reinspects counts/types/arrangements, sets up processing, activates the requested buses and only then publishes; the latency/tail getters follow. Native refusals keep their original stage (ControlReport::stage, 100..=122) and returned tresult, for example a kResultFalse from canProcessSampleSize at stage 107.

PackedAudioMap exposes each bus's native index, arrangement, channel count and packed range. Active channels pack in increasing native index order separately per direction; inactive buses keep their index (no range) and remain present in native ProcessData with null sample pointers.

Scoped processing

Instance::with_audio lends the same Send/non-Sync/non-Clone HRTB capability. Audio::process_hosted::<f32 | f64> takes packed input/output slices, the unchanged W233 Input (points, events, optional context) and an exclusively borrowed OutputStorage; the returned Output borrows that storage. Precision, counts, frames, points, events and context are checked before native calls. f64 samples are never narrowed. Legacy main-f32 entries refuse a hosted capability before any native call. A native fault silences valid output prefixes and retires hosted processing for that scope; stopped re-preparation or a fresh child is required.

Owned Graph bank

hosted_audio::graph::Vst3GraphBankBuilder<S> consumes a MAIN Library<'static> (static caller-linked tables and executable) and the exact paired parameter/processing/hosted providers. Children retain the Library through a private Rc; no borrowed lifetime is erased. node / node_with_setup add up to 128 children; setup runs on MAIN after creation and before refresh/preparation (for example stopped state recall). build prepares every child and captures latency/tail FIRST, then starts every child and begins every native AUDIO lease LAST. Any start/begin failure ends earlier leases in reverse before stopping and retiring; no node escapes.

Vst3GraphNode<S> implements Processor<S> with the packed layout, cached latency/tail and no foreign lifecycle calls: prepare admits only the exact rate, layout and a block no larger than the prepared one. It is Send, not Sync, and owns only the native AUDIO handle, static tables, copied profile and prepared buffers. Sidechain/aux buses are ordinary packed node channels, so Graph's main-only outer configuration is unchanged.

Dropping a node moves its whole bundle into a dedicated one-slot return ring whose consumer always stays in the process-lifetime MAIN registry (64 banks, 128 children, nonwrapping generations; bound to the platform main thread on Apple targets). Vst3GraphBankControl is MAIN-only and disposable: dropping it marks the bank orphaned while the module, children and leases stay retained. reclaim_vst3_graph_banks(Some(id) | None) gathers returned bundles without native calls, then for an orphaned fully returned bank ends ALL leases before any stop or retirement, then retires children and the Library. A forgotten node, never-joined worker, refused return slot or failed native end keeps the bank retained with a diagnostic; nothing is guessed to have ended.

Rich lanes

LaneOptions (1..=4 complete owned batches per node, processing ABI limits, a 64 MiB per-bank aggregate budget) selects queued mode. On MAIN, control.submit(child, frames, fill) fills typed InputEvents, InputPoints and Context and assigns the next exact sequence; the node consumes exactly one matching head batch per block and never skips or overwrites one. A missing batch, sequence/owner or frame mismatch refuses before native mutation and faults the node with a copied diagnostic. control.receive re-validates the batch's complete rich output on MAIN and recycles it. No Vec/String/Box is constructed or dropped on AUDIO. Framework events reach a node only through the explicit translation below; a node without one refuses non-empty framework events before native execution.

Framework event translation

builder.translate(child, FrameworkTranslation) opts one child in to translating ordinary RAVET events and block-start transport (hosted_audio::graph::framework, decision 0273). Shape and capacity are checked when you call translate. build checks parameter routes and the note bus against the refreshed catalogue after every child is prepared and before any child starts or any lease begins. A refusal is BankError::Translation { child, error } and unwinds like any build error. Each TranslationError names the failing case and route index (duplicate graph or native ID, reserved native ID, invalid scale, note bus, capacity, unknown or read-only parameter). Routes are checked against a catalogue snapshot taken at build; a later plug-in restart that changes parameter flags is not revalidated.

Framework input VST3 input Rule
ParameterValue IParameterChanges point Declared ParameterRoute (graph ID, native ID, Normalized or declared Linear { minimum, maximum })
NoteOn / NoteOff NoteOnEvent / NoteOffEvent noteId -1 under Unidentified; refused under RequireIdentified
NoteWithId NoteOnEvent / NoteOffEvent ID kept, 0..=i32::MAX
NoteExpression (not pressure) NoteExpressionValueEvent expressions declared; ID-only target; volume /4, tuning /240 + 0.5, others unchanged
NoteExpression::Pressure PolyPressureEvent poly_pressure declared; concrete channel and key, optional ID (else -1)
Transport ProcessContext transport declared; flags exactly for the fields present

Every refusal, including capacity overflow, happens before the plug-in runs. The plug-in is not called and its history does not advance.

A Graph status does not carry the refusal. Callers that must react to refusals poll these on MAIN. Native faults, admission refusals and framework events sent to a node without a translation still fault and latch, and need a rebuild. Decision 0273 explains why refusals return Silence.

Tests check every mapping and refusal with the mock provider, including exact sample offsets and 10,000-cycle zero-allocation runs. An actual caller-linked consumer loads RAVET Gain and Performance VST3 bundles built from the same tree. A Gain node driven by framework values 1.0 at sample 0 and 3.0 at sample 11 (declared linear 0..4 route) matches the smoothing reference exactly, changing first at sample 11. A Performance node driven by NoteWithId, volume and pan expressions, poly pressure, Level values and transport matches a closed-form voice (maximum error about 1.1e-10 in f32 and 7.5e-18 in f64). A broadcast Graph chain, Performance into Gain at 0.5, matches the same reference and reports the expected ignored counts. A refusing Gain node inside a Graph silences only the refused block. The Graph reports Continue for every block, output equals input before and after the refusal, and a later gain change is applied. The mock provider checks the same over seven Graph blocks with two refusals. 10,000 variable Graph blocks with translated events perform zero Rust allocations on AUDIO. The reference Performance voice does not apply pressure or transport, so those reach the actual modules without an audible check; the mock provider checks their wire form.

Checked reset

Generic hosted VST3 has no guaranteed SDK history reset. Node try_reset returns ProcessError::RebuildRequired without foreign calls and the node stays faulted; legacy reset records the same state. Graph::try_reset reports the original node and error and remains faulted. Rebuild: stop/join workers, drop the nodes, reclaim on MAIN, and build a fresh bank.

Limits

Explicit unsafe table/code/module trust remains the caller's obligation. Rust allocation counting covers Rust only: foreign SDK/C++ heap, crash isolation and real-time deadlines are not established. Evidence is local macOS arm64 with the authored Gain/Performance references and authored native fixtures; no DAW, third-party plug-in or other-platform support follows. Auxiliary buses and all nine rich input event kinds also have actual-module evidence against the RAVET reference VST3 modules; see vst3-reference-modules.md. Framework event translation is described above. Editors for scoped instances and for Graph-bank children, and controller edit gestures, are described below.