Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ audio seam ([nooga/let-go#255](https://github.com/nooga/let-go/issues/255)).
The surface is write-only: nothing reads audio state back into lg, so game
logic cannot branch on whether a sound played and replays stay deterministic.
Triggers sent before the music starts are dropped silently.
A theme sent before the music starts waits for it, but it is checked at
once, so a game's tests can check its themes with no audio. A lead or bass
degree outside 0..8, a lead, bass or pulse lane longer than 16 steps, or more
than three drum lanes is an error from `play-theme`. Drum strings are not
checked: they run to 32 sixteenths, and a character other than `X`, `x` or
`o` plays as a rest.

The natives act on a default `letgo.Music`. A Go host that wants to own the
instance creates one with `letgo.NewMusic` and calls `letgo.SetMusic` before
Expand Down Expand Up @@ -294,6 +300,14 @@ ring and posts it to the page, where `webaudio/page.js` plays it. Load that
script before the runtime's own: it wraps the `Worker` constructor to listen on
every worker the page creates. Worker mode needs a cross-origin isolated page.

In worker mode, a program that blocks on input silences the music. let-go's
`term/read-key` under `lg -w` waits on the key ring with no timeout, which
parks the whole worker, so the goroutine that renders stops until a key
arrives ([nooga/let-go#1086](https://github.com/nooga/let-go/issues/1086)).
Until that is fixed, a prompt that should keep the music playing can poll
`term/key-pending?` with a short `sleep` between checks, which lets the
renderer run.

let-go itself may grow a host audio seam; see
[nooga/let-go#255](https://github.com/nooga/let-go/issues/255).

Expand Down
Loading