Deckard

Token stream demo

Offline demo of streaming deck into the hub.

End-to-end flow:

  1. services/token-stream-demo (Tish) connects to the gateway as actor stream-demo.
  2. For each cycle it sends deck.stream_chunk (single characters) so the Co-DJ panel shows a live “token” preview.
  3. Then it sends deck.block with asap: true so the patch applies immediately (no perf-step queue).
  4. 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_k1 or wsdemo_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

VariableDefaultMeaning
CODJ_HUBws://127.0.0.1:35987Gateway base URL
CODJ_SESSIONdefaultSession id (must match browser)
STREAM_INTERVAL_MS5000Interval between deck updates (ms)
TOKEN_CHUNK_MS15Delay between stream chunks (ms)