@ulm0/ableton-live-mcp 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Ableton-Live-MCP-1.1.0.ablx +0 -0
- package/LICENSE +21 -0
- package/README.md +601 -2
- package/SECURITY.md +61 -0
- package/SHA256SUMS +1 -0
- package/dist/extension.cjs +181 -0
- package/manifest.json +7 -0
- package/package.json +63 -4
- package/skills/ableton-live/SKILL.md +429 -0
package/manifest.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulm0/ableton-live-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "MCP server for Ableton Live, embedded in a Live Extension",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"model-context-protocol",
|
|
8
|
+
"ableton",
|
|
9
|
+
"ableton-live",
|
|
10
|
+
"live-extension"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/ulm0/ableton-live-mcp#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/ulm0/ableton-live-mcp/issues"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/ulm0/ableton-live-mcp.git"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": "ulm0",
|
|
22
|
+
"main": "dist/extension.cjs",
|
|
23
|
+
"type": "module",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/extension.cjs",
|
|
26
|
+
"manifest.json",
|
|
27
|
+
"*.ablx",
|
|
28
|
+
"SHA256SUMS",
|
|
29
|
+
"skills/",
|
|
30
|
+
"SECURITY.md"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=24.16.0"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public",
|
|
37
|
+
"provenance": true
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc --noEmit && tsx build.ts --production",
|
|
41
|
+
"build:dev": "tsc --noEmit && tsx build.ts",
|
|
42
|
+
"start": "npm run build:dev && extensions-cli run",
|
|
43
|
+
"package": "npm run build && extensions-cli package",
|
|
44
|
+
"test": "npm run build:dev && node test/e2e.mjs && node test/vm-context.mjs",
|
|
45
|
+
"prepublishOnly": "npm run package"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@ableton-extensions/cli": "file:vendor/ableton-extensions-cli-1.0.0-beta.1.tgz",
|
|
49
|
+
"@ableton-extensions/sdk": "file:vendor/ableton-extensions-sdk-1.0.0-beta.1.tgz",
|
|
50
|
+
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
51
|
+
"@types/node": "^26.0.0",
|
|
52
|
+
"esbuild": "0.28.2",
|
|
53
|
+
"tsx": "^4.19.0",
|
|
54
|
+
"typescript": "^7.0.0",
|
|
55
|
+
"zod": "^4.6.7"
|
|
56
|
+
},
|
|
57
|
+
"allowScripts": {
|
|
58
|
+
"esbuild@0.28.2": true
|
|
59
|
+
},
|
|
60
|
+
"overrides": {
|
|
61
|
+
"archiver-utils": {
|
|
62
|
+
"glob": "^15.0.0"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ableton-live
|
|
3
|
+
description: Control Ableton Live via the ableton-live MCP server — compose MIDI, arrange tracks, edit clips, tweak devices and mix. Use whenever the user asks to do anything in Ableton Live (create tracks/clips/notes, change tempo, add devices, mix levels, warp audio, render stems).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ableton Live via MCP
|
|
7
|
+
|
|
8
|
+
The `ableton-live` MCP server (streamable HTTP, `http://127.0.0.1:8722/mcp`) controls a running
|
|
9
|
+
Ableton Live 12. If tools fail to connect: Live is not running, the extension is not installed,
|
|
10
|
+
or the port was changed in the extension's `config.json` (default 8722). HTTP 401 means the
|
|
11
|
+
user set an `auth_token` in config.json and the client must send `Authorization: Bearer
|
|
12
|
+
<token>`; 503 means config.json has an invalid or misspelled security setting (`read_only`,
|
|
13
|
+
`disabled_tools`, `auth_token`, including a `disabled_tools` entry that names no tool), or exists
|
|
14
|
+
but cannot be read or parsed (the error says which, and the Status dialog in Live too). Ask the
|
|
15
|
+
user to fix their client or config; never guess a token.
|
|
16
|
+
|
|
17
|
+
## Core workflow
|
|
18
|
+
|
|
19
|
+
1. **Always start with `song_get`.** It returns the set with object ids. Every other tool
|
|
20
|
+
takes those ids. Pass `include` to fetch only some sections. To read the whole set in one
|
|
21
|
+
call, add the deep sections: `song_get {include:["tracks", "devices", "mixer", "clips"]}`
|
|
22
|
+
(see [Reading the whole set](#reading-the-whole-set)).
|
|
23
|
+
2. Drill down with `track_get` / `device_get` / `clip_get` — they return child ids (clips,
|
|
24
|
+
parameters, chains). `track_get` takes an `include` selector to skip sections you don't
|
|
25
|
+
need.
|
|
26
|
+
3. **Address tracks and scenes by name when the user does.** Every tool that acts on one track
|
|
27
|
+
(`track_get`, `track_set`, `track_delete`, `track_duplicate`, `track_clear_clips_in_range`,
|
|
28
|
+
`take_lane_create`, `render_track_audio`, `audio_track_consolidate`, `mixer_get`, `mixer_set`,
|
|
29
|
+
`device_insert`, `drum_kit_build`, `clip_create`, `clip_copy`) takes `track_id`, `track_index`
|
|
30
|
+
(0-based, regular tracks) or `track_name` (exact first, then case-insensitive; also finds
|
|
31
|
+
return and main tracks). The scene tools, `clip_create` and `clip_copy` take `scene_id`,
|
|
32
|
+
`scene_index` or `scene_name`. "Mute the Drums" is one call:
|
|
33
|
+
`track_set {track_name:"Drums", mute:true}`. If you give several fields they must name
|
|
34
|
+
the same object. An ambiguous name fails with the matching candidates — pick one by id or
|
|
35
|
+
index. `track_delete` and `scene_delete` only accept the exact name. Parameters work the same
|
|
36
|
+
way: see [Devices & sound design](#devices--sound-design).
|
|
37
|
+
4. Ids become stale when objects are deleted/moved or a different set is loaded. On a stale-id
|
|
38
|
+
error, re-run `song_get` and re-resolve. Errors about your arguments (unknown name, index
|
|
39
|
+
out of range, missing or conflicting fields) come without the stale-id hint: fix the call
|
|
40
|
+
instead.
|
|
41
|
+
5. Writes apply asynchronously: a read right after a write can still return the old value.
|
|
42
|
+
6. The user can switch tools off in config.json: `read_only` leaves only the tools that read the
|
|
43
|
+
set, `disabled_tools` drops the ones it names. A switched-off tool is not listed at all (a
|
|
44
|
+
batch step naming it fails with "switched off"); the server instructions say which. Tell the
|
|
45
|
+
user that the action is switched off on their server instead of looking for a workaround.
|
|
46
|
+
A prompt (see below) is only offered when every tool it uses is available.
|
|
47
|
+
|
|
48
|
+
## Resources and prompts
|
|
49
|
+
|
|
50
|
+
- Resources, for clients that attach context: `live://song` (what `song_get` returns without
|
|
51
|
+
arguments), `live://tracks/{track}` (what `track_get` returns; `{track}` is the track name
|
|
52
|
+
percent-encoded with encodeURIComponent, so "Drums/Bus" is `live://tracks/Drums%2FBus`; names
|
|
53
|
+
that several tracks share are not listed — use `track_get` with an index or id) and
|
|
54
|
+
`live://guide` (this guide). They are snapshots: read again for fresh data, there are no
|
|
55
|
+
subscriptions.
|
|
56
|
+
- Prompts the user can pick in the client, each expanding into steps with exact tool calls:
|
|
57
|
+
`song_skeleton {sections?, tempo?, beats_per_bar?, tracks?}` (scenes and locators per section,
|
|
58
|
+
e.g. sections "Intro:8, Verse:16, Chorus:16"), `chord_progression {progression?, key?,
|
|
59
|
+
bars_per_chord?, beats_per_bar?, octave?, voicing?, track?}` (Roman numerals in a key —
|
|
60
|
+
default Live's current scale — or chord names, voiced by the server) and `drum_beat {style?, bars?, track?, tempo?,
|
|
61
|
+
swing?}` (house, techno, hip_hop, trap, dnb, breakbeat, rock, reggaeton). Follow their steps;
|
|
62
|
+
values written as "<...>" are yours to fill in.
|
|
63
|
+
|
|
64
|
+
## Reading the whole set
|
|
65
|
+
|
|
66
|
+
- `song_get` tracks carry `index` (the `track_index`), `depth` in the group hierarchy and
|
|
67
|
+
`group_track_id`; group tracks have `is_group: true` and `child_track_ids` ("the drum bus" is
|
|
68
|
+
the group whose children are the drums) — their `type` is `"other"`. Return tracks have
|
|
69
|
+
`type: "return"` and the main track `"main"` here (`track_get` and `selection_get` report both
|
|
70
|
+
as `"other"`).
|
|
71
|
+
Return tracks carry `send_index` (their send).
|
|
72
|
+
- Deep sections, only when listed in `include` (they imply the tracks): `devices` (each track's
|
|
73
|
+
device tree through racks — chains with `receiving_note_name` and their devices — and every
|
|
74
|
+
device's on-state `enabled`), `mixer` (volume, panning, sends labeled with `return_track`),
|
|
75
|
+
`clips` (session clips with `scene_index`, arrangement clips with start/end, in brief). They
|
|
76
|
+
stop at 500 devices / 500 clips: then `truncated` names the first track left out — read the
|
|
77
|
+
rest with `track_get` / `device_get`.
|
|
78
|
+
- One scene across all tracks ("what's in the chorus?"): `scene_get {scene_name:"Chorus",
|
|
79
|
+
only_clips?}`. The whole session at a glance: `session_grid` (a track × scene matrix, cells
|
|
80
|
+
`null` or a brief clip; narrow with `tracks` and `scene_index_min`/`scene_index_max`).
|
|
81
|
+
- A stretch of the arrangement ("what happens from bar 17 to bar 33?" = beats 64 to 128 at 4/4):
|
|
82
|
+
`arrangement_get {start_time:64, end_time:128, tracks?, include_take_lanes?}` returns the cue
|
|
83
|
+
points in the range and every track's overlapping clips, plus `song_end` (the end of the last
|
|
84
|
+
arrangement clip — the API has no song length). Without a range it covers the whole song.
|
|
85
|
+
- Housekeeping: `song_audit` lists missing media files (audio clips and Simpler samples whose file
|
|
86
|
+
is gone), Simplers without a sample, empty drum pads and duplicate track names, each with ids
|
|
87
|
+
and a location. It changes nothing; offer fixes (`simpler_replace_sample`, `track_set` names)
|
|
88
|
+
and confirm before deleting anything.
|
|
89
|
+
- `clip_get`, `device_get` and `chain_get` include a `location`: a clip's view (`session` with
|
|
90
|
+
track and scene, `arrangement`, `take_lane`), a device's track, path through racks
|
|
91
|
+
(`"Kit > Drum Rack > pad 36 > Simpler"`) and position.
|
|
92
|
+
|
|
93
|
+
## The user's selection ("this clip", "these slots", "the selected range")
|
|
94
|
+
|
|
95
|
+
- Live's API cannot read the selection. The extension adds **"MCP: Use as selection"** to Live's
|
|
96
|
+
context menus (clips, clip slots, tracks, scenes, Drum Racks, Simplers, samples, a selection of
|
|
97
|
+
clip slots, an arrangement time selection). When the user refers to something they selected,
|
|
98
|
+
ask them to right-click it and choose that entry, then call `selection_wait` (waits up to
|
|
99
|
+
`timeout_s`, at most 55 s; on `timed_out`, ask again). `selection_get` returns the last capture
|
|
100
|
+
without waiting — check `age_s` before trusting an old one.
|
|
101
|
+
- The result: `items` (the clicked object, or each selected clip slot) with ids, summaries and
|
|
102
|
+
`location`; for an arrangement time selection, `time_selection {start_time, end_time}` in
|
|
103
|
+
beats and `lanes` (the selected tracks or take lanes) with the clips overlapping it. Pass the
|
|
104
|
+
ids to the other tools: "quantize this" = `midi_clip_edit_notes {clip_id:<items[0].id>,
|
|
105
|
+
quantize:{grid:0.25}}`; "render the selected range" = `render_track_audio {track_id, start_time,
|
|
106
|
+
end_time}` from the time selection.
|
|
107
|
+
- An item with `error` was deleted or moved since, or Live passed something unexpected: ask the
|
|
108
|
+
user to select again. Don't guess ids instead.
|
|
109
|
+
|
|
110
|
+
## Batch edits (one call, one undo step)
|
|
111
|
+
|
|
112
|
+
- `track_set`, `scene_set`, `cue_point_set`, `clip_set`, `take_lane_set` and `mixer_set` take
|
|
113
|
+
`items: [...]` — one entry per object, each with its address and values:
|
|
114
|
+
`track_set {items:[{track_name:"Bass", mute:true}, {track_name:"Keys", solo:false}]}`,
|
|
115
|
+
`scene_set {items:[{scene_index:0, name:"Intro"}, {scene_index:1, name:"Verse"}]}`.
|
|
116
|
+
- `clip_set {select:{track_name:"Drums", scope:"all", name_contains?}, warp_mode:"ComplexPro"}`
|
|
117
|
+
changes every matching clip of one track (scope: `session`, `arrangement`, `take_lanes` or
|
|
118
|
+
`all`).
|
|
119
|
+
- Every entry is validated first: one bad entry (unknown name, bad color, warp settings on a
|
|
120
|
+
MIDI clip) fails the whole call and changes nothing; the error names the entry
|
|
121
|
+
(`items[2]: ...`). The user undoes the whole batch with one Cmd/Ctrl-Z — except
|
|
122
|
+
`cue_point_set` moves, which take up to three undo steps (creates, names, deletes).
|
|
123
|
+
- Prefer one batched call over a loop of single calls.
|
|
124
|
+
|
|
125
|
+
## Chaining dependent calls (`batch`, `batch_read`)
|
|
126
|
+
|
|
127
|
+
- When a call needs the result of the one before (create a track, then a clip on it, then its
|
|
128
|
+
notes) and no compound tool does it, send the whole chain in one `batch {steps:[{tool, args,
|
|
129
|
+
as?}]}` (up to 50 steps, run in order). `args` are exactly a direct call's arguments; a value
|
|
130
|
+
`{"$ref": "<step>.<path>"}` is taken from an earlier step's result — `<step>` is its 0-based
|
|
131
|
+
index or its `as` name, `<path>` keys and array indexes:
|
|
132
|
+
`batch {steps:[{tool:"track_create", args:{type:"midi", name:"Keys"}, as:"keys"},
|
|
133
|
+
{tool:"clip_create", args:{type:"midi", track_id:{"$ref":"keys.id"}, start_time:0, duration:4}},
|
|
134
|
+
{tool:"midi_clip_set_notes", args:{clip_id:{"$ref":"1.id"}, notes:[...]}}]}`.
|
|
135
|
+
- Unknown tools, bad `$ref`s and invalid arguments of steps without a `$ref` fail the call
|
|
136
|
+
before anything runs; steps with a `$ref` are checked when they run. The batch is NOT one undo
|
|
137
|
+
step and not atomic: with `on_error:"stop"` (default) it ends at the first failing step and
|
|
138
|
+
the earlier ones stay applied — read `results` (per step `result` or `error`), `completed`
|
|
139
|
+
and `not_run`, and tell the user what happened. `on_error:"continue"` runs the rest.
|
|
140
|
+
- Prefer the compound tools and `items` batches when they fit: they validate everything first
|
|
141
|
+
and are one undo step. `batch` cannot hold `show_dialog`, `execute_command` or another batch.
|
|
142
|
+
- `batch_read` is the read-only form (`*_get`, `midi_clip_get_notes`, `session_grid`,
|
|
143
|
+
`arrangement_get`, `parameter_find`, `sample_search`, `selection_wait`, ...): it refuses any
|
|
144
|
+
step that can change the set and continues after a failed step by default. E.g. a track by
|
|
145
|
+
name, then the notes of its first clip: `{steps:[{tool:"track_get", args:{track_name:"Bass",
|
|
146
|
+
include:["clip_slots"]}, as:"t"}, {tool:"midi_clip_get_notes",
|
|
147
|
+
args:{clip_id:{"$ref":"t.clip_slots.0.clip.id"}}}]}`.
|
|
148
|
+
|
|
149
|
+
## Units and conventions
|
|
150
|
+
|
|
151
|
+
- All times, positions, durations are **beats** (quarter notes), not seconds or bars.
|
|
152
|
+
At 4/4, one bar = 4 beats. Seconds → beats: `seconds * tempo / 60`.
|
|
153
|
+
- MIDI pitch: 0–127, C3 = 60 in Live's naming (C-2 = 0). Kick drum pad usually C1 = 36.
|
|
154
|
+
Wherever a pitch is taken (notes, patterns, `select` ranges, drum pads, `drum_chain_set`) a
|
|
155
|
+
note name works too: `"C1"`, `"F#1"`, `"Bb2"` (sharps `#`, flats `b`).
|
|
156
|
+
- Colors: `"#RRGGBB"` strings.
|
|
157
|
+
- Velocity 0–127, probability 0–1.
|
|
158
|
+
- Device parameters use internal units within each parameter's `min`/`max` (no dB/Hz/ms
|
|
159
|
+
display values). Quantized parameters (switches, choosers) take the `value_items` index, or
|
|
160
|
+
the choice by name with `value_item`.
|
|
161
|
+
|
|
162
|
+
## MIDI composition
|
|
163
|
+
|
|
164
|
+
- Create track: `track_create {type:"midi", name:"Bass", devices:["Operator"]}` names it and
|
|
165
|
+
inserts devices in the same call (`{name:"Auto Filter", parameters:[{name:"Frequency",
|
|
166
|
+
value:80}]}` sets initial values). Live inserts the new track after the selected one, so use
|
|
167
|
+
the returned `index`/`id`, not "the last track". A device that fails to insert is reported
|
|
168
|
+
in `errors` (and its `devices` entry); the track and the other devices are still created.
|
|
169
|
+
- Then create clip + notes in ONE call:
|
|
170
|
+
- Session: `clip_create {type:"midi", track_name:"Bass", scene_name:"Verse", duration:4, notes:[...], name, color}`
|
|
171
|
+
(or `target_id:<track_id>, scene_index:0`)
|
|
172
|
+
- Arrangement: `clip_create {type:"midi", target_id:<midi_track_id>, start_time, duration, notes:[...]}`
|
|
173
|
+
- Take lane: `clip_create {type:"midi", target_id:<take_lane_id>, start_time, duration, ...}`
|
|
174
|
+
- MIDI clips ignore the audio-only `file_path`, `is_warped` and `loop_settings` (the result's
|
|
175
|
+
`warning` says so): don't send them for MIDI.
|
|
176
|
+
- Drum lines and other repetitive parts: step `patterns` instead of one note per hit — one
|
|
177
|
+
pitch per string, `"x"` a hit, `"X"` an accent (`accent_velocity`, default 127), `"."` or `"-"`
|
|
178
|
+
a rest, spaces and `|` ignored; `step` is the beats per character (default 0.25 = 1/16).
|
|
179
|
+
`repeat {length}` copies the notes and patterns every `length` beats up to the clip's end
|
|
180
|
+
(`times` for an exact count). A two-bar beat in one call:
|
|
181
|
+
`clip_create {type:"midi", track_name:"Drums", scene_index:0, duration:8, repeat:{length:4},
|
|
182
|
+
patterns:[{note:"C1", steps:"x...x...x...x..."}, {note:"D1", steps:"....X.......X..."},
|
|
183
|
+
{note:"F#1", steps:"x.x.x.x.x.x.x.x.", velocity:80}]}`. `midi_clip_set_notes` takes the
|
|
184
|
+
same `patterns` and `repeat`.
|
|
185
|
+
- Layer more notes: `midi_clip_set_notes {mode:"merge", notes:[...]}` (default mode `replace`
|
|
186
|
+
wipes the clip — only use it when rewriting everything).
|
|
187
|
+
- Reading notes: `midi_clip_get_notes {select?, format?}`. `select` filters like the edit's
|
|
188
|
+
(below); `format:"compact"` returns `[pitch, start_time, duration, velocity]` tuples plus an
|
|
189
|
+
object of the fields that differ from the result's `defaults` — use it for dense clips.
|
|
190
|
+
- Mechanical edits: `midi_clip_edit_notes` — server-side, no need to read and resend the note
|
|
191
|
+
list. Note times are relative to the clip start.
|
|
192
|
+
- `select` (all filters must match): `pitch_min`/`pitch_max` (numbers or names),
|
|
193
|
+
`time_min`/`time_max` (start, beats), `in_scale` (true/false against the song's scale, or
|
|
194
|
+
`snap_to_scale`'s), `every_nth` (`2` = 1st, 3rd, ... in time order; `{n:2, offset:1}` = 2nd,
|
|
195
|
+
4th, ...), `only_selected` (the notes the user selected in Live's editor).
|
|
196
|
+
- Transforms, in this order: `transpose`; `snap_to_scale` (`"song"` or `{root:"D",
|
|
197
|
+
intervals:[0,2,3,5,7,9,10]}`; out-of-key notes move to the nearest scale note, ties go
|
|
198
|
+
down); `set {velocity, probability, velocity_deviation, release_velocity, muted}`;
|
|
199
|
+
`velocity_scale`, `velocity_offset`; `time_shift`; `quantize {grid, strength}`; `swing
|
|
200
|
+
{amount, grid}` (0 = straight, ~0.67 = triplet feel, 1 = dotted); `duration_set` or
|
|
201
|
+
`duration_scale`; `legato` (each note runs to the next start; notes starting together are
|
|
202
|
+
a chord and end together; the last keep their length); `humanize {timing, velocity, seed}`.
|
|
203
|
+
Or `delete:true`.
|
|
204
|
+
- A grid of `"song"` (quantize, swing) uses Live's grid setting — the arrangement grid, not
|
|
205
|
+
the clip editor's; bar grids assume the first scene's time signature, "No Grid" fails.
|
|
206
|
+
- `humanize` is reproducible: pass `seed`, or reuse the returned `humanize_seed`.
|
|
207
|
+
- `clip_ids:[...]` edits several clips alike in one undo step (one notes write per clip):
|
|
208
|
+
"humanize these 8 drum clips" is one call.
|
|
209
|
+
- "Fix the out-of-key notes" = `{clip_id, snap_to_scale:"song"}`; "mute every second hi-hat"
|
|
210
|
+
= `{select:{pitch_min:"F#1", pitch_max:"F#1", every_nth:{n:2, offset:1}}, set:{muted:true}}`.
|
|
211
|
+
- The user's note selection: `only_selected` (and each note's `selected` in reads) comes from
|
|
212
|
+
`NoteDescription.selected`. Whether Live fills it in for extensions is unverified: when no
|
|
213
|
+
note reports a selection, results carry a `warning` — then ask the user which notes they
|
|
214
|
+
mean instead of guessing.
|
|
215
|
+
- Respect the song scale from `song_get` (`scale.root_note`, `scale.intervals`) when composing.
|
|
216
|
+
- Notes the user selected inside a clip's editor are `only_selected` (above); which clip, slot or
|
|
217
|
+
range they mean is the context-menu selection (see [The user's selection](#the-users-selection-this-clip-these-slots-the-selected-range)).
|
|
218
|
+
|
|
219
|
+
## Devices & sound design
|
|
220
|
+
|
|
221
|
+
- `device_insert` takes built-in Live device names: "Operator", "Wavetable", "Drum Rack",
|
|
222
|
+
"Simpler", "Reverb", "Delay", "Auto Filter", "EQ Eight", "Compressor", "Saturator", ...
|
|
223
|
+
Third-party plug-ins cannot be inserted. One instrument per track — inserting a second
|
|
224
|
+
instrument fails.
|
|
225
|
+
- **Address parameters by name — no id lookup needed.** `parameter_get` and `parameter_set`
|
|
226
|
+
entries take `{track_name, device, parameter}` (or `{device_id, parameter}`, or the old
|
|
227
|
+
`{parameter_id}`):
|
|
228
|
+
- `device`: a name (exact, then case-insensitive), a 0-based index on the track, or a path
|
|
229
|
+
into racks: `["Drum Rack", {pad:36}, "Simpler"]` (a pad is the drum chain with that
|
|
230
|
+
receiving note) or `["Instrument Rack", {chain:1}, 0]` (chains by index; chains have no
|
|
231
|
+
names).
|
|
232
|
+
- `parameter`: exact name first, then case-insensitive, then a unique substring (`"freq"` →
|
|
233
|
+
"Frequency"). Ambiguous matches fail with the candidates and their ids.
|
|
234
|
+
- Each write gives exactly one of `value` (internal units), `value_item` (a quantized
|
|
235
|
+
parameter's choice by name or short name, matched like `parameter`: `"high"` →
|
|
236
|
+
"Highpass"), `reset:true` (back to the default) or `delta` (relative to the current value,
|
|
237
|
+
clamped).
|
|
238
|
+
- "Switch the bass filter to high-pass" is one call, e.g.
|
|
239
|
+
`parameter_set {values:[{track_name:"Bass", device:"Auto Filter", parameter:"Filter Type", value_item:"high"}]}`
|
|
240
|
+
(when unsure of the exact names, `parameter_find` first).
|
|
241
|
+
- `device_set {track_name, device, enabled?, parameters?:[{name, value|value_item|reset|delta}]}`
|
|
242
|
+
bypasses or enables a device and sets several of its parameters in one undo step. `enabled`
|
|
243
|
+
uses the "Device On" parameter (a Live convention, not an API field); a device without one
|
|
244
|
+
falls back to a two-state first parameter, and `on_parameter.fallback` says so. Some devices
|
|
245
|
+
have no switch at all — that fails with a clear error.
|
|
246
|
+
- Don't know the parameter name? `parameter_find {track_name, query:"cutoff"}` (or the whole set,
|
|
247
|
+
or one device; `value_item:"saw"` finds choosers with that choice) returns ids, device names and
|
|
248
|
+
paths like "Drums > Drum Rack > pad 36 > Simpler". Big devices have 100+ params: prefer
|
|
249
|
+
`parameter_find` or `device_get {parameter_filter, include_values:true}` over dumping all.
|
|
250
|
+
- `device_insert` and `track_create` devices take initial `parameters:[{name, value|value_item|…}]`.
|
|
251
|
+
- dB, Hz and ms are not available: values are internal units only. Read `min`/`max` and the
|
|
252
|
+
current value first, and say that any unit conversion is approximate.
|
|
253
|
+
- Drum racks: `device_get {include_chain_devices:true}` maps the whole kit (pad → note →
|
|
254
|
+
sample) in one call; drum chains report `receiving_note` and `receiving_note_name` (`"C1"`).
|
|
255
|
+
`drum_chain_set` maps a pad to a MIDI note (`receiving_note: 38` or `"D1"`), and pads in
|
|
256
|
+
device paths take names too (`["Drum Rack", {pad:"C1"}, "Simpler"]`);
|
|
257
|
+
`simpler_replace_sample` swaps samples. `rack_insert_chain {rack_device_id, index}` adds an empty
|
|
258
|
+
chain to a rack (fill it with `device_insert {target_id:<chain id>, device_name}`).
|
|
259
|
+
- **A kit from sample files is one call**: `drum_kit_build {track_name:"Drums", pads:[{note:"C1",
|
|
260
|
+
sample_path:"/abs/kick.wav"}, {note:"D1", sample_path:"/abs/snare.wav", volume:0.7},
|
|
261
|
+
{note:"F#1", sample_path:"/abs/hat.wav", panning:0.2}]}`. It uses the track's Drum Rack (or
|
|
262
|
+
inserts one on a MIDI track; `rack_device_id` for a specific rack), reuses the pad receiving
|
|
263
|
+
each note or creates a chain for it, inserts a Simpler (or keeps the pad's Simpler and REPLACES
|
|
264
|
+
its sample), imports the sample into the project and loads it; `volume` (0-1, 0.85 = 0 dB) and
|
|
265
|
+
`panning` set the pad's chain mixer. Every path is checked first; a pad that fails later
|
|
266
|
+
carries `error` in its entry while the others are built (Live cannot delete a chain, so a
|
|
267
|
+
created chain stays). Need the paths? `sample_search {query:"808 kick"}` first.
|
|
268
|
+
- Samples go into the project: `device_insert {device_name:"Simpler", sample_path}` and
|
|
269
|
+
`drum_kit_build` copy the file into the Live project by default and load the copy
|
|
270
|
+
(`imported_path`), so the set keeps working when moved; `import_into_project:false` loads the
|
|
271
|
+
original. `simpler_replace_sample` loads the file as it is unless you pass
|
|
272
|
+
`import_into_project:true` — do pass it.
|
|
273
|
+
|
|
274
|
+
## Copying, moving and presets (lossy)
|
|
275
|
+
|
|
276
|
+
- Live's API cannot move, reorder or copy devices. `device_copy {device_id, track_name |
|
|
277
|
+
target_id, index?}` inserts a fresh built-in device of the same name and copies its parameter
|
|
278
|
+
values by name (a Simpler also gets its sample). `move:true` deletes the original afterwards:
|
|
279
|
+
"move the compressor before the EQ" = `device_copy {device_id:<comp>, index:<EQ's index>,
|
|
280
|
+
move:true}` (target omitted = the same track or chain; `index` counts the current devices).
|
|
281
|
+
- It is lossy and you must say so: automation, modulation and MIDI/macro mappings, a custom
|
|
282
|
+
device name and any state that is not a parameter are lost, and the device gets a new id
|
|
283
|
+
(the old one is gone after a move). Racks are refused (use `device_duplicate` in place). If
|
|
284
|
+
some values could not be copied (`not_copied`), a move keeps the original.
|
|
285
|
+
- If the user renamed the device in Live, pass the built-in name as `device_name`.
|
|
286
|
+
- Presets: `device_preset_save {name, track_name, device}` stores the parameter values (and a
|
|
287
|
+
Simpler's sample path) as JSON in the extension's storage directory; `device_preset_load
|
|
288
|
+
{name, track_name}` inserts the device with those values (add `device` or `device_id` to
|
|
289
|
+
load onto an existing one); `device_preset_list` shows them. These are this server's
|
|
290
|
+
snapshots, not Live presets (`.adv`): no automation, mappings or other device state.
|
|
291
|
+
|
|
292
|
+
## Mixing
|
|
293
|
+
|
|
294
|
+
- `mixer_set {track_name | target_id, volume?, panning?, sends?}` sets levels in one call (one
|
|
295
|
+
undo step). Volume is normalized 0–1 (0.85 = 0 dB unity, 1.0 = +6 dB), panning -1..1.
|
|
296
|
+
- Sends are addressed by `index` (aligned with the return tracks) or `return_name`:
|
|
297
|
+
`sends:[{return_name:"A-Reverb", value:0.3}]`.
|
|
298
|
+
- Many mixers at once, still one undo step: `targets:[{track_name:"Bass"}, {track_name:"Keys"}]`
|
|
299
|
+
(same values), `items:[{track_name, volume}, ...]` (own values), or
|
|
300
|
+
`all_tracks:true, exclude:[{track_name:"Vocals"}]` (every regular track but those).
|
|
301
|
+
With `all_tracks`, volume is only set on the top-most tracks: a group covers its tracks
|
|
302
|
+
(they keep their volume, so it is not changed twice); panning and sends are set on every
|
|
303
|
+
track, grouped ones included (a grouped track's sends go straight to the returns), and a
|
|
304
|
+
covered track then says `volume_skipped`. Tracks inside an excluded group are left alone,
|
|
305
|
+
and a group holding an excluded track is skipped while its other tracks are set. The
|
|
306
|
+
result's `skipped` says why.
|
|
307
|
+
- There is no relative or dB setting: read the current values with `mixer_get` first if the
|
|
308
|
+
user asks for "3 dB quieter", and say that the dB mapping is approximate.
|
|
309
|
+
- `mixer_get` returns the same values with parameter ids (for `parameter_set` automation).
|
|
310
|
+
|
|
311
|
+
## Audio
|
|
312
|
+
|
|
313
|
+
- Audio clips: `clip_create {type:"audio", file_path:"/abs/path.wav", ...}` — the file is
|
|
314
|
+
imported into the project automatically (keep `import_into_project: true`).
|
|
315
|
+
- Warping: `clip_set {warping, warp_mode}` — modes: Beats, Tones, Texture, Repitch, Complex,
|
|
316
|
+
ComplexPro. For all clips of a track: `clip_set {select:{track_name:"Drums"}, warping:true,
|
|
317
|
+
warp_mode:"ComplexPro"}`.
|
|
318
|
+
- `render_track_audio` renders the pre-FX audio of an audio track (its clip audio before the
|
|
319
|
+
device chain: no effects, mixer or sends) to a WAV or AIFF file (Live's Record File Type
|
|
320
|
+
setting decides) and returns the path — useful for
|
|
321
|
+
analysis or resampling. Since Live 12.4.15 the render is not normalized. The file lives in
|
|
322
|
+
the extension's temp directory, which may be cleaned: `persist:true` copies it into the
|
|
323
|
+
project (`imported_path`; or `import_file` it, or `clip_create` with it).
|
|
324
|
+
- "Is this take clipping / silent / where is it loud?": `render_track_audio {track_name, start_time,
|
|
325
|
+
end_time, analyze:true}` returns `analysis` read from the render: `file_type` (`wav` or
|
|
326
|
+
`aiff`), `peak_dbfs` and `rms_dbfs`
|
|
327
|
+
(overall and per channel; `null` = digital silence), `clipped_samples` (at or over 0 dBFS),
|
|
328
|
+
`silent` (peak below -80 dBFS) and a 32-part `envelope` of peak and RMS dBFS. Pre-FX: it
|
|
329
|
+
measures the clips, not the track's output after its devices and fader (there is no metering).
|
|
330
|
+
`tracks:[...]` renders and analyzes several audio tracks over the same range.
|
|
331
|
+
- Consolidating a comp or a stretch of clips: `audio_track_consolidate {track_name, start_time,
|
|
332
|
+
end_time, name?, color?}` renders the range pre-FX, imports the render, clears the range and
|
|
333
|
+
puts one unwarped clip there (it then plays at the current tempo only). Destructive: confirm
|
|
334
|
+
first. The device chain stays on the track.
|
|
335
|
+
- Finding files: `sample_search {query:"kick 808", extensions?, roots?, limit?}` searches the
|
|
336
|
+
`sample_roots` of the extension's config.json plus Live's User Library and Factory Packs
|
|
337
|
+
folders (when they exist) — read-only, and nothing outside those folders. With no folder it
|
|
338
|
+
returns a `hint`: tell the user to add `"sample_roots": ["/path/to/samples"]` to config.json.
|
|
339
|
+
|
|
340
|
+
## Song structure
|
|
341
|
+
|
|
342
|
+
- Tempo: `song_set {tempo}` (BPM; the only song-level property Live lets extensions write).
|
|
343
|
+
- Scenes: `scene_create {items:[{name:"Intro"}, {name:"Verse"}, {name:"Chorus"}]}` appends
|
|
344
|
+
them in order (an entry's `index` refers to the list after the previous entries).
|
|
345
|
+
`scene_duplicate {scene_name}` duplicates a scene; the copy lands right after the original.
|
|
346
|
+
- Locators: `cue_point_create {items:[{time:0, name:"Intro"}, {time:32, name:"Verse"}]}`.
|
|
347
|
+
- Moving a locator: `cue_point_set {cue_point_id, time}`. Live cannot change a cue point's
|
|
348
|
+
time, so it is re-created at the new time with its name and the old one is deleted: use the
|
|
349
|
+
returned `id` from then on (`replaced_id` is the old, now invalid one). A move onto a beat
|
|
350
|
+
that already has a cue point is refused.
|
|
351
|
+
- Copying clips: `clip_copy {clip_id, track_name, start_time}` (arrangement), `{clip_id,
|
|
352
|
+
track_name, scene_name}` (an empty session slot) or `{clip_id, target_id:<take lane>,
|
|
353
|
+
start_time}`; `move:true` deletes the source afterwards; `duration` makes it longer (the loop
|
|
354
|
+
repeats). Live's API has no clip copy: the copy is a new clip with a new id. MIDI notes are
|
|
355
|
+
re-based to where the source plays them (`fidelity:"notes"`), so an arrangement copy plays the
|
|
356
|
+
same. A session copy loops its whole length: when the source starts before its loop, or the
|
|
357
|
+
copy is not whole loops, it repeats differently and `lost` says so — tell the user; audio
|
|
358
|
+
copies keep the file, warping and markers but Live warps them itself
|
|
359
|
+
(`fidelity:"approximate"`, check `warp_markers_match` and `differs`). Clip envelopes, groove
|
|
360
|
+
and launch settings are never copied (`lost`) — say so.
|
|
361
|
+
- "Repeat the chorus" / "copy bars 9-16 to bar 33": `arrangement_copy_range {start_time:32,
|
|
362
|
+
end_time:64, to_time:128, tracks?, include_cue_points?}`. It OVERWRITES the target range on
|
|
363
|
+
every selected track (cleared first, also where the source is empty); nothing after it moves
|
|
364
|
+
(the API cannot insert time). MIDI clips crossing the source edges are trimmed; audio clips
|
|
365
|
+
crossing them are skipped and listed in `skipped` — tell the user. Take-lane clips are not
|
|
366
|
+
copied. Confirm with the user before overwriting a range that holds clips.
|
|
367
|
+
|
|
368
|
+
## Interacting with the user in Live
|
|
369
|
+
|
|
370
|
+
- `show_dialog` opens a modal dialog in Live; it blocks Live's UI until the user closes it, so
|
|
371
|
+
use it sparingly: to confirm a destructive bulk edit, ask for a few values, or show a summary.
|
|
372
|
+
- Prefer a `form`: the server builds the page (all text escaped) and answers as JSON.
|
|
373
|
+
`show_dialog {form:{title:"Delete 12 clips?", message:"On Drums and Perc.\nUndo restores them.",
|
|
374
|
+
choices:["Delete", "Keep"]}, wait:false}` → `dialog_result {dialog_id}` → `{status:"closed",
|
|
375
|
+
choice:"Delete", choice_index:0}`. Fields (`text`, `textarea`, `number`, `checkbox`, `select`
|
|
376
|
+
with `options`; `name`, `label?`, `default?`) come back in `values` by name, with every button
|
|
377
|
+
(number: a number or null). Default buttons: OK, or OK and Cancel with fields. Act only on the
|
|
378
|
+
choice the user made; `choice: null` means the dialog closed without a button.
|
|
379
|
+
- Waiting: by default `show_dialog` returns when the dialog closes, but the client's request
|
|
380
|
+
timeout (often 60 s) can end the call first while the dialog stays open. For anything the user
|
|
381
|
+
has to think about, pass `wait:false` and poll `dialog_result {dialog_id, wait_s}` (≤ 50 s;
|
|
382
|
+
`timed_out:true` = still open: call again). After a cut-off call, `dialog_result` without an id
|
|
383
|
+
returns the last dialog's answer. Answers are kept 10 minutes.
|
|
384
|
+
- One dialog at a time: while one is open, `show_dialog` is refused with its `dialog_id` — get
|
|
385
|
+
its answer instead. Only when the user says it is closed already, retry with `force:true`.
|
|
386
|
+
- Own pages: `html` (it must post `close_and_send` itself, see the tool description) or `url`
|
|
387
|
+
(https:, file: or http://localhost) return the page's string as `result`. Dialogs keep no
|
|
388
|
+
state between calls: each one starts from what you pass. Live cannot close a dialog from code.
|
|
389
|
+
|
|
390
|
+
## What is NOT possible
|
|
391
|
+
|
|
392
|
+
The Extensions API (1.0.0) has no access to:
|
|
393
|
+
|
|
394
|
+
- transport (play/stop/record), song position, clip or scene launching;
|
|
395
|
+
- reading the user's selection or focused object directly (only the "MCP: Use as selection"
|
|
396
|
+
context-menu handoff);
|
|
397
|
+
- the song length (`arrangement_get` derives `song_end` from the clips);
|
|
398
|
+
- the browser, third-party plug-ins, Live's own device presets (`.adv`/`.adg`) — the
|
|
399
|
+
`device_preset_*` tools keep this server's JSON snapshots instead;
|
|
400
|
+
- moving, reordering or renaming devices (`device_copy` emulates move/reorder, lossily);
|
|
401
|
+
- automation envelopes, modulation, MIDI/macro mapping;
|
|
402
|
+
- track color, routing and sidechain sources, MIDI routing;
|
|
403
|
+
- reordering or grouping tracks, creating return tracks;
|
|
404
|
+
- metering (no level readouts; `render_track_audio {analyze:true}` measures an audio track's
|
|
405
|
+
clips pre-FX, not its output);
|
|
406
|
+
- editing clip start/end markers or loop positions after creation (a MIDI clip's loop can't
|
|
407
|
+
be set even at creation) — `clip_copy` re-bases a MIDI clip's notes instead;
|
|
408
|
+
- copying, moving or trimming clips natively (`clip_copy` / `arrangement_copy_range` create new
|
|
409
|
+
clips) and inserting time into the arrangement;
|
|
410
|
+
- the song time signature (scenes report theirs, read-only).
|
|
411
|
+
|
|
412
|
+
Don't pretend otherwise or improvise workarounds — tell the user when asked.
|
|
413
|
+
|
|
414
|
+
## Destructive operations
|
|
415
|
+
|
|
416
|
+
`track_delete`, `scene_delete`, `clip_delete`, `cue_point_delete`, `device_delete`,
|
|
417
|
+
`midi_clip_set_notes` (mode `replace`), `midi_clip_edit_notes` (with `delete`),
|
|
418
|
+
`track_clear_clips_in_range`, `simpler_replace_sample` (discards the current sample),
|
|
419
|
+
`device_copy` and `clip_copy` with `move` (delete the original; lossy), `device_preset_load` onto a
|
|
420
|
+
Simpler and `drum_kit_build` on existing pads (replace their samples), `arrangement_copy_range`
|
|
421
|
+
(overwrites its target range) and `audio_track_consolidate` (clears its range) change the user's
|
|
422
|
+
project (each step is undoable in Live). `execute_command` runs arbitrary Live commands, other
|
|
423
|
+
extensions' included, so it is destructive and open-world too.
|
|
424
|
+
`device_preset_save` with `overwrite` replaces a saved preset file. `track_delete` and `scene_delete`
|
|
425
|
+
by name need the exact name, so a case-insensitive guess can't delete the wrong object. They carry the MCP
|
|
426
|
+
`destructiveHint` annotation; read-only tools carry `readOnlyHint`. For bulk destructive edits
|
|
427
|
+
the user didn't explicitly enumerate, confirm first — in Live with a `show_dialog` form
|
|
428
|
+
(see [Interacting with the user in Live](#interacting-with-the-user-in-live)) or in the chat.
|
|
429
|
+
`batch` carries `destructiveHint` too (it runs whatever its steps do); `batch_read` is read-only.
|