Add more clip and note operation features in Ableton Live 11 and above versions
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!
PR Summary
-
Introduction of
get_notes_extendedmethod This update adds a new method calledget_notes_extendedin theClip.pyfile. 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_modificationsmethod A new function known asapply_note_modificationshas also been introduced into theClip.pyfile. This allows modifications to existing notes based on a list of note data that are provided. -
Deprecation of
getNotesmethod ThegetNotesmethod inClip.tsis being phased out. It's now recommended to use the newly introducedgetNotesExtendedmethod as it returns more comprehensive note properties. -
Incorporation of
applyNoteModificationsmethod TheClip.tsfile now implements a method known asapplyNoteModifications. This function enables easy alteration of musical notes using an updated command. -
Addition of
removeNotesByIdmethod TheremoveNotesByIdmethod has been added inClip.tsand provides a more straightforward way to remove musical notes using their ID numbers. -
Creation of
NoteExtendedinterface This update brings in a new interface namedNoteExtendedinnote.ts, which defines the structure for handling additional properties of musical notes.
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!
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.
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 :)
Thanks!