-
Notifications
You must be signed in to change notification settings - Fork 365
Add return_track / duplicate_track / capture_midi / tap_tempo / set_track_color #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lukegimza
wants to merge
1
commit into
ahujasid:main
Choose a base branch
from
lukegimza:add-return-track-and-utility-handlers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Ableton Live Object Model track.color_index valid range palette💡 Result:
In Ableton Live's Live Object Model (LOM), used in Max for Live and Python Remote Scripts APIs, the Track object has a 'color_index' property, which is an integer representing the index of the track's color in Ableton's predefined color palette [1][2][3]. The valid range for track.color_index is 0 to 69 (inclusive), corresponding to the 70 colors available in the palette as of Live 11 and later [4][5][6]. This is evidenced by Ableton Remote Scripts for controllers like APC64 mapping color_index 0-69 to specific RGB values [5], Python scripts assigning indices up to 69 [6][7], and user reports confirming 70 selectable colors [4][8]. Setting color_index to values outside this range may snap to the nearest palette color or be invalid, similar to how arbitrary RGB values are quantized to the palette when setting the 'color' property (an int in 0x00rrggbb format) [9][2]. Official Cycling '74 LOM docs confirm the property exists but do not specify the range explicitly [2].
Citations:
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 1525
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 553
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 3353
Validate
color_indexupper bound (0-69).The
color_indexparameter is checked for>= 0but not against the upper bound of 69. Ableton Live's palette supports exactly 70 colors (indices 0–69). A simple range check prevents silent truncation or unexpected behavior when an out-of-range index is passed:Proposed range guard
track = self._song.tracks[track_index] color_index = int(color_index) color = int(color) if color_index >= 0: + if color_index > 69: + raise ValueError("color_index must be in 0-69") track.color_index = color_index elif color >= 0: track.color = color else: raise ValueError("Provide color_index (0-69) or color (RGB int).")Note: This method only indexes
self._song.tracks(regular tracks) and does not support return or master tracks, though they also havecolor_indexproperties. If master/return track coloring is needed, either expand the lookup or document this scope in the docstring.🤖 Prompt for AI Agents