Skip to content

Compose

Compose treats executable TypeScript as the primary creative surface. The arrangement and clip detail stay visible as compact projections, while the remembered Browser and Inspector rails recede in source-focus mode.

Source Lens connects the selected musical object to its stable source identity:

  • object kind and label;
  • exact file and one-based line range;
  • reveal in source;
  • audition the owning section;
  • the primary active playback source, simultaneous source count, and bar progress.

Playback highlighting follows the output-aligned audio clock, not scheduler lookahead. Primitive pattern events retain portable source provenance through combinators. Studio resolves each successfully scheduled event to the most specific stable identity it can prove: an exact notes() literal, otherwise the pattern, otherwise the section. Chords and overlapping tracks can highlight several ranges at once; custom patterns without provenance fall back honestly.

CodeMirror, Arrangement, Clip Detail, Piano Roll, Session, Browser, Inspector, waveform regions, and collaborator presence exchange stable source ids through one selection store. Yjs relative positions keep a selected range attached as nearby text moves.

Selecting a visual object reveals its source. Selecting source highlights the corresponding projection. Visual edits re-locate the live AST by semantic id before applying an exact Yjs transaction, so stale compile offsets cannot target unrelated code.

Direct manipulation is available only where the source can be changed without changing its meaning accidentally. Plain grid slots, note literals, supported automation constructors, device values, regions, and bounded object edits can write back. Computed expressions stay source-only and explain why they are locked.

Compile errors preserve last-good playback. The source revision and compiled revision remain separate until the new program stages successfully.

The MCP get_status result includes:

{
"studio": {
"canvas": "compose",
"sourceFocus": true,
"activeFile": "main.ts",
"selected": {
"sourceId": "track:bass:effect:0",
"kind": "effect",
"file": "main.ts",
"line": 18,
"column": 14
},
"playback": {
"sourceId": "pattern:melody.ts:lead:note:3",
"kind": "note",
"file": "melody.ts",
"line": 12
},
"playbackSources": [
{
"sourceId": "pattern:melody.ts:lead:note:3",
"kind": "note"
},
{
"sourceId": "section:drop:track:bass:pattern:0",
"kind": "pattern"
}
]
}
}

This is the same Source Lens context the human sees. When compiledContextStale is true, the ranges belong to the last good compile and the agent must read the current source before changing it.