Module native
Expand description
The generic C table behind the VST3, AUv2, AAX and LV2 adapters.
crate::export_plugin! exports ravet_plugin_v1, which returns the
RavetPluginEntryV1 declared in include/RavetPlugin.h (feature
native). The adapters are written once against that header, so any
PluginExport reaches every format without product-specific C++. The
header is the contract; this module implements it:
- Static data. Product description, per-format identities, layouts and
parameter metadata are built once, on the first call of
ravet_plugin_v1, and live as long as the library. An invalid product, or one that only implements f64 processing, has no table (NULL). - Parameters. Text uses
crate::text, the same formatting as CLAP. Normalization uses the parameter’s range (scale and steps). - Instances. Each instance owns a
ParameterCache, anEditQueuefor editor edits, and the product’s processor wrapped in its automation and bypass policies and denormal flushing. Host-side changes (set_value) and editor edits mark the parameter dirty; the nextprocessdelivers dirty values at offset 0, ahead of the host’s events.load_statereplaces the cache; before its next block the processor receives every value in a zero-frame block, followed by a reset. - Processing. Samples are 32-bit float. Native buses, events and
transport are converted with
ravet_native; host buffers are copied into prepared scratch, so aliasing hosts are safe.processandresetnever allocate, lock or block. Host parameter values need not be exactly representable asfloat: they are clamped and snapped to the parameter’s range, written to the cache, and events for unknown IDs or with nonfinite values are dropped. - Faults. Every function catches panics and returns 2. After a panic,
process,resetandtimingreturn 2 (andprocesssilences its outputs) until the next successfulprepare, which recreates the processor; parameter, state and editor calls keep working. - Editor.
editor_openattaches the product’s web editor, with the same editor host as the CLAP export, to the platform’s view kind: a CocoaNSView(RAVET_PLUGIN_VIEW_COCOA) on macOS, anHWND(RAVET_PLUGIN_VIEW_WIN32) on Windows and an X11 Window (RAVET_PLUGIN_VIEW_X11) on Linux. Other view kinds return 1. The web view polls the cache itself (every 50 ms);editor_idledispatches pending GTK work on Linux and does nothing elsewhere.
The processor’s zero-frame synchronization blocks discard any events the processor generates in them.
Modules§
- category
RavetPluginCategoryV1.- edit_
kind RavetPluginEditKindV1.- native_
event_ kind - The processor, event and transport records the table shares with
RavetNativeProcessor.h,RavetNativeEvent.handRavetNativeTransport.h. Stable v1 tags. Note identities and scoped targets retain the full u32 range. - parameter_
flags RavetPluginParameterFlagsV1.- view_
kind RavetPluginViewKindV1.
Structs§
- Native
BusLayout V1 - The processor, event and transport records the table shares with
RavetNativeProcessor.h,RavetNativeEvent.handRavetNativeTransport.h. Prepared main/auxiliary channel counts; unused fixed-array slots are zero. - Native
Event V1 - The processor, event and transport records the table shares with
RavetNativeProcessor.h,RavetNativeEvent.handRavetNativeTransport.h. Fixed C layout matching include/RavetNativeEvent.h. Zero unused fields; scope bits 1/2/4 select channel/key/id (unset means wildcard). detail selects gesture (0 begin/1 end), expression (0 volume,1 pan,2 tuning,3 vibrato,4 expression, 5 brightness,6 pressure), MIDI byte count or UMP word count. MIDI packs its bytes in increasing shifts ofwords[0]; UMP retains numeric words in order. - Native
Processor BusV1 - The processor, event and transport records the table shares with
RavetNativeProcessor.h,RavetNativeEvent.handRavetNativeTransport.h. Addresses of native S* pointer arrays for the originating table’s precision. This is layout-compatible with typed native planar buses. Null arrays are permitted for zero-frame processing and directions with zero channels. - Native
Processor Config V1 - The processor, event and transport records the table shares with
RavetNativeProcessor.h,RavetNativeEvent.handRavetNativeTransport.h. Fixed configuration: version=1, reserved=0, bus count 1..=9; main first. Rate/capacities/layouts follow NativeAudioAdapter limits. Unused buses are zero. - Native
Processor Result V1 - The processor, event and transport records the table shares with
RavetNativeProcessor.h,RavetNativeEvent.handRavetNativeTransport.h. A process result is always rewritten when its pointer is valid. Status is 0 Continue, 1 Silence, 2 Fault; event count is zero on every fault. - Native
Processor Timing V1 - The processor, event and transport records the table shares with
RavetNativeProcessor.h,RavetNativeEvent.handRavetNativeTransport.h. Prepared latency/tail declaration, without causing host restart or draining. tail_kind is 0 None, 1 finite samples, 2 Infinite; unused samples are zero. - Native
Transport V1 - The processor, event and transport records the table shares with
RavetNativeProcessor.h,RavetNativeEvent.handRavetNativeTransport.h. Fixed C layout matching include/RavetNativeTransport.h. Unavailable fields and reserved are zero. Optional positions/tempo remain unknown rather than guessed. Values retain full i64/f64/i32 ranges within their semantic contract; no fixed-point conversion, rescaling, rounding or extrapolation occurs. - Ravet
Plugin Auxiliary BusV1 RavetPluginAuxiliaryBusV1.- Ravet
Plugin Edit V1 RavetPluginEditV1.- Ravet
Plugin Entry V1 RavetPluginEntryV1: the table returned byravet_plugin_v1. Seeinclude/RavetPlugin.hfor each function’s contract.- Ravet
Plugin Layout V1 RavetPluginLayoutV1.- Ravet
Plugin Parameter V1 RavetPluginParameterV1.- Ravet
Plugin Product V1 RavetPluginProductV1.
Constants§
- PLATFORM_
VIEW_ KIND - The view kind
editor_openaccepts on this platform. - VERSION
- Table version written to
RavetPluginEntryV1::version.
Functions§
- with_
denormal_ mode⚠ - Execute a C callback inside
ravet_native_dsp::ScopedDenormalMode. Mode 0 preserves the current mode, 1 flushes denormal operands and results. Returns 0 after the callback, 1 for invalid mode/null callback, or 2 if the actual floating-point environment refuses the scope (callback not invoked). The prior control and sticky status are restored before returning. This bounded call allocates nothing and supports nested calls on the same thread. Exported byexport_plugin!asravet_plugin_with_denormal_mode_v1.