› cavi-ai/
GitHub ↗

Record a Session performance into Arrangement

Retrieve record-session-arrangement through get_producer_workflow in the all profile, or open its MCP prompt. This captures user or agent clip/scene choices as Arrangement clips. Live records Session launches into Arrangement; this differs from recording incoming audio or MIDI into an armed track.

The default collaborative mode resolves the performance brief and launch cues with the user. autonomous lets the agent choose Session combinations and transitions within the request. Neither mode authorizes unrelated edits, deleting existing material, saving or claiming that a performance sounds better.

Prepare the performance

Read get_session_arrangement_recording without an ID. It lists retained handles and supplies a preparation context with current controls, native barPosition, Arrangement clip metadata and appendAfterBeats. Inspect existing recordings before starting another. Inventory errors remain explicit; they do not mean an empty Arrangement.

Choose a stopped startBeats at or after every existing Arrangement clip end on every ordinary track, then an increasing endBeats. Live can start recording on an earlier musical grid boundary, so the start must already be a native bar start (beats: 1, sub_division: 1, ticks: 1), also aligned with the global 2-, 4- or 8-bar launch grid when selected. Verify the native barPosition after seeking; current meter alone does not establish historical bar positions. The span supports at most 512 quarter-note beats and 300 seconds at the current tempo. This is an append operation. Earlier sections, occupied ranges and future clips are preserved by refusing those destinations; a retake uses another empty tail. Existing automation is not inspected or backed up.

Resolve exact Session material, clip timing and complete scene rows, including Groups, empty stop buttons and tempo/meter overrides. All explicit and implicit arms must be off. Do not disarm unrelated tracks to pass a check. Resolve existing recording and pending launches first. Prepare authorized global loop/punch and automation-arm changes with fresh plans and readback; loop, punch-in/out, automation arm and Session recording must be off. Supported count-in and Arrangement overdub settings are retained.

Rehearse an initial combination if wanted. Stop transport, seek to the exact append start with set_transport_recording_context, and verify the stopped playhead before starting. A retained Session combination can resume when playback starts; inspect what is actually selected. Launches made later can leave an initial gap. Bar requests require actual meter and phrase context; current meter does not establish historical bar positions across meter changes.

Record and observe

Plan record_session_arrangement with exact startBeats, endBeats and fresh expectedStateVersion. Review its entire bound context, then execute the unchanged confirmation. The bridge rechecks native document, tracks, Session slot/clip identities, Arrangement metadata, arms and controls at undo entry. It checks scope again between the record-mode and playback commands. It supports 256 tracks, 16384 Session slots, 8192 Arrangement clips and 16 retained handles. Session notes, file bytes, device processing and automation contents are not bound or compared.

The command sets Live's insert marker to the requested start and verifies it together with the stopped playhead and recording scope before enabling global Arrangement recording and starting playback. The insert marker remains at that start after stopping; current song time alone does not establish the native playback start. Retain recordingId; native state can settle on later ticks. While active, use requested user cues or fresh guarded clip/scene launches. These choices and tempo/meter changes are expected. Mixer/device gestures are not requested as automation, and this does not render new audio or record a live input performance.

The bridge's main-thread display tick requests global record/transport stop when the song reaches the requested endpoint, or after 300 wall-clock seconds while scope remains owned. It continues after MCP client disconnect. Count-in, tempo changes, display latency and pending commands can leave gaps, partial clips or endpoint overhang. This is not sample-accurate scheduling or a hard real-time stop guarantee. Report actual clip positions; do not silently trim them.

Changing track identities, arms, freeze state, global launch quantization, the insert marker or the bound recording controls relinquishes ownership. The bridge leaves that new scope untouched, which can leave global recording active. It does not automatically restore preparation controls or undo recorded material. Scope is checked between commands, but native commands and concurrent manual edits are not one atomic transaction.

Stop, reconnect and listen

Read get_session_arrangement_recording by ID. Inspect status, countingIn, arrangementRecordObserved, recordingActiveObserved, stopVerified, capturedClipsAvailable, inspectionError, controlError, capturedClips, originalClipMetadataPreserved and cleanup/start errors separately. Inspection checks each track's original clip prefix before identifying its appended clips; replaced, reordered or missing originals make capture inspection uncertain while leaving guarded stop controls available. A stopped handle or nonempty clip list does not prove a completed musical performance or audible output; performanceVerified stays false. Metadata preservation covers exposed clip records, not original notes, envelopes, file bytes or hidden state.

For an early stop, freshly confirm finish_session_arrangement_recording with cancel: true. Growing clips and advancing song time do not invalidate stop confirmation. Unconfirmed starts retain a cancellation request until native start observation and stop settling; released: false is unresolved work. Bridge shutdown during a pending start also retains unresolved cancellation. A bridge unload or Live restart removes the display observer; inspect current recording directly rather than assuming cleanup happened.

After a timeout or disconnect, list retained handles before any new start. Never replay an uncertain start or globally undo over manual edits. Handles are runtime state and may be missing after bridge reload/restart. Their absence does not prove that recording stopped or material is absent. Changed ownership needs a fresh explicit recording/stop scope. Clip-inventory failures remain inspectable without blocking a guarded owned stop.

Verify actual record/transport stop, new clips, complete MIDI notes or audio source/timing, and preserved Session originals. Keep partial takes and report empty captures honestly. To audition the result, return only the captured tracks to Arrangement with return_tracks_to_arrangement, then use audition_arrangement_passage over the observed range under listening authority. Session overrides do not automatically hand playback back. Ask what the user hears. Release a settled inspected handle without cancellation, restore only still-owned preparation changes, and report remaining playback/overrides. Saving retains its own scope.