AUDIO
Source snapshot · 11 November 2026

LV2

Performance instrument

The separate public performance factory exports urn:ravet:performance-sine:mono and urn:ravet:performance-sine:stereo. It links only the public 16-voice native sine reference, with mono/stereo f32 outputs, Level control ID1 and one Notes Atom input. There are no audio inputs. Level defaults to 0.2, ranges over 0..1 and uses the same complete-state/control precedence policy above; state product RAVETPS\0, version 1 persists Level only. Active voices and DSP history are not saved.

NativeLv2Processor<1, 2, true, true> explicitly selects the instrument profile; Gain's default effect profile is unchanged. Instantiation requires urid:map to cache Sequence, MIDI event, frame timestamp and the selected time:Position identifiers. The fourth template argument opts into validated transport; the default MIDI-only instrument template retains its prior URI and processing requirements. The MIDI converter accepts a Sequence body of at most 65,536 bytes and 1,024 raw ordered events, including ignored events. Timestamps use audio frames (default unit 0 or explicit atom:frameTime); beat units reject. Zero-frame blocks accept offset 0 only. The host provides aligned storage covering the complete declared body.

Complete MIDI1 short messages of 1..3 bytes are validated for exact defined status length and seven-bit data. NoteOn/NoteOff retain channel/key and velocities as exact widened f32 fractions byte/127. NoteOn velocity 0 maps to NoteOff according to MIDI1 convention. NoteOff releases all matching voices at that channel/key; no per-note IDs are invented. Other defined short MIDI messages are ignored. SysEx and F0/F7 delimiters, running status, undefined statuses and long MIDI payloads reject the whole block. Other Atom types are ignored after bounded length/timestamp checks, except the opted-in Position object checks below. Pedals, pitch bend, expression, program changes and MIDI2 are outside this note profile.

Changed block-start controls precede same-frame MIDI, preserving note source order. The native capacity of 1,024 events is shared by controls and notes; a full 1,024-note block needs unchanged controls. Malformed input and capacity failure precede state application and DSP, preserving pending recall and voice history. There is no Atom output port. Native completion notifications are suppressed; internal voice completion still occurs. The converter separately exposes atomic bounded conversion in RavetLv2NoteInput.hpp.

Build a self-contained public instrument bundle using the same entry point:

CARGO_BUILD_JOBS=2 python3 scripts/bundle-lv2.py --sdk /path/to/lv2 --plugin performance

This produces target/lv2/ravet_performance.lv2 with its manifest, instrument metadata, actual module and LV2/RAVET licence notices. The script validates that packaged module and signs it ad hoc on macOS. It performs no host installation. Shared build/package/runtime mechanics live in scripts/lv2_bundle.py; selecting Gain explicitly clears the optional performance CMake profile so the default build remains independent.

For direct native development and both references' regression contracts:

cargo build -p ravet-gain-native -p ravet-performance-native --release --locked
cmake -S examples/gain-lv2 -B target/lv2/performance \
  -DCMAKE_BUILD_TYPE=Release -DRAVET_LV2_SDK=/path/to/lv2 \
  -DRAVET_GAIN_LIBRARY="$PWD/target/release/libravet_gain_native.a" \
  -DRAVET_PERFORMANCE_LIBRARY="$PWD/target/release/libravet_performance_native.a"
cmake --build target/lv2/performance --parallel 2
ctest --test-dir target/lv2/performance --output-on-failure

This produces target/lv2/performance/ravet_performance_lv2.so. Gain's library is required for the shared CMake configuration and regression targets. The optional performance target uses its own archive and separate metadata in examples/performance-lv2. These direct commands exercise the actual native module; the bundling command above packages its metadata for explicit host discovery. Discovery/recall in a DAW remains unvalidated.

The synthetic mono/stereo probe verifies analytic timing/velocity/frequency, sample-exact split blocks, atomic malformed-input faults, Level state and pending recall, same-frame ordering, release, full shared event capacity and 2,000 prepared cycles without C++ heap or URI mapper calls. The existing Gain actual-module suites also pass against the extended helper. This evidence establishes no LV2 DAW support, physical MIDI, hard real-time deadline or other-platform runtime. See decision 0170.