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 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.
Engine— centralised API for adding automata, servos, and mappings (fkaPatchbayControl).
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 |
midi |
MIDI input via rill-io backends |
osc |
OSC input via rill-osc |
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