Skip to content
Documentation

Troubleshooting

Compiling a score, connecting to a model, and hearing audio are separate steps, and each can fail on its own. Find the step that failed from the status or from the operation that rejected, then check the matching section below.

The score does not compile

Read the diagnostic’s line and column. Then check the usual causes: indentation, track names that don’t match a declaration, a missing section length, and the arrangement calls at the bottom. A section that is never called has nothing to play. Diagnostics explains each kind of error and warning.

If you compile with the CLI, a failed compile leaves any earlier output file in place, so an old timeline can still exist.

Shared audio is unavailable

Shared audio depends on the site’s capacity, budget, and session limits, and can be switched off. The demos say when it is busy or off. Try again later, or choose Use your own key. You can keep editing and compiling either way.

Each browser has a daily audio allowance that can be used across sessions. Another session needs at least 30 seconds remaining; when too little is left, the demo asks for your own key, or you can come back tomorrow. Shared audio also needs one cookie to keep turns fair without an account. If this browser blocks it, allow cookies for this site and reload, or use your own key.

Shared audio only works in this site’s demos. Your own application needs its own key or relay.

There is no sound

play() resolves once the connection is open, not when audio is audible. Lyria takes a few seconds more to send its first audio. Watch the browser session’s audio status: buffering means audio is on its way, and playing means it is reaching the speakers. If the queued audio runs out, the status shows stopped until more arrives, then underrun briefly before it buffers again. Check the device’s output and volume too.

If the status never reaches playing, check the audio context. Browsers only let audio start inside a user gesture, so call createBrowserSession before the click handler’s first await, as Run locally does. If browser.context.state is suspended, the browser session also reports a context-suspended warning, and the context needs another user gesture to resume.

A key, connection, or provider request failed

A failure arrives as a GasOperationError with kind provider and a reason. If it happens while starting, play() rejects. If it happens later, the session emits one error event and stops.

reason What to check
auth The key, and whether its project has access to the model. Retrying the same key won’t help.
network The connection and any relay. Check retryable and closeCode.
quota The provider account’s limits. Retrying straight away can make it worse.
provider The provider’s status and your configuration. Retry only if retryable is true.
internal Your application’s code, and the connector’s options.

The Lyria connector never reports quota: a quota limit closes the connection, so it arrives as network or provider. Connection failures lists how Lyria’s close codes are classified. Codes from 4000 to 4999 come from your own endpoint, such as a relay, so your application decides what they mean.

To try again, call play() on the same session. Each Play opens a new connection, and the document and app values stay. If the key was wrong, pass apiKey as a function so the next Play reads the new one, as Run locally does.

The model ignored a valid instruction

A score can be valid GAS and still use intent the model doesn’t act on. Read the warnings returned when the score loads, and those on the session’s warning channel. What Lyria supports lists what Lyria ignores or approximates.

Even supported intent is a direction, not a guarantee. A new flavor changes what the model aims for, not any particular note.

A live change is late or rejected

The model generates ahead, and audio already received plays first, so an accepted change can take a moment to be heard. During playback, a command result’s requestedPosition and appliedPosition show when it was scheduled.

A fragment applies fully or not at all. If it doesn’t parse, or any statement fails, the call rejects and nothing changes. Live text describes the result.

The music doesn’t go back to the score

App values last until your application clears them. Stop, the end of a piece, a failure, and a new document all keep them. Call a clear method, such as clearTempo(), to hand one value back to the score, or clearAppValues() to go back to the plain document. getState().appValues lists what your application holds. App values and the cascade explains how they layer.

Audio continues after leaving the page

Close the browser session on pagehide with browser.close(). It closes the session, the playback, and any audio context it opened; a context you passed in is yours to close. A browser session that finishes starting after the user has left must be closed too, as Run locally does.

With a finite score, the session can report ended: 'finished' before the last received audio has played. Stopping discards that audio; finishing lets it play out.

An import does not resolve

GAS is ESM only. Use a bundler in the browser, and "type": "module" or .mjs files in Node. The root of @luna-estelar/gas exports the session; the browser session, the parser, the protocol and highlighting each have their own subpath, such as @luna-estelar/gas/browser. The Lyria connector is a separate package, @luna-estelar/gas-lyria-rt.

Moving from 0.3 to 0.4

  • The renderer is gone from the API. Pass the connector to createSession({ connector }) or createBrowserSession({ connector }), and pass the key to createLyriaRtConnector({ apiKey }). createRenderer, session.renderer, and the settings option are gone, and the renderer methods are on the session.
  • retryRenderer() is gone. Call play() again on the same session.
  • App values, which 0.3 called overrides, now last through Stop and new documents. Call clearAppValues() where you relied on Stop clearing them.
  • submitLiveCommands applies all or nothing and rejects on failure. There is no ok field.
  • The lifecycle, position, and diagnostic events are gone. Use state and generationPosition, and the browser session’s audiblePosition event in place of its audiblePosition() method.
  • Error kinds are document, command, state, provider, and cancelled.

JavaScript API describes the current session, and Packages and imports lists the current packages.