Metadata-Version: 2.5
Name: audial-live
Version: 0.1.8
Summary: Audial for Ableton Live: a fast MCP server that controls Ableton Live — tracks, clips, notes, devices, mixer, browser, plus audio and MIDI import and export.
Project-URL: Homepage, https://audialmusic.ai
Project-URL: Repository, https://github.com/AudialAI/audial-live
Project-URL: Issues, https://github.com/AudialAI/audial-live/issues
Author-email: Audial <contact@audialmusic.ai>
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: ableton,audial,daw,live,mcp,model-context-protocol,music
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Sound/Audio
Requires-Python: >=3.10
Requires-Dist: mcp<3,>=2.2
Requires-Dist: mido>=1.3
Requires-Dist: numpy>=1.24
Requires-Dist: pydantic>=2
Requires-Dist: soundfile>=0.12
Description-Content-Type: text/markdown

# Audial for Ableton Live

An MCP server that controls Ableton Live — tracks, groups, clips, notes, devices and presets, mixer, scenes,
browser, automation — and imports and exports audio and MIDI. Built for speed: a tool call takes about 10 ms
(a few ms when calls follow each other), and a whole job (say, ten groups of tracks with presets, audio and notes)
is a single call.

Measured on Live 12.4.16 (Apple silicon):

| | |
|---|---|
| MCP tool call, end to end over stdio | ~11 ms spaced out like a model's calls, ~2 ms back to back |
| Round trip to Live | 0.1 ms after a reply, ~5 ms on average otherwise (Live's timer ticks every 10 ms) |
| Whole-set read / 200 reads in one batch | 0.4 ms / 1 ms |
| Two tracks with a plug-in preset, an audio file and a MIDI clip | 0.2 s, one call |

## How it works

```
MCP client (Claude, …) ──stdio──▶ audial-live (this package) ──TCP 127.0.0.1:9890──▶ "Audial" control surface in Live
```

- **Inside Live**, the `Audial` control-surface script does all its work on Live's main thread, on every tick
  (Live's 10 ms timer, plus its ~10 Hz display timer). There are no threads, so no hand-offs waiting on each other.
  Each tick runs queued requests for up to 20 ms so Live's interface stays responsive, and after answering it keeps
  listening for ~2 ms (at most 8 ms a tick), so a client's follow-up request is answered at once instead of on the
  next tick.
- **Batches**: any number of steps run in one round trip; later steps use earlier results (`{"$ref": "a/ref"}`).
- **Security**: loopback only, and every connection must present the token Live writes to
  `~/.audial/live/session.json` (readable only by you).

## Install

```
uv tool install audial-live      # or: pipx install audial-live
audial-live install              # copies the Audial script into Live's User Library
```

Then restart Live and choose **Audial** under *Settings → Link, Tempo & MIDI → Control Surface* (any free slot;
it can run next to other control surfaces). Add the server to your MCP client:

```json
{"mcpServers": {"audial-live": {"command": "audial-live"}}}
```

`audial-live doctor` checks the setup; `audial-live bench` measures round trips to Live.

Requires Live 12 (Python 3.11 inside Live). Some features need newer 12.x versions and are detected at runtime:
inserting native devices by name (12.3), arrangement audio clips from files and moving clips (12.2).

**Claude plugin.** `claude-plugin/` is a Claude plugin with this server (run with `uvx`, pinned to this package's
version) and two skills: one for working in a set, one for installing and switching on the control surface. See
`claude-plugin/README.md` for installing it from Claude's plugin directory or from Audial's marketplace.

## Tools (59)

| Area | Tools |
|---|---|
| Session | `live_status`, `get_set`, `live_context`, `transport`, `view`, `live_stats` |
| Tracks & mixer | `create_tracks`, `make_group`, `set_tracks`, `delete_tracks`, `duplicate_track`, `get_track`, `send_return`, `take_lanes` |
| Scenes & launching | `edit_scenes`, `launch`, `session_record` |
| Clips | `get_clip`, `create_clip`, `edit_clips`, `delete_clips`, `duplicate_clip`, `clip_action`, `warp_markers`, `clip_automation` |
| Notes | `get_notes`, `write_notes`, `edit_notes`, `remove_notes`, `transform_notes`, `scale_notes`, `copy_notes`, `grid_notation`, `generate_notes`, `align_midi_to_audio` |
| Devices | `load_device`, `get_device`, `set_device_params`, `device_action`, `device_properties`, `snapshots`, `macros`, `chain_templates` |
| Browser | `browse`, `load_browser_item` |
| Import / export | `import_audio`, `import_midi`, `export_midi`, `export_audio`, `export_clip_audio`, `analyze_audio` |
| Arrangement | `arrangement_time`, `analyze`, `convert` |
| Anything else | `run_batch`, `live_api`, `set_data`, `groove_pool`, `watch` |

Notes on behaviour:

- **Audio import is unwarped by default**: raw audio at its own speed, the clip spans the whole file. Pass
  `warp=true` to let Live warp it to the set's tempo.
- **Audio export** plays the range in real time and records it inside Live (Live's API has no offline render).
  Recording uses punch-in/out, so files line up with the arrangement to within a couple of samples; other tracks
  are disarmed and a recorder is selected meanwhile, so nothing records over your clips; several stems record in
  one pass; temporary
  tracks are removed and settings restored. Stems export correctly while other tracks are soloed (the recorders
  join the solo for the export). `export_clip_audio` writes an audio clip's file region instantly.
- **Arrangement time edits** (`arrangement_time`: delete / duplicate / insert silence) move clips on every track as
  one undo step; Live's API has no time-edit calls of its own. Edit points must fall between clips (the API can't
  split a clip); track automation and locators stay where they are.
- **MIDI import** maps the file's beat grid onto Live's (or keeps real time with `timing="seconds"`); each MIDI
  track or channel becomes a Live track, drum channels can get their own instrument. **MIDI export** writes clips or
  whole tracks over a bar range, with looped arrangement clips unrolled as they play.
- **Groups**: Live's API can't group existing tracks. `make_group` creates a new group with new tracks by copying
  an existing group; a set needs one group (Cmd+G once) for that.
- Plug-in presets load from `.vstpreset` / `.adv` / `.adg` / `.fxp` / `.aupreset` files (copied into the User
  Library when needed). Live can't load `.vital` or `.SerumPreset` files directly.

## Development

```
uv sync
uv run pytest                      # unit + end-to-end tests against a fake Live
AUDIAL_LIVE=1 uv run pytest -m live tests/live -s   # against the running Live (uses a scratch area of the set)
uv run audial-live install         # after changes: copies the script and hot-reloads it if Live is running
```

`src/audial_live/remote_script/Audial` is the script Live runs (standard library only, Python 3.11). The script can
reload itself in place (`dev.reload`), so most changes don't need a Live restart.

## Licence

Apache-2.0 (see `LICENSE` and `NOTICE`). The Audial name and logo are not licensed: forks must rename (`TRADEMARKS.md`).
Security reports: `SECURITY.md`. Ableton and Live are trademarks of Ableton AG; this project is not affiliated with Ableton.
