arrange
Copy Session clips onto the Arrangement timeline at specified beat positions, preserving the source clips so each copy can be edited independently.
Instructions
Copy Session clips onto the Arrangement timeline at beat positions.
Supports two modes:
1. Single placement: specify track, slot, at_beat (and optionally to_track).
2. Batch placements: pass a placements list to duplicate several clips and verify
each one against the destination track it landed on.
A copy, not a move: the Session clip stays in its slot and the two are separate
clips afterwards, so editing one leaves the other alone. This is how a Session
idea becomes an arrangement, and how clip automation written by write_automation
reaches the Arrangement timeline.
Returns:
For single placement: dictionary with placement status, destination track,
clip counts before and after, the beat the clip actually landed on, and the
clip itself under placed_clip. Both modes identify a placement by comparing the
destination track before and after, so a clip that was already on the requested
beat never stands in for one that did not land.
For placements list: dictionary with per-placement requested_beat, actual_beat,
ok, and summary counts.
Note:
Call it once per placement. Repeating the same call adds another copy at the
same beat rather than replacing the first, so a retry after an unclear result
needs the clip count in this answer checked first.
A list retries worse than a single call, not better: a list that half landed
doubles what landed if it is sent again. 'destinations' carries the clip count
per destination track before and after, which is the number to check first.
Use create_clip and write_clip_notes to build the source clip, and
set_arrangement_time then play to hear where it landed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slot | No | Clip slot index in track.clip_slots, counted from 0. A slot index is the scene the clip sits in, so slot 2 is the third scene down. Required if placements is omitted. | |
| track | No | Track index in song.tracks, counted from 0. Required if placements is omitted. | |
| at_beat | No | Where the copy starts on the Arrangement timeline, in beats from the start of the song. Fractional beats are accepted. Required if placements is omitted. | |
| to_track | No | Track index to place the copy on. Omit to use the source track, which is the usual case. A MIDI clip needs a MIDI destination. | |
| placements | No | List of placements to duplicate onto the Arrangement timeline, each verified against the destination track it landed on: [{"track": 0, "slot": 1, "at_beat": 64.0, "to_track": null}, ...]. A long list is chunked across several round trips rather than refused. When provided, the single-placement parameters (track, slot, at_beat) must be omitted, including to_track, which each placement carries itself. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||