ableton-js icon indicating copy to clipboard operation
ableton-js copied to clipboard

Add more clip and note operation features in Ableton Live 11 and above versions

Open xiaolaa2 opened this issue 7 months ago • 2 comments

Hi there, I've been using AI to control Ableton Live through ableton-js and wanted to expand its functionality with more clip and note manipulation features.

I noticed my previous Pull Request (#130) hasn't been reviewed yet—would you mind taking a look when you have a moment? Thanks in advance!

xiaolaa2 avatar May 23 '25 13:05 xiaolaa2

PR Summary

  • Introduction of get_notes_extended method This update adds a new method called get_notes_extended in the Clip.py file. This method allows us to retrieve more detailed information about musical notes, such as their duration, mute status, pitch and more.

  • Addition of apply_note_modifications method A new function known as apply_note_modifications has also been introduced into the Clip.py file. This allows modifications to existing notes based on a list of note data that are provided.

  • Deprecation of getNotes method The getNotes method in Clip.ts is being phased out. It's now recommended to use the newly introduced getNotesExtended method as it returns more comprehensive note properties.

  • Incorporation of applyNoteModifications method The Clip.ts file now implements a method known as applyNoteModifications. This function enables easy alteration of musical notes using an updated command.

  • Addition of removeNotesById method The removeNotesById method has been added in Clip.ts and provides a more straightforward way to remove musical notes using their ID numbers.

  • Creation of NoteExtended interface This update brings in a new interface named NoteExtended in note.ts, which defines the structure for handling additional properties of musical notes.

what-the-diff[bot] avatar May 23 '25 13:05 what-the-diff[bot]

Hey @xiaolaa2, thank you for this PR! As these functions are not part of Live's standard API, I wonder if there's a good way to mark them as such. Maybe adding a prefix to the function name, like addon_, and moving the function itself to another file? There are a few of these custom functions in ableton-js already and I wonder if there's a good way to standardize this so developers know what's doing a direct function call to the Live API and what's executing additional code.

What do you think? I look forward to your reply!

leolabs avatar Jun 09 '25 19:06 leolabs

Hey @xiaolaa2, thank you for this PR! As these functions are not part of Live's standard API, I wonder if there's a good way to mark them as such. Maybe adding a prefix to the function name, like addon_, and moving the function itself to another file? There are a few of these custom functions in ableton-js already and I wonder if there's a good way to standardize this so developers know what's doing a direct function call to the Live API and what's executing additional code.

What do you think? I look forward to your reply!

Thank you for your feedback, @leolabs!

I’d like to better understand your comment: "As these functions are not part of Live's standard API." Could you clarify what specifically this refers to in the context of the midi-script Python files? For example, are you pointing to custom-written functions within the Python classes (e.g., in Clip.py, Track.py, etc.) that extend functionality or wrap existing Live API calls, rather than being direct mappings of functions from the official Ableton Live Object Model (LOM)?

Additionally, I’ve fixed the issue in my previously submitted code where Clip.py’s get_notes_extended failed to call Ableton Live’s API.

xiaolaa2 avatar Jun 12 '25 03:06 xiaolaa2

Hey @xiaolaa2,

I'm sorry, I misread your code. As your code provides a good wrapper around existing API methods, I don't think we need to mark it in any specific way. I'll merge your PR right away :)

leolabs avatar Jun 16 '25 13:06 leolabs

Thanks!

xiaolaa2 avatar Jun 16 '25 14:06 xiaolaa2