Skip to content

Clip detail

The Clip detail panel is the studio’s bottom workspace for the selected section. It has two modes: an overview of every lane in the section (a stacked lane grid plus the section’s automation curves), and a focused track view (a piano roll + velocity lane). It is the most interactive projection — several of its controls write straight back into your code.

  • Lane grid (the “all” overview): one row per track, the dry-run events of the section drawn on the beat grid, plus any audio-clip blocks.
  • Piano roll (focus a track): pitch × time with a keyboard column, octave lines, and a velocity lane below.
  • Automation list: one row per automation curve in the section — a sparkline of the sampled curve plus its editable arguments.

This panel embodies the bidirectional promise: edit the projection, the code changes.

Piano roll → notes([...]) literals. When a lane’s single pattern maps to a plain notes([...]) literal in main.ts, the roll is editable:

  • Click an empty cell to add that pitch at the step (padding the array with nulls past its end).
  • Click a note to remove it (null = rest).
  • Drag a note vertically to transpose it (written on release).

Each edit is one Yjs transaction on the same document the editor is bound to. Anything the roll can’t safely edit — a computed pattern, a transformed pattern, multiple patterns on one lane — renders locked with a reason rather than silently editing the wrong indices. Computed code stays code.

Automation rows → curve literals. A curve built from a single value / ramp / sweep / sine call with plain numeric literals (or bars(n) / beats(n) wrappers) shows each argument as a scrub/select control:

  • Drag a number to scrub (0.01 steps; shift for coarse whole steps), double-click to type.
  • sweep’s lin / exp is a select.

The write preserves your wrappers and quote style, replacing only the literal. Computed curves, or two curve calls on one line, lock the row with the reason.

This is the same lock-with-reason pattern used in Devices: a value is editable from the UI only when it maps cleanly to a literal in the source; otherwise it stays read-only and tells you why. The piano roll is write-back for notes() first — fuller automation and pattern write-back grow from there.