andrewlb notes

AbletonBuddy

AbletonBuddy

Tools

Claude CodeTypeScriptNode.jsMax for LivetonalVitestWebSocketZod

What worked

The file-mediated architecture (Claude Code reads .buddy/ JSON files written atomically by the bridge server) was a pragmatic workaround for MAX subscriptions lacking API keys — and it turned out to be a better design than a direct API call would have been, because it decouples the Ableton session from the AI entirely. The three-layer ALS system (low-level parser -> reader -> writer) kept the undocumented XML format manageable. Using tonal instead of hand-rolling music theory avoided an entire class of bugs.

What broke

The M4L JavaScript threading model (low-priority thread) causes intermittent data loss under CPU load — a platform constraint no amount of code fixes. essentia.js was stale (last published 4 years ago) and needed manual Node 22 verification. Non-unique Pointee IDs in ALS files crashed early versions, revealing how brittle an undocumented format can be. Generated clips don't hook into Ableton's undo system, which is a real UX gap.

Roles

I set the architectural direction (file-mediated IPC, WebSocket over OSC, three-layer ALS system) and the coaching mode taxonomy. Claude Code wrote the parsers, generators, bridge server, and all 295+ tests. I reviewed and chose tonal over hand-rolled music theory. The Push3 workflow references were my editorial calls, executed by Claude.

AbletonBuddy (AI Songwriting Companion)

Overview

AbletonBuddy is a Claude-powered AI songwriting companion embedded in Ableton Live via Max for Live devices and a Claude Code CLI skill. It bridges the critical gap between having individual musical clips and finishing complete arranged songs — the "clip graveyard" problem.

Core value: Get from "I have a musical idea" to "I'm recording in a structured Ableton project" as fast as possible.

Target users: Music producers using Ableton Live Suite (with Max for Live) and Claude MAX subscription.

What It Does

  • Session-aware coaching that references actual tracks, clips, devices, and keys from the user's live session or saved ALS files
  • Four coaching modes: Coaching (what to do next), Framework (song structures), Constraint (creative limitations), Techniques (Ableton/Push3 workflow)
  • MIDI generation for chord progressions, bass lines, and melodies using the tonal library
  • Production intelligence: signal-grounded mixing advice from audio analysis probes (RMS, peak, spectral centroid, dynamics)
  • Safe ALS file read/write/modify with backup protection and lossless XML round-tripping
  • Phrase-level analysis tied to arrangement transport sections

How It Fits Together

Max for Live devices (session awareness, track intent, probe) stream session state over WebSocket to a Node.js bridge server. The bridge aggregates state in memory and writes atomic JSON snapshots to a .buddy/ directory. Claude Code reads these files through a CLI skill, giving it grounded context about the actual session without needing an API key. ALS file handling uses fast-xml-parser in preserveOrder mode for lossless round-trips of the undocumented Ableton XML format.

Architecture Decisions

  • File-mediated IPC instead of API calls — MAX subscription lacks API key support; the decoupling turned out to be a design advantage
  • WebSocket over OSC — Bidirectional, JSON-native, better for structured data than OSC's flat message format
  • Custom ALS parser — No existing library supports both read and write; preserveOrder mode enables lossless round-trips
  • Three-layer ALS system — Low-level parser, high-level reader, writer/modifier. Separating concerns keeps the undocumented format manageable
  • Atomic writes (.tmp -> rename) — Prevents Claude reading partial files during IPC
  • tonal library for music theory — Eliminates hand-rolled chord/scale logic and the bugs that come with it

What Changed After Dogfooding

The biggest surprise was how much the M4L threading model constrains what's possible. JavaScript in Max runs on a low-priority thread, which means data can be lost or reordered under CPU load. This is a platform constraint, not a bug — and it means certain real-time interactions simply aren't reliable. The design response was to make everything advisory and batch-oriented rather than attempting real-time AI-in-the-loop production.

The non-unique Pointee ID crash was an early lesson in how undocumented formats punish assumptions. The fix required understanding an ID scheme that isn't documented anywhere — the kind of problem where AI assistance is useless because no training data covers it.

Weaknesses & Open Questions

  • ALS format fragility — Undocumented format that changes between Ableton versions; only tested against Live 12
  • essentia.js dependency — Stale (4 years since last publish); Node 22 compatibility is uncertain long-term
  • M4L threading — Low-priority thread data loss under CPU load is a platform constraint with no fix
  • No Ableton undo integration — Generated clips don't participate in Ableton's undo system
  • Claude MAX dependency — Requires an active subscription and the Claude Code CLI; no offline fallback

Ecosystem Role

AbletonBuddy sits alongside Etyde (practice/theory) in the music domain — AbletonBuddy for production and songwriting, Etyde for instrument practice. It could potentially route AI analysis through Roughneck's Ollama queue to reduce dependence on the Claude subscription.