AUDIO
Source snapshot · 11 November 2026

API reference / ravet_plugin::native

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, an EditQueue for 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 next process delivers dirty values at offset 0, ahead of the host’s events. load_state replaces 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. process and reset never allocate, lock or block. Host parameter values need not be exactly representable as float: 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, reset and timing return 2 (and process silences its outputs) until the next successful prepare, which recreates the processor; parameter, state and editor calls keep working.
  • Editor. editor_open attaches the product’s web editor, with the same editor host as the CLAP export, to the platform’s view kind: a Cocoa NSView (RAVET_PLUGIN_VIEW_COCOA) on macOS, an HWND (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_idle dispatches 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.h and RavetNativeTransport.h. Stable v1 tags. Note identities and scoped targets retain the full u32 range.
parameter_flags
RavetPluginParameterFlagsV1.
view_kind
RavetPluginViewKindV1.

Structs§

NativeBusLayoutV1
The processor, event and transport records the table shares with RavetNativeProcessor.h, RavetNativeEvent.h and RavetNativeTransport.h. Prepared main/auxiliary channel counts; unused fixed-array slots are zero.
NativeEventV1
The processor, event and transport records the table shares with RavetNativeProcessor.h, RavetNativeEvent.h and RavetNativeTransport.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 of words[0]; UMP retains numeric words in order.
NativeProcessorBusV1
The processor, event and transport records the table shares with RavetNativeProcessor.h, RavetNativeEvent.h and RavetNativeTransport.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.
NativeProcessorConfigV1
The processor, event and transport records the table shares with RavetNativeProcessor.h, RavetNativeEvent.h and RavetNativeTransport.h. Fixed configuration: version=1, reserved=0, bus count 1..=9; main first. Rate/capacities/layouts follow NativeAudioAdapter limits. Unused buses are zero.
NativeProcessorResultV1
The processor, event and transport records the table shares with RavetNativeProcessor.h, RavetNativeEvent.h and RavetNativeTransport.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.
NativeProcessorTimingV1
The processor, event and transport records the table shares with RavetNativeProcessor.h, RavetNativeEvent.h and RavetNativeTransport.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.
NativeTransportV1
The processor, event and transport records the table shares with RavetNativeProcessor.h, RavetNativeEvent.h and RavetNativeTransport.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.
RavetPluginAuxiliaryBusV1
RavetPluginAuxiliaryBusV1.
RavetPluginEditV1
RavetPluginEditV1.
RavetPluginEntryV1
RavetPluginEntryV1: the table returned by ravet_plugin_v1. See include/RavetPlugin.h for each function’s contract.
RavetPluginLayoutV1
RavetPluginLayoutV1.
RavetPluginParameterV1
RavetPluginParameterV1.
RavetPluginProductV1
RavetPluginProductV1.

Constants§

PLATFORM_VIEW_KIND
The view kind editor_open accepts 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 by export_plugin! as ravet_plugin_with_denormal_mode_v1.