Repository navigation
Collaborative Jamming
Tompouce has an experimental Jam mode for playing together over the network: each player runs their own Tompouce, and a small room server (the director) keeps everyone's code and timing in sync. Everyone hears the same mix because every client evaluates the same shared program at the same shared instant.
The public room server is Bakery, with step-by-step setup guides for hosting a room, joining with a link or join code, picking a nickname, playing on a LAN, and recovering from a dropped connection.
Private rooms are end-to-end encrypted. The director relays ciphertext and never learns the room key; invite links carry the key in the URL fragment, which browsers never send to a server. Public lobbies are plaintext and reset when empty. See how encryption works, privacy and rules & abuse.
Jam mode is ready for small experiments, not for a live set. Working today:
- the standalone director (
tompouce-director, built with-DWITH_DIRECTOR=ON); - encrypted transport, room admission, roles/ACLs, reconnect and opaque persistence;
- rooms, owner-signed invites, invite/owner-link joins and join codes;
- shared-document typing updates, reconnect diffs and focused editor synchronization;
- staged program activation with a no-rewind late path;
- clock synchronization with epsilon, drift, maximum delay and audio-fit status;
- dual-stack LAN discovery over mDNS with a UDP fallback;
- remote cursors and selections in the focused slot;
- per-slot capability gates for OSC and MIDI output;
- native director TLS with certificate verification;
- the sandboxed
/hydravisualizer; - the Bakery front door, web invitation pages and guides.
Remaining work includes the long-running soak and full acceptance pass,
managed local hosting, and the Flok bridge. The full design brief is
docs/multiplayer.md;
TODO.md tracks the milestones.
Build with collab support (libcurl 8.11 or newer with WebSocket support):
cmake --preset default
cmake --build --preset default --parallel 4 --target tompouce-director tompouce
./build/tompouce-director --listen 127.0.0.1:7420Connect a client, then host from the TUI:
./build/tompouce --collab ws://127.0.0.1:7420/v1 --collab-nick your-name/collab host
/collab invite editor --link
/collab host reconnects to the last director automatically. Leave the
current room first; hosting while joined is rejected before a new room is
created. Share the printed invite link only through a private channel.
--join LINK validates an invite or owner link, shows the host, room and owner
fingerprint, asks for consent, then connects and joins. Owner links also save
the owner key as a mode-0600 room file. :join LINK, /join LINK and
/collab join LINK use the same flow in the TUI.
Automated runs can pass --noconfirm or set TOMPOUCE_NOCONFIRM=1 to skip both
startup and interactive consent prompts. The explicit host allowlist still
applies.
A LAN director needs no public server, DNS or Avahi:
tompouce-director --listen 0.0.0.0:7420 --insecure-lan \
--node-name living-room \
--lobby living-room=<26-char-base32-room-id>On each client:
/collab scan
/collab scan 1
/collab join 1
The scan lists one entry per director fingerprint and port, even when the same
director announces IPv4 and IPv6 over both mDNS and UDP. It prefers mDNS and
then IPv4 for the room-list endpoint. Public lobbies show their room id;
private rooms show invite required and must be joined with an invite link.
Discovery never carries room keys or invite secrets. Use a trusted network: public lobbies and LAN control traffic are plaintext, while private-room content remains end-to-end encrypted.
/collab status reports clock epsilon, drift, maximum delay and the audio fit.
A healthy LAN room is normally well below 1 ms epsilon with zero re-anchors;
Bakery is typically a few milliseconds. Remote cursors and selections appear
only for the focused slot, with short nickname tags at the cursor lines.
Three-host LAN and Bakery smoke runs on 2026-12-06 applied owner and guest
evaluations on every client with zero re-anchors. The manual alignment
procedure and results log are in
docs/collab.md.
Jam mode is shaped by people actually trying to play together. Bugs go in Issues with reproduction steps; musical experiments, session reports and ideas go in Discussions. Latency feel, solo behavior and recovery are the areas where player feedback matters most right now.