Quickstart
Two flavors: scripting (one-shot reads/writes) and an extension (lives in Live's right-click menus). Make sure Live is open with the Bridge installed first.
Scripting: read & write the Set
Connect, do something, done. Great for batch jobs and experiments.
from ableton_extensions import connect
app = connect()
song = app.song
print("Tempo:", song.tempo)
print("Tracks:", [t.name for t in song.tracks])
# write a 4-note MIDI clip on the first MIDI track
from ableton_extensions import MidiTrack, NoteDescription
track = next(t for t in song.tracks if isinstance(t, MidiTrack))
clip = track.create_midi_clip(0.0, 4.0)
clip.name = "Made in Python"
clip.notes = [NoteDescription(pitch=60+i, start_time=i, duration=0.5, velocity=100) for i in range(4)]
app.close()
Run it: python my_script.py. Switch Live to Arrangement view (Tab) and you'll see the clip.
An extension: add a right-click action
This is the real point of the SDK. Save as my_ext.py:
import random
from ableton_extensions import Extension, MidiClip
app = Extension("My Tool", author="you", version="0.1.0")
@app.context_menu("MidiClip", "Humanizer")
def humanize(clip: MidiClip):
notes = clip.notes
for n in notes:
n.velocity = max(1, min(127, n.velocity + random.randint(-12, 12)))
clip.notes = notes
print(f"Humanized {len(notes)} notes")
if __name__ == "__main__":
app.run()
Run it:
ableton-ext run my_ext.py
[My Tool] connected to bridge 0.0.4. 1 menu action(s) registered. Ctrl+C to stop.
Now in Live, right-click a MIDI clip → you'll see Humanizer. Click it and your Python function runs against that clip.
Keep the
if __name__ == "__main__": guard. It's required for
building a standalone .ablx later.Ableton Extensions Python SDK · MIT · GitHub