subsequence.web_ui¶
Browser dashboard for a running composition.
Serves a read-only web UI that shows the live state of a composition —
tempo, current chord, section, pattern grids, and conductor signals —
over a local HTTP + WebSocket pair. Started via composition.web_ui().
Module Contents¶
- class subsequence.web_ui.WebUI(composition: Any, http_port: int = 8080, ws_port: int = 8765, ws_host: str = '127.0.0.1', http_host: str = '127.0.0.1')[source]¶
Background Web UI Server. Delivers composition state to connected web clients via WebSockets without blocking the audio loop, and serves the static frontend assets via HTTP.
Both servers bind to localhost (127.0.0.1) by default. Pass an explicit
http_host/ws_host(e.g. “0.0.0.0”) to opt into LAN exposure: the dashboard is read-only (inbound WebSocket messages are discarded) but it broadcasts full composition state, so only expose it on a trusted network.Prepare the dashboard servers without starting them; call start() to go live.