@mthines/reaper-mcp 0.6.0 → 0.7.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/README.md +189 -34
- package/claude-agents/gain-stage.md +25 -8
- package/claude-agents/master.md +3 -0
- package/claude-agents/mix-analyzer.md +17 -8
- package/claude-agents/mix-engineer.md +56 -16
- package/knowledge/reference/common-mistakes.md +29 -1
- package/knowledge/reference/frequencies.md +15 -13
- package/knowledge/reference/metering.md +19 -0
- package/knowledge/reference/perceived-loudness.md +122 -0
- package/knowledge/workflows/gain-staging.md +20 -6
- package/main.js +723 -91
- package/package.json +6 -1
- package/reaper/mcp_bridge.lua +641 -44
package/README.md
CHANGED
|
@@ -24,17 +24,23 @@ npx @mthines/reaper-mcp install-skills
|
|
|
24
24
|
# 4. Open Claude Code — you're ready to mix
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
That's it. Claude Code now has
|
|
27
|
+
That's it. Claude Code now has 67 REAPER tools and a professional mix engineer's knowledge base.
|
|
28
28
|
|
|
29
29
|
## What it does
|
|
30
30
|
|
|
31
31
|
```
|
|
32
32
|
Claude Code
|
|
33
|
-
├── MCP Tools (
|
|
34
|
-
│ ├── Track management (list, get/set properties)
|
|
35
|
-
│ ├── FX management (add/remove, get/set parameters, presets)
|
|
33
|
+
├── MCP Tools (67) ──→ controls REAPER in real-time
|
|
34
|
+
│ ├── Track management (list, get/set properties, arm, phase, input)
|
|
35
|
+
│ ├── FX management (add/remove, get/set parameters, enable/offline, presets)
|
|
36
36
|
│ ├── Transport (play, stop, record, cursor position)
|
|
37
37
|
│ ├── Metering (peak/RMS, FFT spectrum, LUFS, correlation, crest factor)
|
|
38
|
+
│ ├── Selection (selected tracks, time selection)
|
|
39
|
+
│ ├── Markers & regions (list, add, delete)
|
|
40
|
+
│ ├── Tempo map (all tempo/time sig changes)
|
|
41
|
+
│ ├── Envelopes (list, read/write automation points)
|
|
42
|
+
│ ├── MIDI editing (14 tools: notes, CC, items, analysis, batch ops)
|
|
43
|
+
│ ├── Media items (11 tools: properties, split, move, trim, stretch)
|
|
38
44
|
│ ├── Plugin discovery (list installed FX, search, presets)
|
|
39
45
|
│ ├── Snapshots (save/restore mixer state for A/B comparison)
|
|
40
46
|
│ └── Routing (sends, receives, bus structure)
|
|
@@ -43,7 +49,7 @@ Claude Code
|
|
|
43
49
|
├── Plugin knowledge (ReaEQ, Pro-Q 3, Helix Native, etc.)
|
|
44
50
|
├── Genre rules (rock, pop, hip-hop, electronic, orchestral, metal)
|
|
45
51
|
├── Workflows (gain staging, vocal chain, drum bus, mastering)
|
|
46
|
-
└── Reference (frequencies, compression, LUFS targets, common mistakes)
|
|
52
|
+
└── Reference (frequencies, compression, LUFS targets, perceived loudness, common mistakes)
|
|
47
53
|
```
|
|
48
54
|
|
|
49
55
|
## Architecture
|
|
@@ -72,6 +78,7 @@ npx @mthines/reaper-mcp setup
|
|
|
72
78
|
```
|
|
73
79
|
|
|
74
80
|
This copies into your REAPER resource folder:
|
|
81
|
+
|
|
75
82
|
- `mcp_bridge.lua` — persistent Lua bridge script
|
|
76
83
|
- `mcp_analyzer.jsfx` — FFT spectrum analyzer
|
|
77
84
|
- `mcp_lufs_meter.jsfx` — ITU-R BS.1770 LUFS meter
|
|
@@ -95,6 +102,7 @@ npx @mthines/reaper-mcp install-skills
|
|
|
95
102
|
```
|
|
96
103
|
|
|
97
104
|
This creates in your project:
|
|
105
|
+
|
|
98
106
|
- `.claude/agents/` — mix engineer subagents (`@mix-engineer`, `@gain-stage`, `@mix-analyzer`, `@master`)
|
|
99
107
|
- `.claude/rules/` — architecture and development rules
|
|
100
108
|
- `.claude/skills/` — skills like `/learn-plugin`
|
|
@@ -109,29 +117,34 @@ npx @mthines/reaper-mcp doctor
|
|
|
109
117
|
|
|
110
118
|
Checks that the bridge is connected, knowledge is installed, and MCP config exists.
|
|
111
119
|
|
|
112
|
-
## MCP Tools (
|
|
120
|
+
## MCP Tools (67)
|
|
121
|
+
|
|
122
|
+
### Project & Tracks
|
|
113
123
|
|
|
114
|
-
### Track Management
|
|
115
124
|
| Tool | Description |
|
|
116
125
|
|------|-------------|
|
|
117
126
|
| `get_project_info` | Project name, tempo, time sig, sample rate, transport state |
|
|
118
|
-
| `list_tracks` | All tracks with volume, pan, mute/solo, FX count, routing |
|
|
127
|
+
| `list_tracks` | All tracks with volume, pan, mute/solo, arm, phase, FX count, routing |
|
|
119
128
|
| `get_track_properties` | Detailed track info + full FX chain list |
|
|
120
|
-
| `set_track_property` | Set volume (dB), pan, mute, solo |
|
|
129
|
+
| `set_track_property` | Set volume (dB), pan, mute, solo, recordArm, phase, input |
|
|
121
130
|
|
|
122
131
|
### FX Management
|
|
132
|
+
|
|
123
133
|
| Tool | Description |
|
|
124
134
|
|------|-------------|
|
|
125
135
|
| `add_fx` | Add FX by name (partial match: "ReaEQ", "Pro-Q 3") |
|
|
126
136
|
| `remove_fx` | Remove FX from chain by index |
|
|
127
137
|
| `get_fx_parameters` | List all FX params with values and ranges |
|
|
128
138
|
| `set_fx_parameter` | Set FX parameter (normalized 0.0-1.0) |
|
|
139
|
+
| `set_fx_enabled` | Enable or disable (bypass) an FX plugin |
|
|
140
|
+
| `set_fx_offline` | Set FX online/offline (offline = no CPU, preserves settings) |
|
|
129
141
|
| `list_available_fx` | Discover all installed plugins (VST, VST3, JS, CLAP, AU) |
|
|
130
142
|
| `search_fx` | Fuzzy search installed plugins by name |
|
|
131
143
|
| `get_fx_preset_list` | List available presets for an FX |
|
|
132
144
|
| `set_fx_preset` | Load a preset by name |
|
|
133
145
|
|
|
134
146
|
### Transport
|
|
147
|
+
|
|
135
148
|
| Tool | Description |
|
|
136
149
|
|------|-------------|
|
|
137
150
|
| `play` | Start playback |
|
|
@@ -140,7 +153,42 @@ Checks that the bridge is connected, knowledge is installed, and MCP config exis
|
|
|
140
153
|
| `get_transport_state` | Play/record/pause, cursor positions, tempo, time sig |
|
|
141
154
|
| `set_cursor_position` | Move edit cursor to position (seconds) |
|
|
142
155
|
|
|
156
|
+
### Selection & Navigation
|
|
157
|
+
|
|
158
|
+
| Tool | Description |
|
|
159
|
+
|------|-------------|
|
|
160
|
+
| `get_selected_tracks` | Currently selected tracks with indices and names |
|
|
161
|
+
| `get_time_selection` | Time/loop selection start, end, length |
|
|
162
|
+
| `set_time_selection` | Set the time selection range |
|
|
163
|
+
|
|
164
|
+
### Markers & Regions
|
|
165
|
+
|
|
166
|
+
| Tool | Description |
|
|
167
|
+
|------|-------------|
|
|
168
|
+
| `list_markers` | All project markers (index, name, position, color) |
|
|
169
|
+
| `list_regions` | All regions (index, name, start/end, color) |
|
|
170
|
+
| `add_marker` | Add marker at position with optional name/color |
|
|
171
|
+
| `add_region` | Add region with start/end, optional name/color |
|
|
172
|
+
| `delete_marker` | Delete a marker by index |
|
|
173
|
+
| `delete_region` | Delete a region by index |
|
|
174
|
+
|
|
175
|
+
### Tempo Map
|
|
176
|
+
|
|
177
|
+
| Tool | Description |
|
|
178
|
+
|------|-------------|
|
|
179
|
+
| `get_tempo_map` | All tempo/time sig changes (position, BPM, time sig, linear) |
|
|
180
|
+
|
|
181
|
+
### Envelopes / Automation
|
|
182
|
+
|
|
183
|
+
| Tool | Description |
|
|
184
|
+
|------|-------------|
|
|
185
|
+
| `get_track_envelopes` | List envelopes on a track (name, point count, active/visible/armed) |
|
|
186
|
+
| `get_envelope_points` | Get automation points with pagination |
|
|
187
|
+
| `insert_envelope_point` | Insert automation point (time, value, shape, tension) |
|
|
188
|
+
| `delete_envelope_point` | Delete an automation point by index |
|
|
189
|
+
|
|
143
190
|
### Metering & Analysis
|
|
191
|
+
|
|
144
192
|
| Tool | Description |
|
|
145
193
|
|------|-------------|
|
|
146
194
|
| `read_track_meters` | Peak/RMS L/R in dB |
|
|
@@ -149,7 +197,33 @@ Checks that the bridge is connected, knowledge is installed, and MCP config exis
|
|
|
149
197
|
| `read_track_correlation` | Stereo correlation, width, mid/side levels |
|
|
150
198
|
| `read_track_crest` | Crest factor (peak-to-RMS ratio) |
|
|
151
199
|
|
|
200
|
+
### MIDI Editing (14 tools)
|
|
201
|
+
|
|
202
|
+
| Tool | Description |
|
|
203
|
+
|------|-------------|
|
|
204
|
+
| `create_midi_item` | Create empty MIDI item on a track |
|
|
205
|
+
| `list_midi_items` | List MIDI items with position, length, note/CC counts |
|
|
206
|
+
| `get_midi_notes` | Get notes with pagination (offset/limit) |
|
|
207
|
+
| `analyze_midi` | Per-pitch velocity stats, histogram, machine gun detection |
|
|
208
|
+
| `insert_midi_note` / `insert_midi_notes` | Insert single or batch notes |
|
|
209
|
+
| `edit_midi_note` / `edit_midi_notes` | Edit single or batch notes |
|
|
210
|
+
| `delete_midi_note` | Delete a note by index |
|
|
211
|
+
| `get_midi_cc` / `insert_midi_cc` / `delete_midi_cc` | CC event management |
|
|
212
|
+
| `get_midi_item_properties` / `set_midi_item_properties` | MIDI item props |
|
|
213
|
+
|
|
214
|
+
### Media Item Editing (11 tools)
|
|
215
|
+
|
|
216
|
+
| Tool | Description |
|
|
217
|
+
|------|-------------|
|
|
218
|
+
| `list_media_items` | List items on a track (position, length, name, volume, type) |
|
|
219
|
+
| `get_media_item_properties` | Detailed properties (fades, play rate, pitch, source) |
|
|
220
|
+
| `set_media_item_properties` / `set_media_items_properties` | Set single or batch |
|
|
221
|
+
| `split_media_item` | Split at position, returns left/right info |
|
|
222
|
+
| `delete_media_item` / `move_media_item` / `trim_media_item` | Edit operations |
|
|
223
|
+
| `add_stretch_marker` / `get_stretch_markers` / `delete_stretch_marker` | Time-stretching |
|
|
224
|
+
|
|
152
225
|
### Snapshots (A/B Testing)
|
|
226
|
+
|
|
153
227
|
| Tool | Description |
|
|
154
228
|
|------|-------------|
|
|
155
229
|
| `snapshot_save` | Save current mixer state (volumes, pans, FX, mutes) |
|
|
@@ -157,6 +231,7 @@ Checks that the bridge is connected, knowledge is installed, and MCP config exis
|
|
|
157
231
|
| `snapshot_list` | List all saved snapshots |
|
|
158
232
|
|
|
159
233
|
### Routing
|
|
234
|
+
|
|
160
235
|
| Tool | Description |
|
|
161
236
|
|------|-------------|
|
|
162
237
|
| `get_track_routing` | Sends, receives, parent/folder info for a track |
|
|
@@ -167,12 +242,12 @@ Once you've run `setup` and `install-skills`, open Claude Code in your project d
|
|
|
167
242
|
|
|
168
243
|
### Available Agents
|
|
169
244
|
|
|
170
|
-
| Agent
|
|
171
|
-
|
|
245
|
+
| Agent | Invocation | What it does |
|
|
246
|
+
| ---------------- | --------------- | ------------------------------------------------------------------------- |
|
|
172
247
|
| **Mix Engineer** | `@mix-engineer` | General-purpose mix agent — analyzes, suggests, and executes any mix task |
|
|
173
|
-
| **Gain Stage**
|
|
174
|
-
| **Mix Analyzer** | `@mix-analyzer` | "Roast my mix" — analysis only, no changes, produces detailed report
|
|
175
|
-
| **Master**
|
|
248
|
+
| **Gain Stage** | `@gain-stage` | Perceived-loudness-aware gain staging with proper headroom |
|
|
249
|
+
| **Mix Analyzer** | `@mix-analyzer` | "Roast my mix" — analysis only, no changes, produces detailed report |
|
|
250
|
+
| **Master** | `@master` | Mastering chain targeting specific LUFS/platform standards |
|
|
176
251
|
|
|
177
252
|
### How to use them
|
|
178
253
|
|
|
@@ -196,12 +271,14 @@ claude --agent mix-engineer
|
|
|
196
271
|
### What happens under the hood
|
|
197
272
|
|
|
198
273
|
Each agent has:
|
|
274
|
+
|
|
199
275
|
- **Its own system prompt** — thinks like a mix engineer, not a general assistant
|
|
200
276
|
- **Pre-approved REAPER tools** — no permission prompts for every MCP call
|
|
201
277
|
- **Scoped MCP access** — only the `reaper` MCP server is loaded
|
|
202
278
|
- **Embedded reference data** — frequency bands, LUFS targets, compression settings
|
|
203
279
|
|
|
204
280
|
The workflow is always:
|
|
281
|
+
|
|
205
282
|
1. **Save a snapshot** (so you can always A/B or undo)
|
|
206
283
|
2. **Analyze** — read meters, spectrum, LUFS, correlation, crest factor
|
|
207
284
|
3. **Reason** — apply genre rules, frequency knowledge, and plugin expertise
|
|
@@ -212,6 +289,7 @@ The workflow is always:
|
|
|
212
289
|
### A/B Comparison
|
|
213
290
|
|
|
214
291
|
Every change is bracketed by snapshots:
|
|
292
|
+
|
|
215
293
|
1. Agent saves a "Before" snapshot automatically
|
|
216
294
|
2. Makes all changes
|
|
217
295
|
3. Saves an "After" snapshot
|
|
@@ -236,12 +314,12 @@ The knowledge base is what makes this more than just a remote control — it's a
|
|
|
236
314
|
|
|
237
315
|
Ships with knowledge for stock REAPER plugins and popular third-party suites:
|
|
238
316
|
|
|
239
|
-
| Plugin
|
|
240
|
-
|
|
241
|
-
| ReaEQ, ReaComp, ReaDelay, ReaVerb, ReaGate, ReaLimit | Stock
|
|
242
|
-
| FabFilter Pro-Q 3, Pro-C 2, Pro-L 2
|
|
243
|
-
| Line 6 Helix Native
|
|
244
|
-
| JS: 1175 Compressor
|
|
317
|
+
| Plugin | Category | Preference |
|
|
318
|
+
| ---------------------------------------------------- | ----------------------- | ---------- |
|
|
319
|
+
| ReaEQ, ReaComp, ReaDelay, ReaVerb, ReaGate, ReaLimit | Stock | 30-50 |
|
|
320
|
+
| FabFilter Pro-Q 3, Pro-C 2, Pro-L 2 | Premium EQ/Comp/Limiter | 85-92 |
|
|
321
|
+
| Line 6 Helix Native | Amp Sim | 82 |
|
|
322
|
+
| JS: 1175 Compressor | Character Comp | 50 |
|
|
245
323
|
|
|
246
324
|
The agent automatically discovers your installed plugins and uses the best available option for each task. If you have Pro-Q 3, it uses that. If not, it falls back to ReaEQ.
|
|
247
325
|
|
|
@@ -263,14 +341,14 @@ Or manually add a markdown file to `knowledge/plugins/`. See `knowledge/plugins/
|
|
|
263
341
|
|
|
264
342
|
Processing decisions adapt to the genre:
|
|
265
343
|
|
|
266
|
-
| Genre
|
|
267
|
-
|
|
268
|
-
| Rock
|
|
269
|
-
| Pop
|
|
270
|
-
| Hip-Hop
|
|
271
|
-
| Electronic | -10 to -6
|
|
272
|
-
| Orchestral | -23 to -16
|
|
273
|
-
| Metal
|
|
344
|
+
| Genre | LUFS Target | Key Characteristics |
|
|
345
|
+
| ---------- | ----------- | ----------------------------------------------- |
|
|
346
|
+
| Rock | -11 to -9 | Parallel drum compression, hard-panned guitars |
|
|
347
|
+
| Pop | -14 to -10 | Vocal-forward, two-stage compression, bus glue |
|
|
348
|
+
| Hip-Hop | -10 to -7 | 808 saturation, aggressive vocal comp, mono sub |
|
|
349
|
+
| Electronic | -10 to -6 | Sidechain pump, sub mono, stereo width |
|
|
350
|
+
| Orchestral | -23 to -16 | Preserve dynamics, hall reverb staging |
|
|
351
|
+
| Metal | -11 to -8 | V-scoop guitars, tight drums, 4-guitar wall |
|
|
274
352
|
|
|
275
353
|
## Autonomous Mode (Allow All Tools)
|
|
276
354
|
|
|
@@ -307,7 +385,48 @@ Add to your project's `.claude/settings.json` (or `~/.claude/settings.json` for
|
|
|
307
385
|
"mcp__reaper__snapshot_save",
|
|
308
386
|
"mcp__reaper__snapshot_restore",
|
|
309
387
|
"mcp__reaper__snapshot_list",
|
|
310
|
-
"mcp__reaper__get_track_routing"
|
|
388
|
+
"mcp__reaper__get_track_routing",
|
|
389
|
+
"mcp__reaper__set_fx_enabled",
|
|
390
|
+
"mcp__reaper__set_fx_offline",
|
|
391
|
+
"mcp__reaper__get_selected_tracks",
|
|
392
|
+
"mcp__reaper__get_time_selection",
|
|
393
|
+
"mcp__reaper__set_time_selection",
|
|
394
|
+
"mcp__reaper__list_markers",
|
|
395
|
+
"mcp__reaper__list_regions",
|
|
396
|
+
"mcp__reaper__add_marker",
|
|
397
|
+
"mcp__reaper__add_region",
|
|
398
|
+
"mcp__reaper__delete_marker",
|
|
399
|
+
"mcp__reaper__delete_region",
|
|
400
|
+
"mcp__reaper__get_tempo_map",
|
|
401
|
+
"mcp__reaper__get_track_envelopes",
|
|
402
|
+
"mcp__reaper__get_envelope_points",
|
|
403
|
+
"mcp__reaper__insert_envelope_point",
|
|
404
|
+
"mcp__reaper__delete_envelope_point",
|
|
405
|
+
"mcp__reaper__create_midi_item",
|
|
406
|
+
"mcp__reaper__list_midi_items",
|
|
407
|
+
"mcp__reaper__get_midi_notes",
|
|
408
|
+
"mcp__reaper__analyze_midi",
|
|
409
|
+
"mcp__reaper__insert_midi_note",
|
|
410
|
+
"mcp__reaper__insert_midi_notes",
|
|
411
|
+
"mcp__reaper__edit_midi_note",
|
|
412
|
+
"mcp__reaper__edit_midi_notes",
|
|
413
|
+
"mcp__reaper__delete_midi_note",
|
|
414
|
+
"mcp__reaper__get_midi_cc",
|
|
415
|
+
"mcp__reaper__insert_midi_cc",
|
|
416
|
+
"mcp__reaper__delete_midi_cc",
|
|
417
|
+
"mcp__reaper__get_midi_item_properties",
|
|
418
|
+
"mcp__reaper__set_midi_item_properties",
|
|
419
|
+
"mcp__reaper__list_media_items",
|
|
420
|
+
"mcp__reaper__get_media_item_properties",
|
|
421
|
+
"mcp__reaper__set_media_item_properties",
|
|
422
|
+
"mcp__reaper__set_media_items_properties",
|
|
423
|
+
"mcp__reaper__split_media_item",
|
|
424
|
+
"mcp__reaper__delete_media_item",
|
|
425
|
+
"mcp__reaper__move_media_item",
|
|
426
|
+
"mcp__reaper__trim_media_item",
|
|
427
|
+
"mcp__reaper__add_stretch_marker",
|
|
428
|
+
"mcp__reaper__get_stretch_markers",
|
|
429
|
+
"mcp__reaper__delete_stretch_marker"
|
|
311
430
|
]
|
|
312
431
|
}
|
|
313
432
|
}
|
|
@@ -350,13 +469,31 @@ After `install-skills`, your project has a `.mcp.json`:
|
|
|
350
469
|
|
|
351
470
|
Claude Code reads this automatically. Open Claude Code in your project and the REAPER tools are available.
|
|
352
471
|
|
|
472
|
+
### Running from source (development)
|
|
473
|
+
|
|
474
|
+
If you're developing reaper-mcp and want changes reflected immediately without rebuilding, point your `.mcp.json` at the TypeScript source using `npx tsx`:
|
|
475
|
+
|
|
476
|
+
```json
|
|
477
|
+
{
|
|
478
|
+
"mcpServers": {
|
|
479
|
+
"reaper": {
|
|
480
|
+
"command": "npx",
|
|
481
|
+
"args": ["tsx", "/path/to/reaper-mcp/apps/reaper-mcp-server/src/main.ts", "serve"]
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
See [DEVELOPMENT.md](DEVELOPMENT.md) for the full dev workflow.
|
|
488
|
+
|
|
353
489
|
## Environment Variables
|
|
354
490
|
|
|
355
|
-
| Variable
|
|
356
|
-
|
|
491
|
+
| Variable | Description | Default |
|
|
492
|
+
| ---------------------- | ---------------------------------- | -------------------- |
|
|
357
493
|
| `REAPER_RESOURCE_PATH` | Override REAPER resource directory | Auto-detected per OS |
|
|
358
494
|
|
|
359
495
|
Platform defaults:
|
|
496
|
+
|
|
360
497
|
- **macOS**: `~/Library/Application Support/REAPER`
|
|
361
498
|
- **Windows**: `%APPDATA%/REAPER`
|
|
362
499
|
- **Linux**: `~/.config/REAPER`
|
|
@@ -366,14 +503,14 @@ Platform defaults:
|
|
|
366
503
|
```
|
|
367
504
|
reaper-mcp/
|
|
368
505
|
├── apps/
|
|
369
|
-
│ ├── reaper-mcp-server/ # MCP server (
|
|
506
|
+
│ ├── reaper-mcp-server/ # MCP server (67 tools, esbuild bundle)
|
|
370
507
|
│ └── reaper-mix-agent/ # AI mix agent (knowledge loader, plugin resolver)
|
|
371
508
|
├── libs/protocol/ # Shared TypeScript types
|
|
372
509
|
├── knowledge/ # AI mix engineer knowledge base
|
|
373
510
|
│ ├── plugins/ # Plugin-specific knowledge (extensible)
|
|
374
511
|
│ ├── genres/ # Genre mixing conventions
|
|
375
512
|
│ ├── workflows/ # Step-by-step mixing workflows
|
|
376
|
-
│ └── reference/ # Frequency, compression, metering cheat sheets
|
|
513
|
+
│ └── reference/ # Frequency, compression, metering, perceived loudness cheat sheets
|
|
377
514
|
├── reaper/ # Files installed into REAPER
|
|
378
515
|
│ ├── mcp_bridge.lua # Persistent Lua bridge
|
|
379
516
|
│ ├── mcp_analyzer.jsfx # FFT spectrum analyzer
|
|
@@ -384,16 +521,34 @@ reaper-mcp/
|
|
|
384
521
|
└── nx.json # Nx workspace config
|
|
385
522
|
```
|
|
386
523
|
|
|
524
|
+
## Updating the Lua Bridge
|
|
525
|
+
|
|
526
|
+
The MCP server (TypeScript) and the Lua bridge (REAPER) are two separate components. After updating to a new version — or after adding new tools during development — you need to reinstall the bridge files and reload the script in REAPER:
|
|
527
|
+
|
|
528
|
+
```bash
|
|
529
|
+
# Reinstall bridge files into REAPER
|
|
530
|
+
npx @mthines/reaper-mcp setup
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
Then in REAPER:
|
|
534
|
+
|
|
535
|
+
1. **Stop** the running bridge: Actions > Running Scripts > stop `mcp_bridge.lua`
|
|
536
|
+
2. **Reload** the updated script: Actions > Load ReaScript > select `mcp_bridge.lua` > Run
|
|
537
|
+
|
|
538
|
+
If existing tools (like `get_project_info`) work but new tools fail or timeout, this is almost always because the Lua bridge needs to be updated and reloaded.
|
|
539
|
+
|
|
387
540
|
## Development
|
|
388
541
|
|
|
389
542
|
```bash
|
|
390
543
|
pnpm install
|
|
391
544
|
pnpm nx run-many --target=build # Build all
|
|
392
545
|
pnpm nx run-many --target=lint # Lint all
|
|
393
|
-
pnpm nx run-many --target=test # Test all (
|
|
546
|
+
pnpm nx run-many --target=test # Test all (200+ tests)
|
|
394
547
|
pnpm nx run-many --target=build,lint,test # Everything
|
|
395
548
|
```
|
|
396
549
|
|
|
550
|
+
See [DEVELOPMENT.md](DEVELOPMENT.md) for the full dev workflow including running from source, MCP Inspector, and bridge update details.
|
|
551
|
+
|
|
397
552
|
## License
|
|
398
553
|
|
|
399
554
|
MIT
|
|
@@ -10,7 +10,9 @@ permissionMode: acceptEdits
|
|
|
10
10
|
|
|
11
11
|
# Gain Staging Agent
|
|
12
12
|
|
|
13
|
-
You are a gain staging specialist for REAPER DAW. Your
|
|
13
|
+
You are a gain staging specialist for REAPER DAW. Your job is to set all track levels to proper averages before any FX processing, ensuring proper headroom for the mix.
|
|
14
|
+
|
|
15
|
+
**Critical**: Don't just set every track to -18 dBFS. Account for **perceived loudness** — the human ear is 10-15 dB more sensitive at 2-5 kHz than at low frequencies. Bass instruments need higher meter readings than vocals/cymbals to sound balanced. Read `knowledge/reference/perceived-loudness.md` for the full reference.
|
|
14
16
|
|
|
15
17
|
---
|
|
16
18
|
|
|
@@ -42,14 +44,25 @@ params: { trackIndex: N }
|
|
|
42
44
|
```
|
|
43
45
|
Wait a few seconds of playback before reading. Record the RMS level for each track.
|
|
44
46
|
|
|
45
|
-
### Step 5: Calculate adjustments
|
|
46
|
-
|
|
47
|
+
### Step 5: Calculate adjustments (perceived-loudness-aware)
|
|
48
|
+
|
|
49
|
+
Use instrument-appropriate targets, NOT a flat -18 dBFS for everything:
|
|
50
|
+
|
|
51
|
+
| Instrument Category | Target RMS | Why |
|
|
52
|
+
|-------------------|-----------|-----|
|
|
53
|
+
| Sub/bass (kick sub, bass, 808) | -16 to -14 dBFS | Low frequencies sound quieter; needs more energy on meters |
|
|
54
|
+
| Full-range (piano, full guitar, strings) | -18 dBFS | Standard target; spans the perceptual range |
|
|
55
|
+
| Presence-range (vocals, snare crack, lead guitar) | -19 to -20 dBFS | 2-5 kHz content sounds louder than meters show |
|
|
56
|
+
| High-frequency (cymbals, hi-hats, shakers) | -20 to -22 dBFS | Very sensitive frequency range; a little goes a long way |
|
|
57
|
+
|
|
58
|
+
Formula: `gain_dB = target_dBFS - current_average_dBFS`
|
|
47
59
|
Round to nearest 0.5 dB.
|
|
48
60
|
|
|
49
61
|
Examples:
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
62
|
+
- Bass at -24 dBFS → target -15 dBFS → needs +9 dB
|
|
63
|
+
- Vocal at -10 dBFS → target -19 dBFS → needs -9 dB
|
|
64
|
+
- Piano at -24 dBFS → target -18 dBFS → needs +6 dB
|
|
65
|
+
- Hi-hat at -14 dBFS → target -21 dBFS → needs -7 dB
|
|
53
66
|
|
|
54
67
|
### Step 6: Apply adjustments via the track fader
|
|
55
68
|
```
|
|
@@ -77,8 +90,11 @@ List each track with:
|
|
|
77
90
|
|
|
78
91
|
---
|
|
79
92
|
|
|
80
|
-
## Targets
|
|
81
|
-
- **
|
|
93
|
+
## Targets (Perceived-Loudness-Aware)
|
|
94
|
+
- **Sub/bass instruments**: -16 to -14 dBFS RMS (sounds quieter than meters show)
|
|
95
|
+
- **Full-range instruments**: -18 dBFS RMS (standard target)
|
|
96
|
+
- **Presence-range instruments**: -19 to -20 dBFS RMS (sounds louder due to ear sensitivity)
|
|
97
|
+
- **High-frequency instruments**: -20 to -22 dBFS RMS (very sensitive range)
|
|
82
98
|
- **Peak per track**: -12 dBFS max
|
|
83
99
|
- **Mix bus peak**: -6 to -3 dBFS in the chorus
|
|
84
100
|
|
|
@@ -88,3 +104,4 @@ List each track with:
|
|
|
88
104
|
- Do NOT read a single moment — play the densest section for 10+ seconds
|
|
89
105
|
- Bus tracks sum multiple sources — check them AFTER adjusting source tracks
|
|
90
106
|
- If a track has wildly inconsistent levels, note it as needing clip gain editing (manual task)
|
|
107
|
+
- Do NOT set all tracks to the same dBFS target — bass instruments need more energy on meters than vocals/cymbals to sound perceptually balanced (see perceived loudness targets above)
|
package/claude-agents/master.md
CHANGED
|
@@ -73,6 +73,8 @@ Apply to the mix bus. Typical mastering moves:
|
|
|
73
73
|
| Presence | 2–4 kHz | +0.5 dB | Vocal clarity (only if needed) |
|
|
74
74
|
| Air shelf | 10–12 kHz | +0.5 to +1 dB | Subtle sparkle |
|
|
75
75
|
|
|
76
|
+
**Perceived loudness note**: The 2-5 kHz range is where the ear is most sensitive (10-15 dB more than bass). Even +0.5 dB here has outsized perceptual impact. Conversely, low-end cuts of -1 dB may barely be noticed. When assessing the spectrum, remember a "flat" analyzer response does NOT equal perceptually flat — the ear naturally amplifies presence frequencies.
|
|
77
|
+
|
|
76
78
|
**Rule**: If you're EQing more than +-2 dB, there's a mix problem — go back and fix it.
|
|
77
79
|
|
|
78
80
|
### Step 5: Mastering compression (optional, for glue only)
|
|
@@ -124,3 +126,4 @@ params: { name: "master-v1", description: "Mastered — targeting {LUFS} for {pl
|
|
|
124
126
|
- Linear phase EQ if available (avoids phase shift on the master)
|
|
125
127
|
- Always A/B with `snapshot_restore` — mastering can be subtle enough to fool yourself
|
|
126
128
|
- If the user asks for a specific LUFS target that's louder than genre convention, warn them but comply
|
|
129
|
+
- **Perceived loudness awareness**: When evaluating the mix bus spectrum, account for equal-loudness contours. A mix that looks flat on the analyzer will sound presence-heavy. A well-balanced master typically shows a gentle downward slope from low to high frequencies on a spectrum analyzer, compensating for the ear's heightened sensitivity at 2-5 kHz
|
|
@@ -27,7 +27,7 @@ tool: list_tracks
|
|
|
27
27
|
```
|
|
28
28
|
Note: track count, tempo, sample rate, bus structure.
|
|
29
29
|
|
|
30
|
-
### 2. Gain staging check
|
|
30
|
+
### 2. Gain staging check (perceived-loudness-aware)
|
|
31
31
|
Start playback of the chorus/loudest section:
|
|
32
32
|
```
|
|
33
33
|
tool: play
|
|
@@ -36,22 +36,30 @@ Then read meters for ALL tracks:
|
|
|
36
36
|
```
|
|
37
37
|
tool: read_track_meters (for each track)
|
|
38
38
|
```
|
|
39
|
-
Flag:
|
|
39
|
+
Flag standard issues:
|
|
40
40
|
- Any track averaging below -24 dBFS or above -10 dBFS
|
|
41
41
|
- Any track peaking at or above -3 dBFS
|
|
42
42
|
- Mix bus peaking above -6 dBFS
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
**Also check perceived loudness balance** (see `knowledge/reference/perceived-loudness.md`):
|
|
45
|
+
- Bass instruments (kick, bass, 808) should read **higher** on meters than vocals/guitars (-16 to -14 dBFS) — if they're at the same level as presence-range instruments, they'll sound too quiet
|
|
46
|
+
- Vocals/snare should read **lower** (-19 to -20 dBFS) — the 2-5 kHz content sounds louder than the meter shows
|
|
47
|
+
- Hi-hats/cymbals at similar meter levels as bass = way too loud perceptually
|
|
48
|
+
- Flag any mix where all tracks are at the same RMS level regardless of spectral content — this is a common amateur mistake
|
|
49
|
+
|
|
50
|
+
### 3. Frequency balance (with perceived loudness context)
|
|
45
51
|
Read spectrum on the mix bus:
|
|
46
52
|
```
|
|
47
53
|
tool: read_track_spectrum (mix bus index)
|
|
48
54
|
```
|
|
49
55
|
Check for:
|
|
50
|
-
- **Sub buildup** (20–60 Hz): excessive rumble
|
|
51
|
-
- **Low-mid mud** (200–400 Hz): cloudy, boxy sound
|
|
52
|
-
- **Harshness** (2–5 kHz): fatiguing, piercing
|
|
53
|
-
- **Missing air** (10–20 kHz): dull, lifeless
|
|
54
|
-
- **Missing presence** (1–4 kHz): vocals buried
|
|
56
|
+
- **Sub buildup** (20–60 Hz): excessive rumble — but remember sub energy sounds quieter than it meters; some buildup is needed for bass-heavy genres
|
|
57
|
+
- **Low-mid mud** (200–400 Hz): cloudy, boxy sound — the ear is less sensitive here, so mud accumulates before it's noticed on meters
|
|
58
|
+
- **Harshness** (2–5 kHz): fatiguing, piercing — the ear's peak sensitivity zone. Even modest energy here sounds loud and causes listening fatigue
|
|
59
|
+
- **Missing air** (10–20 kHz): dull, lifeless — sensitivity drops off, but accumulated boosts across many tracks cause fatigue
|
|
60
|
+
- **Missing presence** (1–4 kHz): vocals buried — often a masking issue (guitars/keys competing in the most sensitive range), not just a level issue
|
|
61
|
+
|
|
62
|
+
**Perceived loudness note**: A "flat" spectrum on an analyzer does NOT mean a perceptually balanced mix. The ear naturally amplifies 2-5 kHz, so a truly flat spectrum will sound harsh/forward in the presence range.
|
|
55
63
|
|
|
56
64
|
### 4. Dynamics check
|
|
57
65
|
```
|
|
@@ -136,3 +144,4 @@ Structure your output as:
|
|
|
136
144
|
- Don't just say "it's muddy" — say "200–400 Hz shows +4 dB above the average curve"
|
|
137
145
|
- Always suggest a specific fix, not just identify the problem
|
|
138
146
|
- Find something positive to mention — even in rough mixes
|
|
147
|
+
- **Account for perceived loudness** — don't flag bass instruments as "too hot" just because they meter higher than vocals. Bass needs more dB to sound balanced. Conversely, flag presence-range instruments that meter the same as bass — they'll sound much louder than intended
|
|
@@ -22,18 +22,22 @@ You are a professional mix engineer with 20 years of experience working inside R
|
|
|
22
22
|
4. **Use the best available plugin** for each task. Discover what's installed with `list_available_fx`, then check `knowledge/plugins/` for detailed settings.
|
|
23
23
|
5. **Iterate** — make a change, verify with meters, adjust if needed.
|
|
24
24
|
6. **Be genre-aware** — if the user mentions a genre, read the corresponding `knowledge/genres/{genre}.md` for conventions.
|
|
25
|
+
7. **Optimize for perceived loudness, not just meters** — the human ear is 10-15 dB more sensitive at 2-5 kHz than at 100 Hz. Bass instruments need higher meter readings than vocals/guitars to sound balanced. Always read `knowledge/reference/perceived-loudness.md` when making balance or EQ decisions.
|
|
25
26
|
|
|
26
27
|
---
|
|
27
28
|
|
|
28
29
|
## Available MCP Tools
|
|
29
30
|
|
|
30
|
-
You have access to
|
|
31
|
+
You have access to 67 REAPER tools via the `reaper` MCP server:
|
|
31
32
|
|
|
32
33
|
### Session Info
|
|
33
34
|
- `get_project_info` — project name, tempo, time sig, sample rate, transport
|
|
34
|
-
- `list_tracks` — all tracks with levels, FX counts, routing
|
|
35
|
+
- `list_tracks` — all tracks with levels, arm, phase, FX counts, routing
|
|
35
36
|
- `get_track_properties` — single track detail + full FX chain
|
|
36
37
|
- `get_track_routing` — sends, receives, bus structure
|
|
38
|
+
- `get_selected_tracks` — currently selected tracks
|
|
39
|
+
- `get_time_selection` — current time/loop selection (start, end, length)
|
|
40
|
+
- `set_time_selection` — set the time selection range
|
|
37
41
|
|
|
38
42
|
### Transport
|
|
39
43
|
- `play`, `stop`, `record` — transport control
|
|
@@ -41,13 +45,15 @@ You have access to 26 REAPER tools via the `reaper` MCP server:
|
|
|
41
45
|
- `set_cursor_position` — move cursor (seconds)
|
|
42
46
|
|
|
43
47
|
### Track Control
|
|
44
|
-
- `set_track_property` — volume (dB), pan, mute, solo
|
|
48
|
+
- `set_track_property` — volume (dB), pan, mute, solo, recordArm, phase, input
|
|
45
49
|
|
|
46
50
|
### FX Management
|
|
47
51
|
- `add_fx` — add plugin by name (partial match: "ReaEQ", "Pro-Q 3")
|
|
48
52
|
- `remove_fx` — remove from chain by index
|
|
49
53
|
- `get_fx_parameters` — list all params with values/ranges
|
|
50
54
|
- `set_fx_parameter` — set parameter (normalized 0.0–1.0)
|
|
55
|
+
- `set_fx_enabled` — enable or disable (bypass) an FX
|
|
56
|
+
- `set_fx_offline` — set FX online/offline (offline = no CPU, preserves settings)
|
|
51
57
|
- `list_available_fx` — discover ALL installed plugins
|
|
52
58
|
- `search_fx` — fuzzy search plugins by name
|
|
53
59
|
- `get_fx_preset_list` — list presets for an FX
|
|
@@ -65,6 +71,36 @@ You have access to 26 REAPER tools via the `reaper` MCP server:
|
|
|
65
71
|
- `snapshot_restore` — restore saved state
|
|
66
72
|
- `snapshot_list` — list all snapshots
|
|
67
73
|
|
|
74
|
+
### Markers & Regions
|
|
75
|
+
- `list_markers` — all project markers (index, name, position, color)
|
|
76
|
+
- `list_regions` — all regions (index, name, start/end, color)
|
|
77
|
+
- `add_marker`, `add_region` — add markers/regions with name/color
|
|
78
|
+
- `delete_marker`, `delete_region` — remove by index
|
|
79
|
+
|
|
80
|
+
### Tempo Map
|
|
81
|
+
- `get_tempo_map` — all tempo/time sig changes (position, BPM, time sig, linear)
|
|
82
|
+
|
|
83
|
+
### Envelopes / Automation
|
|
84
|
+
- `get_track_envelopes` — list envelopes on a track (volume, pan, FX params)
|
|
85
|
+
- `get_envelope_points` — get automation points with pagination
|
|
86
|
+
- `insert_envelope_point` — add automation point (time, value, shape, tension)
|
|
87
|
+
- `delete_envelope_point` — remove an automation point
|
|
88
|
+
|
|
89
|
+
### MIDI Editing (14 tools)
|
|
90
|
+
- `create_midi_item`, `list_midi_items` — create and list MIDI items
|
|
91
|
+
- `get_midi_notes`, `analyze_midi` — read/analyze notes (with pagination)
|
|
92
|
+
- `insert_midi_note`, `insert_midi_notes` — insert single/batch notes
|
|
93
|
+
- `edit_midi_note`, `edit_midi_notes` — edit single/batch notes
|
|
94
|
+
- `delete_midi_note` — delete a note
|
|
95
|
+
- `get_midi_cc`, `insert_midi_cc`, `delete_midi_cc` — CC events
|
|
96
|
+
- `get_midi_item_properties`, `set_midi_item_properties` — MIDI item props
|
|
97
|
+
|
|
98
|
+
### Media Item Editing (11 tools)
|
|
99
|
+
- `list_media_items`, `get_media_item_properties`, `set_media_item_properties` — read/write items
|
|
100
|
+
- `set_media_items_properties` — batch set on multiple items
|
|
101
|
+
- `split_media_item`, `delete_media_item`, `move_media_item`, `trim_media_item` — editing
|
|
102
|
+
- `add_stretch_marker`, `get_stretch_markers`, `delete_stretch_marker` — time-stretching
|
|
103
|
+
|
|
68
104
|
---
|
|
69
105
|
|
|
70
106
|
## Knowledge Base
|
|
@@ -77,6 +113,7 @@ If the project has a `knowledge/` directory (installed via `reaper-mcp install-s
|
|
|
77
113
|
- **`knowledge/reference/frequencies.md`** — EQ frequency cheat sheet
|
|
78
114
|
- **`knowledge/reference/compression.md`** — compression settings per instrument
|
|
79
115
|
- **`knowledge/reference/metering.md`** — LUFS targets, crest factor thresholds
|
|
116
|
+
- **`knowledge/reference/perceived-loudness.md`** — psychoacoustic loudness perception, equal-loudness contours, per-instrument compensation
|
|
80
117
|
- **`knowledge/reference/common-mistakes.md`** — amateur mixing mistakes checklist
|
|
81
118
|
|
|
82
119
|
Use `Glob` to find files and `Read` to load them when needed. Don't load everything upfront — load what's relevant to the current task.
|
|
@@ -143,19 +180,22 @@ Report what changed, before/after measurements, and suggestions for next steps.
|
|
|
143
180
|
|
|
144
181
|
## Quick Reference (Embedded)
|
|
145
182
|
|
|
146
|
-
### Frequency Bands
|
|
147
|
-
| Band | Range | Character | Common Issues |
|
|
148
|
-
|
|
149
|
-
| Sub | 20–60 Hz | Felt, rumble | HPF everything that doesn't need it |
|
|
150
|
-
| Bass | 60–250 Hz | Punch, warmth | Competing kick/bass |
|
|
151
|
-
| Low-mids | 250–500 Hz | **Mud zone** | Most common problem area |
|
|
152
|
-
| Mids | 500 Hz–2 kHz | Presence, character | Boxy, honky if excess |
|
|
153
|
-
| Upper-mids | 2–5 kHz | **
|
|
154
|
-
| Presence | 5–8 kHz | Sibilance, definition | De-esser territory |
|
|
155
|
-
| Air | 8–20 kHz | Sparkle, shimmer | Shelf boost for "expensive" sound |
|
|
156
|
-
|
|
157
|
-
### Gain Staging Targets
|
|
158
|
-
-
|
|
183
|
+
### Frequency Bands (with Perceived Loudness)
|
|
184
|
+
| Band | Range | Character | Perceived Loudness | Common Issues |
|
|
185
|
+
|------|-------|-----------|-------------------|--------------|
|
|
186
|
+
| Sub | 20–60 Hz | Felt, rumble | **Much quieter** than metered | HPF everything that doesn't need it |
|
|
187
|
+
| Bass | 60–250 Hz | Punch, warmth | **Quieter** than metered | Competing kick/bass; needs +3-6 dB over mids on meters |
|
|
188
|
+
| Low-mids | 250–500 Hz | **Mud zone** | Slightly quieter | Most common problem area |
|
|
189
|
+
| Mids | 500 Hz–2 kHz | Presence, character | ~Accurate to meters | Boxy, honky if excess |
|
|
190
|
+
| Upper-mids | 2–5 kHz | **Peak sensitivity** | **10-15 dB louder** than bass at same dB | Most sensitive hearing range — small boosts are very audible |
|
|
191
|
+
| Presence | 5–8 kHz | Sibilance, definition | **Louder** than metered | De-esser territory; a little goes a long way |
|
|
192
|
+
| Air | 8–20 kHz | Sparkle, shimmer | Sensitivity drops off | Shelf boost for "expensive" sound; fatigue risk if overdone |
|
|
193
|
+
|
|
194
|
+
### Gain Staging Targets (Perceived-Loudness-Aware)
|
|
195
|
+
- Sub/bass instruments: -16 to -14 dBFS average (higher to compensate for lower perceived loudness)
|
|
196
|
+
- Full-range instruments (piano, guitar): -18 dBFS average
|
|
197
|
+
- Presence-range instruments (vocals, snare): -19 to -20 dBFS average (presence frequencies sound louder)
|
|
198
|
+
- High-frequency instruments (cymbals, shakers): -20 to -22 dBFS average
|
|
159
199
|
- Mix bus: -6 to -3 dBFS peak before mastering
|
|
160
200
|
- Headroom for mastering: 4–6 dB
|
|
161
201
|
|