Skip to main content

Module protocol

Module protocol 

Source
Expand description

The wire protocol between ferraus and a plugin host process (ferraus-plughost for CLAP, ferraus-plughost-vst3 for VST3). See PROTOCOL.md in this crate for the full spec.

  • Control: length-prefixed JSON frames (u32 little-endian byte length, then UTF-8 JSON) on the host’s stdin (requests) and stdout (replies). Exactly one reply per request, in order. The host’s own stdout is redirected to stderr before any plugin code runs, so a chatty plugin can never corrupt the stream.
  • Audio: a memory-mapped temp file created by the client, holding a 64-byte header and a ring of slots blocks; each slot has planar f32 input channels followed by planar output channels of block_size frames.

This module has no dependency on ferraus-core, so the host binaries link only this.

Structs§

Descriptor
What a plugin declares about itself (no instantiation needed).
NotePortInfo
ParamAssign
name=value as given on the command line.
ParamInfo
One parameter, with its range in plain (plugin) units.
ParamValue
A parameter’s value after a set/get.
PluginInfo
Everything ferraus needs after instantiation.
PortInfo
PresetInfo
ShmLayout
Geometry of the shared-memory audio file.

Enums§

Event
A sample-accurate event inside one block.
Reply
Host → client.
Request
Client → host.

Constants§

MAX_FRAME
Largest accepted frame (64 MiB): states and preset lists are the only big payloads.
PROTOCOL_VERSION
Bumped on any incompatible change to the messages or the shared-memory layout.
SHM_HEADER
Size of the shared-memory header in bytes.
SHM_MAGIC
First 8 bytes of the shared-memory file.

Traits§

ParamText
Hooks into a plugin’s own text conversion.

Functions§

f32_slice_mut⚠
View n f32 values at byte offset off of a mapped region.
find_param
Find a parameter by stable id (12, id:12) or display name (exact, case-insensitive, punctuation-insensitive, or module/name).
infer_unit
The unit suffix of a display string: "-6.00 dB" → dB.
read_frame
Read one frame. Ok(None) on a clean end of stream before a frame starts.
resolve_value
Convert a ferraus value string to the plugin’s plain value: norm:x, the plugin’s own text parser (with unit-spelling variants), a plain in-range number, or a stepped label.
text_candidates
Text variants to try against a plugin’s text_to_value for a ferraus-style value. "2.5kHz" yields ["2.5kHz", "2500 Hz", "2500Hz", "2500", "2.5 kHz", "2.5"].
write_frame
Write one frame: u32 LE length followed by the JSON bytes.