Token stream demo
Offline demo of streaming deck into the hub.
End-to-end flow:
services/token-stream-demo(Tish) connects to the gateway as actorstream-demo.- For each cycle it sends
deck.stream_chunk(single characters) so the Co-DJ panel shows a live “token” preview. - Then it sends
deck.blockwithasap: trueso the patch applies immediately (no perf-step queue). - You Play in the app to hear WsKick / WsHat / WsBass on channel ids
wsdemo_k1/wsdemo_h1/wsdemo_b1(the demo cycles rotating kick, hat, and bass variations).
Run
# Terminal A
npm run gateway # from repo root (Tish gateway)
# Terminal B
npm run token-demo # from repo root (runs Tish stream demo)
Open the app (e.g. npm run serve → http://localhost:3456), go to Co-DJ, Connect (session default), click Play.
Human in the loop
- Open Song and edit steps / mix on
wsdemo_k1orwsdemo_h1, then Apply (human lane). That sets human ownership on those tracks. - After that, the stream service no longer overwrites those tracks (lane rules in
Merge.tish), but it still updates any tracks it still owns. - Add your own tracks in Song as usual; they stay yours.
Env
| Variable | Default | Meaning |
|---|---|---|
CODJ_HUB | ws://127.0.0.1:35987 | Gateway base URL |
CODJ_SESSION | default | Session id (must match browser) |
STREAM_INTERVAL_MS | 5000 | Interval between deck updates (ms) |
TOKEN_CHUNK_MS | 15 | Delay between stream chunks (ms) |