Repository navigation
fix: size arrangement audio clips to --length through loop_end - #139
Merged
Merged
Conversation
Live 12 sizes a new arrangement audio clip to the file's warped length. Clip.length is read-only and follows loop_end - loop_start, and end_marker does not move the span, so the old length/end_marker fallback left every clip at Live's length while reporting success. arrangement clip create --audio-path now writes loop_end, reads length back and fails with INVALID_ARGUMENT when Live did not apply it (e.g. unwarped clips, whose loop is measured in seconds). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6uclz1
force-pushed
the
fix/arrangement-audio-clip-length
branch
from
October 24, 2026 11:03
33cd41a to
4814c17
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
arrangement clip create TRACK --start S --length L --audio-path ABSignored--lengthon audio tracks. Live 12 sizes a new arrangement audio clip to the file's warped length: a 3 s WAV at 120 BPM gives an 8-beat clip. The old code triedclip.length = L. Live raises on that becauselengthis read-only, so the code fell back toclip.end_marker = L. It then returned success withlength_set: false, end_marker_set: true, while the clip still covered 8 beats.What Live accepted (Live 12 Suite, 2026-10-24, scratch track)
clip.length = Lend_marker = Lwith looping onend_marker = Lwith looping offloop_end = loop_start + Lwith looping onlengthreads back as L. A single write works on a fresh clip.loop_endon an unwarped cliploop_endstayed 3.0,length6 beats)The arrangement span follows
loop_end - loop_start.Change
track.create_audio_clip, the backend writesloop_end = loop_start + lengthand reads backlength. If they don't match, it fails withINVALID_ARGUMENT.detailsgivestrack,index,requested_length,actual_length,warping,loopingand, when the write raised,write_error. The hint says how to recover (warp the clip, thenarrangement clip loop set, or delete it).requested_length/length_set/end_marker_set. Itslengthis the requested length, which the read-back check guarantees._created_arrangement_clip_index, and the span is set on that clip, so creating a clip before an existing one leaves the existing clip alone.arrangement from-sessiongets the fix too, since it places audio through the same path._ArrangementAudioClipmodels Live:lengthis a read-only property equal toloop_end - loop_start, and a new clip starts at the warped length of 8 beats._LoopEndIgnoringArrangementAudioClipmodels a write that Live accepts but ignores.--lengthis applied to audio clips and when it fails.Public contract impact
Small, intentional. Three undocumented diagnostic fields are removed from the
arrangement clip createaudio result, and a length mismatch is now an error instead ofok: true. The command surface snapshot and generated skill docs are unchanged.docs/computer-use/cli-gaps.mdis unchanged because the CLI can do this without the GUI.Validation
uv run python -m ableton_cli.dev_checks,ruff check .,ruff format --check .,pytest(1526 passed, rebased on main 8d55f09), quality-harnessdev_checks_enforce: all pass.tools/generate_skill_docs.pyandtools/update_public_contract_snapshot.py: no diff.[(0.0, 4.0), (16.0, 12.0)].--length 4,12and8.arrangement clip props getread backlength4.0 / 12.0 / 8.0,loop_end4.0 / 12.0 / 8.0,loopingtrue.arrangement clip listgives[(0, 0.0, 4.0), (1, 16.0, 6.0), (2, 32.0, 12.0)], andprops getgivesloop_end4 / 6 / 12. Each clip has its requested length.create_audio_clipdidn't produce an unwarped clip. That path is covered by the stub test.Interaction with #133
Rebased onto main after #133 merged. The audio branch uses #133's start-time lookup instead of the old
clips[before_count].🤖 Generated with Claude Code