Gain reference (0.0.1)¶
The public reference exports mono and stereo LV2 descriptors with f32 audio ports and block-start physical gain/bypass controls. It uses reusable native processor, cached schema and coherent complete-state tables through the external-SDK C++17 NativeLv2Processor helper. Consumer factories still own plugin URIs, Turtle metadata and product identity. The helper now requires the exact originating core pointer returned by cached schema metadata and the exact shared parameter-schema pointer returned by the cache and state companions. Callback-equivalent copied cores and separately copied schema tables refuse before any resource creator. Metadata accessors are queried once on CONTROL; a violating query exception invalidates the helper before acquisition. The native ABI remains nonthrowing. Existing constructor, port and lifecycle contracts are unchanged. Cache/state top-level table addresses have no additional authoritative accessor in this ABI; a copied top-level view that retains the exact actual core/schema provenance is not falsely rejected. See decision 0261. No LV2 SDK source is included in RAVET.
CARGO_BUILD_JOBS=2 python3 scripts/bundle-lv2.py --sdk /path/to/lv2
Supply an external source SDK containing include/lv2/core/lv2.h and COPYING.
Version 1.18.10 was exercised. The script builds with two jobs, copies Turtle
metadata and the binary into target/lv2/ravet_gain.lv2, adds notices and tests
the actual packaged binary. macOS receives an ad hoc binary signature. No global
host installation occurs. --plugin gain is the default; --plugin performance
selects the separate instrument bundle through the same build/package pipeline. Linux compilation is configured but its runtime is
unvalidated; this fixture has no Windows branch.
Plugin URIs are urn:ravet:gain:mono and urn:ravet:gain:stereo. Mono ports are
input, output, gain, bypass; stereo ports are left/right inputs, left/right
outputs, gain, bypass. The helper accepts one main input/output bus with 1..64
channels and 1..1,024 writable schema controls, bounded by its explicit template
arguments; Gain selects at most two channels and two controls. Fixed native IDs,
physical ranges and stepping come from the prepared schema. Gain spans 0..4 with
unity at 1; bypass snaps to 0/1 at 0.5. Finite controls clamp/snap through native
schema mappings; nonfinite controls reject atomically with output silence.
Unchanged canonical controls do not restart smoothing. All controls require
connected, aligned pointers. Inputs may alias outputs; output ranges must be
mutually distinct. Host pointers must cover the stated frame count, and control
and instance metadata must stay disjoint from writable samples.
Processing supports zero-frame changes and at most 65,536 frames. Full audio and control preflight precedes state application and rendering. Unsupported larger blocks silence at most the supported prefix; backing tails survive. Null sample ports are allowed for zero frames. Ordinary rejection allows later valid blocks; a contained panic disables the instance until recreation. Activate resets history and preserves requested values. Native consumer hooks remain responsible for atomic backend behavior; a failure after state application cannot generically roll back arbitrary consumer history. Build with ordinary IEEE finite semantics.
state:interface saves a complete native canonical state as portable POD
atom:Chunk under urn:ravet:gain:state. The urid:map instantiation feature is
optional for processing and required for state calls. Save may overlap audio:
it reads the coherent publication, without accessing DSP or connected controls.
A contended one-attempt snapshot returns an error; there is no retry loop. Restore
must be serialized with all callbacks in the LV2 Instantiation threading class;
state:threadSafeRestore is not advertised. Wrong type, flags or native payload
reject before publication. A missing property restores schema defaults. Save
propagates the host's store error.
Hosts also persist control-port values independently. Explicit restore holds its values until a connected canonical control changes. Each changed control wins for its parameter at the next valid block. Controls reapplied by the host during recall become authoritative. If controls are unavailable at restore, their first valid connection wins. This policy prevents unchanged old port values from immediately undoing a requested complete-state restore.
Actual-binary contracts check both descriptors, preparation, wet/dry samples, control recall, zero-frame changes, malformed-control silence, lifecycle, tails, input/output aliases, state/default recall, malformed payload atomicity, missing features, host refusal, disconnected/misaligned/overlapping ports and oversized blocks. Another probe checks 4,000 run/save cycles without C++ heap operations or URI mapper calls and coherent saves concurrent with 20,000 audio blocks. This probe does not measure Rust allocations, physical devices or audio deadlines.
The Gain profile has no Atom port, sample-timed automation, MIDI input, custom UI,
programs, f64 or auxiliary buses; the separate instrument profile is described
below. No hardRTCapable declaration is made. LV2 host
discovery, metadata validation and actual DAW session recall need separate
evidence. See decision 0167 and the
native processing guide.