rill-patchbay
Automation and control system — LFOs, envelopes, sequencers, sensors, servos, and event mapping for the Rill signal graph.
Architecture
Two-thread design. Automata run inside Servos on the control thread
(tokio actors) and communicate with the signal graph through lock-free
actor mailboxes (ActorRef<CommandEnum>).
Control thread (soft-RT): Signal thread (hard-RT):
┌──────────┐ ┌──────────┐
│ Automaton│ │ Sensor │ ┌──────────────────┐
│ (LFO,ENV)│ │(MIDI,OSC)│ │ I/O callback │
└────┬─────┘ └────┬─────┘ │ actor.drain() │
│ │ │ generate() │
▼ ▼ │ process() │
┌──────────────────────────┐ ClockTick │ propagate() │
│ Servo │◄───────────────│ │
│ automaton.step() │ └────────▲─────────┘
│ mapping.apply() │ │
│ strategy: control+ │ SetParameter │
│ conflict │─────────────────────────┘
└──────────────────────────┘
Conflicts between automaton output and HID input (MIDI knob, OSC fader)
are resolved inside the Servo via ControlStrategy and ConflictStrategy.
See strategy.rs.
Key components
- Automata —
LfoAutomaton,EnvelopeAutomaton,RandomWalkAutomaton,SequencerAutomaton,FunctionAutomaton,CellularAutomaton - Servos — bridge automatons to graph node parameters via
ParameterMapping(Linear, Exponential, Logarithmic, Inverted, Custom). Also apply sensor event mappings (MIDI CC → param, OSC address → param). Built-in conflict resolution viaControlStrategy(Absolute / Modulation) andConflictStrategy(TouchOverride / BasePlusModulation / LastWriteWins). - Sensors — acoustic (pitch, envelope follower), physical (knobs, buttons), MIDI, OSC (UDP-based address/argument sensors).
- Event mapping — MIDI CC → parameter, OSC address → parameter, with transforms.
Servo— centralised API for bridging automatons to graph parameters, adding mappings, and handling sensor events (fkaPatchbayControl).
Usage
use Arc;
use CommandEnum;
use ;
use *;
let system = new;
let = ;
let lfo = new;
let servo = new;
let _lfo_ref = servo.spawn;
let env = adsr;
let servo_env = new;
let _env_ref = servo_env.spawn;
graph_actor.drain;
Feature flags
| Feature | Description |
|---|---|
serde |
Serialization support (JSON/CBOR) |
json |
serde + JSON serialization |
cbor |
serde + CBOR serialization |
serialization |
json + cbor |
midi |
MIDI input via rill-io backends |
osc |
OSC input via rill-osc |
debug |
Control-path inspection (PatchbayInspector, automaton/sensor snapshots) |
Debug infrastructure (debug feature)
PatchbayInspector— collects automaton and sensor snapshots for control-path debugging. Automata report enabled/disabled state, current output value, and internal state (time, phase). Sensors report connection status and event count.Servo::inspector()— returns anAutomatonInspectorthat snapshots the servo's internal state viaArc<Mutex<ServoState<A>>>OscSensor::inspect()/MidiHub::inspect()— capture sensor status (connected, tracker active) for the debugger
Dependencies
rill-core— node traits, queues, typesrill-core-actor— actor model for lock-free message passingtokio— green thread infrastructure
Links
- Repository: https://github.com/DigitalRats/rill
- Documentation: https://docs.rs/rill-patchbay