Standalone and remote control — the instrument without a DAW, adjusted from a phone
Status
Planned, ADR-0008 (proposed). Comes after the piano sounds right (roadmap M3); the shared parameter crate comes earlier, before the editor grows.
The picture
MIDI keyboard ──USB──┐ ┌── phone / tablet / laptop (browser)
▼ │ Dioxus web UI (WebAssembly)
┌─────────────────────┐ Wi-Fi │
│ standalone │◀──WebSocket┘
│ midir → engine ─→ cpal ──▶ audio interface ──▶ speakers
│ web server (UI files + /ws)
│ crates/params (same as plugin)
└─────────────────────┘
PC or Raspberry Pi 3 phone (optional): Bluetooth LE MIDI → notes, CCsCrates
| Crate | What |
|---|---|
crates/params | The parameter description shared by every front end: id (stable forever), name, range, unit, default, group, smoothing/recompute class, text formatting. Also the state format. No UI, no CLAP. |
crates/dsp | Unchanged: the engine, driven by events (ADR-0002). |
crates/piano | The CLAP plugin; its params extension and egui editor read crates/params. |
crates/standalone | Binary: audio via cpal, MIDI via midir, the engine on the audio callback, a small web server (e.g. axum) serving the UI and a WebSocket. Headless; settings in a file. |
web/ (or crates/remote-ui) | Dioxus web app, built to WebAssembly and embedded in the standalone binary. |
Control protocol (sketch)
JSON over one WebSocket: the server sends the parameter list (from crates/params) and current values on connect, then every change from any source (UI, MIDI CC, other clients); clients send set messages (and gesture begin/end). The audio thread never touches the socket: changes go through the same lock-free paths as the plugin’s GUI (Piano 13).
Security: listen on the local network only; a short pairing code shown on first start (or in the log) before a client may change anything; no internet exposure.
Raspberry Pi
- Hardware: Raspberry Pi 3 (4 × Cortex-A53 @ 1.2 GHz, 1 GB RAM) with a USB audio interface or an audio HAT; the built-in audio output is not good enough.
- Latency: with a USB interface and small buffers (64–128 frames at 48 kHz) a few milliseconds of output latency are realistic; a real-time kernel (PREEMPT_RT, mainline since Linux 6.12) and CPU governor
performancehelp. - CPU: measured on the Pi (T-011 §4): ~2.25 ns per resonator-sample for the bare banks, ~5.35 for the whole engine (T-055): on one core only Medium fits at peak (High ~126 %, Ultra ~3 cores), so multithreading across keys (T-024) or a quality cap is required there. P-004.
- Network: joins a Wi-Fi network, or runs its own hotspot when there is none.
- Build: cross-compile for
aarch64-unknown-linux-gnu(Nix cross orcross), or build on the Pi — a full release build of the workspace OOMs on 1 GB RAM, so on the Pi build only the needed crates withCARGO_BUILD_JOBS=2(T-028 D1); a Nix package output for the standalone binary.
Bluetooth
Only Bluetooth LE MIDI: phones and BlueZ speak it, so a phone MIDI app (or a BLE MIDI keyboard) can play notes and send controllers, which map to parameters through MIDI learn. Settings and anything beyond controllers go through the web UI.
Not planned
- An Android or iOS app (ADR-0008): a phone is a browser remote.
- Exposing the instrument to the internet.