AUDIO
Source snapshot · 11 November 2026

API reference / ravet_clap

Crate ravet_clap 

Expand description

Provisional CLAP bridges for portable effects and instruments. MainBusBridge supports one 0..64-input/1..64-output native f32/f64 bus with optional short MIDI input and bounded generated-event delivery; EffectBridge preserves the narrower gain path.

Clack owns foreign pointers and ABI callbacks. This crate only uses its safe views. Host samples pass through scratch storage allocated at activation, supporting separate, in-place, and mixed channel pairs with the same portable processor. Global parameter-value events and block-start transport are translated by the original EffectBridge. The separate main-bus adapter adds instruments/MIDI/native precision and opt-in bounded output events; explicit CLAP note ports add note identities and standard f64 expressions; MultiBusBridge adds ordered auxiliary buses with compact directional port mapping. Global modulation and endpoint-scoped parameter input require independent opt-ins. Invalid input rejects a block before changing processor state.

Structs§

BridgeReport
Successful audio progression plus separately reported generated-event delivery.
ClapParameterOptions
Consumer-owned CLAP presentation and processing policy, in schema order.
ClapParameterRegistration
Immutable 0..1024-parameter global CLAP metadata registration. Borrows a validated portable schema and ordered consumer options. Plain values remain physical f32 values promoted exactly to f64; logarithmic editor mappings do not change the wire range. Stepped ranges must be contiguous unit-spaced integers; fractional/coarser discrete schemas need a separate wire mapping. Names are complete UTF-8 up to 255 bytes, modules up to 1023 bytes, without NUL. CLAP’s invalid ID is rejected. At most one bypass, with binary range, is allowed. Explicit per-scope flags advertise consumer support. No cookies, value storage, formatting, flush, host rescans or lifecycle policy are synthesized. Construction belongs to preparation; metadata reads do not allocate. Products still implement PluginMainThreadParams.
ClapParameterScopes
Explicit per-scope native parameter metadata; no translation/DSP is enabled.
EffectBridge
A prepared portable effect plus bounded audio/event scratch storage.
MainBusBridge
Prepared one-main-bus effect/instrument adapter for native f32 or f64. Accepts 0..64 inputs and 1..64 outputs, <=65,536 frames/1,024 events; no auxiliary buses. Opt-in bounded output events use explicit host delivery. Optional selected MIDI input port maps validated short messages with sample timing; scoped parameters require an independent input/output selector. UMP words retain framing and timing without semantic conversion. Native CLAP notes/standard expressions require explicit selected ports; byte-pointer SysEx and note end filter. Exporters must advertise only processor-supported MIDI dialects and precision/layout.
MultiBusBridge
Native f32/f64 main bus plus up to eight ordered auxiliary buses. Native input and output port numbering each starts at zero, visits the main bus then auxiliaries in declaration order, and skips buses with zero channels in that direction. Exporters must advertise this same mapping and precision. All input samples are copied before any output write, preserving cross-bus host aliases. Both-precision buffers reject; there is no conversion.
OutputDelivery
Event delivery is separate from successful DSP progression. A host queue can accept only a prefix; there is no rollback, hidden retry or later-block replay.
ParameterEvents
Preallocated event translator, also usable for inactive parameter flushes.

Enums§

BridgeError
ClapParameterError
Unsupported metadata or physical representation rejects registration atomically.
OutputRejection

Constants§

MAXIMUM_EVENTS
Bound both traversal of host events and the preallocated translation buffer.
MAXIMUM_FRAMES
Bound scratch storage for this prototype (512 KiB of stereo f32 samples).

Traits§

ClapSample
Sealed native sample dispatch for f32/f64 CLAP buffers. No conversion occurs. Host buffers containing both precisions reject rather than selecting one.

Functions§

silence
Clear all supplied output samples, including unsupported f64 buffers, when the bridge rejects a block. Clack still requires valid host-owned storage.
translate_transport
Convert known CLAP block-start fields into portable transport context.