-
Notifications
You must be signed in to change notification settings - Fork 363
feat: Add ASCII grid notation for MIDI patterns #55
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
billy-and-the-oceans
wants to merge
3
commits into
ahujasid:main
Choose a base branch
from
billy-and-the-oceans:feature/grid-notation
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
Show all changes
3 commits
Select commit
Hold shift + click to select a range
a21af11
feat: Add get_notes_from_clip function to read MIDI notes from clips
billy-and-the-oceans bc2c663
fix: Update FastMCP init to use 'instructions' instead of 'description'
billy-and-the-oceans 40bc5df
feat: Add ASCII grid notation for MIDI patterns
billy-and-the-oceans 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
Oops, something went wrong.
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
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 180
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 5082
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 878
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 4220
🏁 Script executed:
# Check the full context of the __init__.py file around the method wc -l AbletonMCP_Remote_Script/__init__.pyRepository: ahujasid/ableton-mcp
Length of output: 105
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 2210
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 481
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 175
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 351
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 1262
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 46
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 1795
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 46
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 175
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 1628
🏁 Script executed:
# Search for any documentation or comments about Ableton Live API versions head -50 AbletonMCP_Remote_Script/__init__.pyRepository: ahujasid/ableton-mcp
Length of output: 1476
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 855
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 1187
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 46
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 46
🏁 Script executed:
# Search for any documentation or examples about Ableton Live API clip types web_search Ableton Live API get_notes_extended method MIDI clip audio clipRepository: ahujasid/ableton-mcp
Length of output: 160
🌐 Web query:
Ableton Live API get_notes_extended MIDI clip audio clip documentation💡 Result:
get_notes_extended is part of Live’s Clip API (Live Object Model). Key points:
If you want the full field list and exact parameter formats, see the Clip section of the Live Object Model (Cycling '74) and Ableton’s Note API docs. (docs.cycling74.com)
Would you like direct links to example code (Max/JS/Python) using get_notes_extended?
Citations:
🌐 Web query:
Ableton Live Python API clip types has_audio_input has_midi_input💡 Result:
Short answer: has_audio_input and has_midi_input are boolean Track properties in Live’s API (Live Object Model) that indicate whether a track accepts audio input (true for audio tracks) or MIDI input (true for MIDI tracks). Clips themselves are either audio or MIDI (and ClipSlot.create_clip/create_midi_clip only creates MIDI clips via the API); you cannot programmatically create audio clips through the standard Live Object Model. (docs.cycling74.com)
Sources
Citations:
🏁 Script executed:
Repository: ahujasid/ableton-mcp
Length of output: 249
Add clip type check to prevent confusing errors on audio clips.
clip.get_notes_extended()is a MIDI-only method in the Ableton Live API. If a user loads an audio clip into a slot, this will fail with an unhelpful AttributeError. A simplehasattr(clip, "get_notes_extended")check provides a clearer error path and aligns with the defensive checks used elsewhere in this file.Proposed fix
def _get_notes_from_clip(self, track_index, clip_index): """Get all MIDI notes from a clip""" try: @@ clip = clip_slot.clip + + # Fail fast if this isn't a MIDI clip + if not hasattr(clip, "get_notes_extended"): + raise TypeError("Target clip does not support MIDI note extraction (expected a MIDI clip)") @@ notes_tuple = clip.get_notes_extended(0, 128, 0.0, clip.length)🧰 Tools
🪛 Ruff (0.14.10)
532-532: Abstract
raiseto an inner function(TRY301)
532-532: Avoid specifying long messages outside the exception class
(TRY003)
537-537: Abstract
raiseto an inner function(TRY301)
537-537: Avoid specifying long messages outside the exception class
(TRY003)
542-542: Abstract
raiseto an inner function(TRY301)
542-542: Create your own exception
(TRY002)
542-542: Avoid specifying long messages outside the exception class
(TRY003)
568-568: Consider moving this statement to an
elseblock(TRY300)
🤖 Prompt for AI Agents