Skip to main content

Crate rill_patchbay

Crate rill_patchbay 

Source
Expand description

§Rill Patchbay — Event routing and automation

rill-patchbay is the evolution of rill-automation from version 0.2.0, merged with the mapping functionality from rill-control.

§Core components

  • Automatons — generative signal sources (LFO, envelopes, sequencers)
  • Servos (in the control module) — connect automatons to node parameters
  • Mappings — connect external events (MIDI/OSC) to parameters
  • Sensors — event sources from the external world
  • Manager — central coordinator for dual-thread architecture

§Architecture

┌─────────────────────────────────────────────────────────────┐
│                     CONTROL THREAD                         │
│                                                              │
│  ┌─────────────────────────────────────────────────────┐   │
│  │               Manager                         │   │
│  │  ┌────────────┐  ┌────────────┐  ┌────────────┐     │   │
│  │  │  Automatons │  │  Servos    │  │  Mappings  │     │   │
│  │  └────────────┘  └────────────┘  └────────────┘     │   │
│  │                    │                │                │   │
│  │                    ▼                ▼                │   │
│  │              ┌──────────────────────────┐           │   │
│  │              │   RtQueue<ParameterCommand>│         │   │
│  │              └──────────────────────────┘           │   │
│  └─────────────────────────────────────────────────────┘   │
│                              │                               │
│                              │ non-blocking queue              │
│                              ▼                               │
│  ┌─────────────────────────────────────────────────────┐   │
│  │                  SIGNAL THREAD                          │   │
│  │              (rill-graph / rill-io)                  │   │
│  └─────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────┘

Re-exports§

pub use module_def::ClockDef;
pub use sensor::Sensor;
pub use automaton::sequencer::PlayMode;
pub use automaton::sequencer::SequencerAutomaton;
pub use automaton::sequencer::Step;
pub use automaton::EnvelopeAutomaton;
pub use automaton::EnvelopeStage;
pub use automaton::EnvelopeType;
pub use automaton::FunctionAutomaton;
pub use automaton::LfoAutomaton;
pub use automaton::LfoWaveform;
pub use automaton::Range;
pub use automaton::StatefulFunctionAutomaton;
pub use automaton::SyncMode;
pub use automaton_task::spawn_automaton_task;
pub use engine::midi_cc;
pub use engine::midi_note;
pub use engine::osc_address;
pub use engine::Automaton;
pub use engine::BoxedModule;
pub use engine::Mapping;
pub use engine::Module;
pub use engine::NoAction;
pub use engine::OscSurface;
pub use engine::OscSurfaceEntry;
pub use engine::ParameterMapping;
pub use engine::Servo;
pub use engine::Target;
pub use engine::Transform;
pub use strategy::ConflictStrategy;
pub use strategy::ControlStrategy;

Modules§

automaton
Automatons — generative control sources Automatons — generative control-signal sources.
automaton_task
Automaton wrapper in a green thread (tokio task)
buffer_prelude
Prelude for working with buffers
engine
Control and event mapping Control and automation subsystem.
external
Common third-party types that are frequently used with Rill
f32_prelude
Prelude for working with f32 samples (common case)
f64_prelude
Prelude for working with f64 samples (high precision)
function_registry
Named function registry for serialization
module_def
Rack module type definitions (always compiled) Rack module type definitions.
module_factory
Custom module factory — type registry for rack module construction Module factory — type-registry for modular rack module construction.
observer
Micro-control observer for RT safety monitoring Micro-control observer — RT safety monitor with actor-based telemetry.
param_prelude
Prelude for working with parameters
prelude
Prelude for convenient import of core types
queue_prelude
Prelude for working with queues (automation)
sensor
Sensors — event sources from the external world
servo_constructor
Servo constructor — creates servo actors from ModuleDef descriptors ServoConstructor — creates Servo actors from ModuleDef::Servo descriptors.
strategy
Automaton control strategies
time_prelude
Prelude for working with time
utils
Utilities and helper functions Utility functions and helpers for the patchbay.

Structs§

AlgorithmMetadata
Descriptive metadata for an Algorithm implementation.
AtomicCell
Atomic cell with a fully safe API.
AtomicStats
Atomic statistics for safe concurrent access
BufferStats
Buffer statistics snapshot for monitoring and debugging
ClockTick
A tick of the system clock
ComplexSoa
Four complex numbers, separate re/im arrays. For SIMD‑heavy operations.
ComplexVector
Two complex numbers: [re0, im0, re1, im1] in one 4‑lane vector.
DelayLine
Delay line for signal effects — single-threaded circular buffer.
FanInBuffer
Buffer for mixing multiple producers to one consumer. Single-threaded — use rill_core::queues for cross-thread.
FanOutBuffer
Buffer for broadcasting from one producer to multiple consumers. Single-threaded — use rill_core::queues for cross-thread.
Mat2
A 2x2 column major matrix.
Mat3
A 3x3 column major matrix.
Mat4
A 4x4 column major matrix.
ParamMetadata
Metadata about a parameter
ParamRange
Range constraints for a parameter
ParameterId
Type-safe parameter identifier with validation
Params
A flexible set of parameters passed to a node constructor.
PipeBuffer
Single-producer, single-consumer buffer for intra-graph node connections.
RenderContext
Unified render context — passed by & reference through the entire signal graph during one processing block.
RingBuffer
Fixed-size ring buffer (power-of-two size). Single-threaded.
RtQueue
Main RT-safe queue
ScalarVector1
Scalar vector of 1 element
ScalarVector2
Scalar vector of 2 elements
ScalarVector4
Scalar vector of 4 elements
ScalarVector8
Scalar vector of 8 elements
SliceMut
A mutable slice that supports element-wise +=, -=, *=, /= with another slice or scalar broadcast.
SlicePair
A pair of immutable slices, providing SIMD-accelerated element-wise binary operations that write the result into a pre-allocated output buffer.
SystemClock
High-precision system clock for sample-accurate timing.
TelemetryBlock
Fixed-size telemetry frame for RT-safe ring buffer communication.
Vec2
A 2-dimensional vector.
Vec3
A 3-dimensional vector.
Vec4
A 4-dimensional vector.

Enums§

AlgorithmCategory
Functional category of an algorithm (for introspection / UI).
AtomicCellError
Errors that can occur when creating an AtomicCell.
BufferError
Buffer error types
ControlEvent
Hardware control event from a physical interface (knob, button, fader, etc.).
EventPattern
A pattern for matching controller events.
MidiNoteKind
What aspect of a MIDI note event to extract for mapping.
ParamType
Type of parameter value
ParamValue
Parameter value (can be of different types)
ParameterError
Errors that can occur during parameter operations
ProcessError
Main error type for signal processing operations
QueueError
Errors that can occur during queue operations.
TimeError
Errors that can occur during time and clock operations

Constants§

CACHE_LINE_SIZE
Cache line size for alignment (64 bytes on x86_64)
DEFAULT_BLOCK_SIZE
Default block size for signal processing
DEFAULT_BUFFER_SIZE
Default buffer size for most use cases
DEFAULT_SAMPLE_RATE
Default sample rate (44.1 kHz)
MAX_BLOCK_SIZE
Maximum block size
MAX_BUFFER_SIZE
Maximum buffer size (2^16 = 65536 samples)
MAX_SAMPLE_RATE
Maximum supported sample rate
MIN_BLOCK_SIZE
Minimum block size
MIN_BUFFER_SIZE
Minimum buffer size
MIN_SAMPLE_RATE
Minimum supported sample rate
VERSION
Current version of rill-core

Traits§

Algorithm
Unified processing primitive for ports and DSP blocks.
Buffer
Common interface for all buffer types used in the signal graph.
ClockSource
A source of clock ticks for signal processing
Interpolate
Fractional-index reading with interpolation.
IntoParamValue
Trait for types that can be converted to/from ParamValue
Transcendental
Transcendental operations (sin, cos, sqrt, exp, ln).
Vector
Core trait for vector types (basic operations).
VectorMask
Vector comparison and masking operations.
VectorReduce
Horizontal reduction operations (vector → scalar).
VectorScalarOps
Scalar-vector arithmetic operations.
VectorTranscendental
Trait for vector types with transcendental operations.

Functions§

abs_slice
Element-wise absolute value of a slice
add_scalar_slice
Add a scalar to a slice
add_slices
Element-wise addition of two slices, storing the result in a third
clamp_slice
Element-wise clamp of a slice
cos_slice
Element-wise cosine of a slice
div_slices
Element-wise division of two slices
exp_slice
Element-wise exponent of a slice
ln_slice
Element-wise natural logarithm of a slice
mat2
Creates a 2x2 matrix from two column vectors.
mat3
Creates a 3x3 matrix from three column vectors.
mat4
Creates a 4x4 matrix from four column vectors.
max_slice
Element-wise maximum of two slices
min_slice
Element-wise minimum of two slices
mul_scalar_slice
Multiply a slice by a scalar
mul_slices
Element-wise multiplication of two slices
sin_slice
Element-wise sine of a slice
sqrt_slice
Element-wise square root of a slice
sub_slices
Element-wise subtraction of two slices
tan_slice
Element-wise tangent of a slice
vec2
Creates a 2-dimensional vector.
vec3
Creates a 3-dimensional vector.
vec4
Creates a 4-dimensional vector.

Type Aliases§

BufferResult
Result type for buffer operations
ControlValue
Control signal value type
DefaultClock
Default system clock
DefaultDelayLine
Default delay line with f32 samples
DefaultPipeBuffer
Default pipe buffer with f32 samples
DefaultRingBuffer
Default ring buffer with f32 samples
MonoBlock
Mono signal block type
ParameterResult
Result type for parameter operations
ProcessResult
Result type for signal processing operations
QueueResult
Result type alias for queue operations.
Sample
Default sample type (32-bit float)
StereoBlock
Stereo signal block type (left, right)
TimeResult
Result type for time operations