rill-patchbay
Automation and control system — LFOs, envelopes, sequencers, sensors, servos, and event mapping for the Rill audio graph.
Architecture
Two-thread design. Automata run on the control thread (green threads
via tokio) and communicate with the audio thread through lock-free
MpscQueue<ParameterCommand>.
Control thread (tokio):
Automaton ── mpsc<f64> ──→ PortCombiner ── MpscQueue ──→ Audio thread
UI/MIDI ── mpsc<UiCmd> → PortCombiner ── MpscQueue ──→ Audio thread
Sequencer ◀── crossbeam<Telemetry> ◀──────────────────── Audio thread
Key components
- Automata —
LfoAutomaton,EnvelopeAutomaton,RandomWalkAutomaton,SequencerAutomaton,FunctionAutomaton,CellularAutomaton - PortCombiner — sits between automaton and audio thread. Resolves
conflicts between automaton output and UI/MIDI/OSC input using
ControlStrategy(Absolute / Modulation) andConflictStrategy. - Sequencer —
SnapshotSequencerdriven by clock ticks from the audio thread via crossbeam channel.SequencerHandlefor start/stop/reset. - Servos — apply automaton signals to graph node parameters via
ParameterMapping(Linear, Exponential, Logarithmic, Inverted, Custom). - Sensors — acoustic (pitch, envelope follower), physical (knobs, buttons), MIDI, CV.
- Event mapping — MIDI CC → parameter, OSC address → parameter, with transforms.
Engine— centralised API for adding automata, servos, mappings, green threads, and port combiners (fkaPatchbayControl).Manager— high-level coordinator with per-port cancellation domains.
Usage
use ActorRef;
use *;
let = new_pair;
let mut engine = new;
engine.add_lfo;
engine.add_envelope;
engine.update;
Feature flags
| Feature | Description |
|---|---|
serde |
Serialization support (JSON/CBOR) |
json |
serde + JSON serialization |
cbor |
serde + CBOR serialization |
serialization |
json + cbor |
Dependencies
rill-core— node traits, queues, typescrossbeam-channel,parking_lot,tokio— green thread infrastructure
Links
- Repository: https://github.com/DigitalRats/rill
- Documentation: https://docs.rs/rill-patchbay