pytheory for Live — music theory tools, powered by actual Python running inside the Extension Host 🎵🐍
I've been building an extension that embeds pytheory ("Music Theory for Humans") into Live — and the fun part is how: it's real CPython compiled to WebAssembly (Pyodide), running inside the Extension Host. No Python install, nothing to set up — the interpreter, numpy, scipy, and the library all ship inside the .ablx.
What it does (25 context-menu actions across 6 scopes):
🔍 Analysis — right-click a MIDI clip for key detection, chord detection with Roman numerals + cadence labeling, melody analysis (scale degrees, passing/neighbor tones), next-chord suggestions, and chord substitutions (tritone subs, borrowed chords…)
🎼 Notation — engraved sheet music rendered right in a dialog, plus LilyPond source export
🎸 Guitar tabs — fingering charts for your clip's chords + full fretboard scale maps, for guitar/ukulele/bass/mandolin/banjo
✨ Transforms — harmonize, arpeggiate, conform to scale, scale-degree-aware transposition, smooth voice-leading, negative harmony, invert, retrograde
🎹 Generators — chord progressions (named, Roman numerals, chord symbols like Am7 D7 Gmaj7, or a random walk), scales, melodies, basslines (incl. walking bass), 100 drum patterns, and a one-click Song Sketch that builds chords + bass + melody + drums at a scene
🎧 Audio — key & chord detection on audio clips, audio-to-MIDI transcription, sample tuning (root pitch + cents + transpose-to-Set-key), and rendering MIDI clips to audio with pytheory's own synth engine
Forms prefill from the Set's key/scale metadata, which turned out to be a lovely API touch. 👏
Install: grab the .ablx from the latest release and drop it on Settings → Extensions:
https://github.com/kennethreitz/ableton-pytheory/releases/latest
Source is MIT: https://github.com/kennethreitz/ableton-pytheory
For the Ableton folks — a few notes from the trenches: the vm sandbox's lack of dynamic import() plus the permission model denying worker_threads (and not propagating allow-lists to child processes) made hosting a WASM interpreter an adventure 😄; freshly created tracks briefly report zero clip slots (I poll); and with 17 items on the MIDI clip menu I would love submenu support in registerContextMenuAction. Happy to share more feedback.
Would love ears + bug reports!