Skip to main content

Module protocol

Module protocol 

Source

Structs§

MidiEvent
Fixed-size MIDI event (16 bytes, 16-byte aligned).
ParameterEvent
Fixed-size parameter change event (16 bytes, 16-byte aligned).
ShmHeader
Shared-memory header (256 bytes).
TransportState
Transport state block (256 bytes).

Constants§

AUDIO_BUFFER_SIZE
AUDIO_OFFSET
Audio buffers start after the control area.
CONTROL_OFFSET
Control area starts right after the header.
CONTROL_SIZE
ECHO_READ_IDX_OFFSET
ECHO_RING_OFFSET
ECHO_RING_SIZE
ECHO_WRITE_IDX_OFFSET
HEADER_SIZE
LAYOUT_SIZE
Total bytes actively used by the protocol layout.
MAGIC
Magic number: “MAOL” in big-endian ASCII.
MAX_BLOCK_SIZE
Maximum audio block size in samples.
MAX_CHANNELS
Maximum number of audio channels (main + sidechain combined).
MIDI_READ_IDX_OFFSET
MIDI_RING_OFFSET
MIDI ring buffer.
MIDI_RING_SIZE
MIDI_WRITE_IDX_OFFSET
NUM_BUSES
Number of audio buses (main + sidechain).
PARAM_EVENT_GESTURE_BEGIN
PARAM_EVENT_GESTURE_END
PARAM_EVENT_MOD
PARAM_EVENT_VALUE
PARAM_READ_IDX_OFFSET
PARAM_RING_OFFSET
Parameter ring buffer.
PARAM_RING_SIZE
PARAM_WRITE_IDX_OFFSET
RING_CAPACITY
Capacity of each ring buffer in slots (power of two).
SCRATCH_OFFSET
State blob scratch area.
SCRATCH_SIZE
SHM_SIZE
Total shared-memory allocation size (4 MiB, page-aligned).
TRANSPORT_OFFSET
Transport state block (256-byte aligned from here).
TRANSPORT_SIZE
VERSION
Current protocol version.

Functions§

audio_channel_ptr
Returns a pointer to a specific channel/bus plane.
audio_ptr
Returns a pointer to the audio buffer region.
echo_indices
Returns pointers to the echo ring write/read atomics.
echo_ring_ptr
Returns a pointer to the echo ring buffer slot array.
header_mut
Returns a mutable reference to the header.
header_ref
Returns a reference to the header at the start of the mapping.
init_shm_layout
Zero-initialize the entire shared-memory region and write the header.
midi_indices
Returns pointers to the MIDI ring write/read atomics.
midi_ring_ptr
Returns a pointer to the MIDI ring buffer slot array.
param_indices
Returns pointers to the parameter ring write/read atomics.
param_ring_ptr
Returns a pointer to the parameter ring buffer slot array.
scratch_ptr
Returns a pointer to the scratch buffer region.
transport_mut
Returns a mutable reference to the transport state.
transport_ref
Returns a reference to the transport state.
wait_for_ready
Wait (spin + yield) until ready becomes non-zero or timeout elapses.