@mthines/reaper-mcp 0.82.1-beta.113.2 → 0.83.0-beta.112.1
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 +44 -44
- package/main.js +8 -56
- package/package.json +1 -1
- package/sidecar/server.py +4 -14
- package/sidecar/tests/test_chords.py +0 -15
- package/sidecar/tests/test_server.py +0 -13
- package/sidecar/tests/test_voice_render.py +1 -1
- package/sidecar/voice_render.py +2 -4
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
<picture>
|
|
4
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
5
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/logo-dark.svg">
|
|
5
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/logo.svg" alt="reaper-mcp" width="360">
|
|
6
6
|
</picture>
|
|
7
7
|
|
|
8
8
|
<br><br>
|
|
9
9
|
|
|
10
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
10
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/hero.svg" alt="reaper-mcp — Mix by asking. Type what you hear and an AI mix engineer inside your REAPER session does it." width="100%">
|
|
11
11
|
|
|
12
12
|
<br>
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ You chat in plain English in Claude Code, by keyboard (or dictation, if you like
|
|
|
21
21
|
[](https://claude.com/claude-code)
|
|
22
22
|
[](https://lorekit.io)
|
|
23
23
|
[](#-install-in-3-steps)
|
|
24
|
-
[](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
24
|
+
[](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/LICENSE)
|
|
25
25
|
|
|
26
26
|
[**Install in 3 steps**](#-install-in-3-steps) · [See it work](#-just-type-what-you-hear) · [What you get](#-why-producers-use-it) · [Watch it work](#-see-what-your-agent-is-doing) · [Extensions](#-extensions-teach-it-your-plugin) · [Clients & models](#-clients-and-models) · [FAQ](#-faq)
|
|
27
27
|
|
|
@@ -48,7 +48,7 @@ with your OS if you prefer, it's the same thing to the agent):
|
|
|
48
48
|
|
|
49
49
|
Here's what happens next:
|
|
50
50
|
|
|
51
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
51
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/session-demo.svg" alt="Illustrative session: the mixer saves a snapshot, measures, cuts the guitars where they mask the vocal, compresses the vocal, re-measures and saves an after snapshot." width="100%">
|
|
52
52
|
|
|
53
53
|
It isn't a preset and it isn't a guess. Before it touches anything it **measures your
|
|
54
54
|
actual tracks** (loudness, spectrum, stereo width, dynamics). It makes the change with
|
|
@@ -96,7 +96,7 @@ handling and dynamics to the style. Just tell it what you're making.
|
|
|
96
96
|
With **[LoreKit](#-lorekit-the-knowledge-core)** as its memory, it keeps what it learns
|
|
97
97
|
about your plugins and your taste, so a correction sticks. It also draws on a shared
|
|
98
98
|
plugin library that grows every time someone
|
|
99
|
-
**[contributes](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
99
|
+
**[contributes](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/knowledge/contributions/README.md)**, you included.
|
|
100
100
|
|
|
101
101
|
</td>
|
|
102
102
|
<td valign="top">
|
|
@@ -113,7 +113,7 @@ or upload anything, and you hear each change as it happens.
|
|
|
113
113
|
|
|
114
114
|
## 🔍 How it works
|
|
115
115
|
|
|
116
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
116
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/how-it-works.svg" alt="You describe what you hear, Claude measures and decides, REAPER changes live. Every change: snapshot, measure, decide, change, re-measure." width="100%">
|
|
117
117
|
|
|
118
118
|
**You stay in charge.** Ask it to explain before it acts, undo anything, or use
|
|
119
119
|
`/critique` for advice without a single change to your project.
|
|
@@ -126,7 +126,7 @@ A mix engineer's value is what they've learned. reaper-mcp keeps all of that in
|
|
|
126
126
|
**[LoreKit](https://lorekit.io)**, a free, open-source memory store for AI agents. It's
|
|
127
127
|
what turns a remote control into an engineer that gets better every session.
|
|
128
128
|
|
|
129
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
129
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/knowledge-core.svg" alt="LoreKit at the center: the mix skills read plugin records and lessons before acting and write back what they learned." width="100%">
|
|
130
130
|
|
|
131
131
|
- 🎛️ **One record per plugin.** What it is, what each knob does, the settings that
|
|
132
132
|
worked and the gotchas. Ask for a plugin it has never seen and it **researches it,
|
|
@@ -141,12 +141,12 @@ what turns a remote control into an engineer that gets better every session.
|
|
|
141
141
|
overwritten. The built-in set comes with the server, read-only, and needs no
|
|
142
142
|
LoreKit account. Connect your own LoreKit to start your layer.
|
|
143
143
|
- 📚 **A built-in plugin library.** FabFilter, Soundtoys, Valhalla, iZotope, Melodyne, the
|
|
144
|
-
REAPER stock plugins and more: see the **[built-in plugin list](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
144
|
+
REAPER stock plugins and more: see the **[built-in plugin list](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/PLUGINS.md)**, and how
|
|
145
145
|
to add yours.
|
|
146
146
|
- 🤝 **Share what you taught it.** Press **Contribute** in the bridge page's Plugins tab
|
|
147
147
|
and your plugin records become a pull request. Once the maintainer approves it, they're
|
|
148
148
|
built in for every reaper-mcp user and added to the
|
|
149
|
-
[plugin list](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
149
|
+
[plugin list](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/PLUGINS.md) ([how it works](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/knowledge/contributions/README.md)).
|
|
150
150
|
Regular contributors can publish straight to built-in, no pull request: ask on
|
|
151
151
|
[Discord](https://discord.gg/Eg8tznuXp4).
|
|
152
152
|
- 🌍 **It follows you.** The memory isn't tied to one project folder. Whatever song
|
|
@@ -161,7 +161,7 @@ what turns a remote control into an engineer that gets better every session.
|
|
|
161
161
|
|
|
162
162
|
## 🚀 Install in 3 steps
|
|
163
163
|
|
|
164
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
164
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/install-steps.svg" alt="1. Get REAPER, Claude Code and Node.js. 2. Paste one command. 3. Click Run on mcp_bridge.lua in REAPER." width="100%">
|
|
165
165
|
|
|
166
166
|
### 1 · Get the apps
|
|
167
167
|
|
|
@@ -259,7 +259,7 @@ instead of just giving advice:
|
|
|
259
259
|
| 🔀 **Routing**: sends, buses, sidechains, hardware outputs | 🎹 **MIDI**: write, edit and analyze notes & CC, live MIDI out | ✂️ **Editing**: split, trim, move, fades, takes, stretch markers |
|
|
260
260
|
| 📍 **Arrangement**: markers, regions, tempo map | 〰️ **Automation**: envelopes, points and pooled automation items | 💾 **Project**: save, render, undo/redo, snapshots, REAPER actions |
|
|
261
261
|
|
|
262
|
-
👉 The main tools by area: **[docs/TOOLS.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
262
|
+
👉 The main tools by area: **[docs/TOOLS.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/TOOLS.md)**
|
|
263
263
|
|
|
264
264
|
### 🎸 Genre-aware out of the box
|
|
265
265
|
|
|
@@ -287,8 +287,8 @@ it's **just a plugin**: it keeps working with no bridge, no server and no Claude
|
|
|
287
287
|
> ↔️ *"/make-plugin keep everything under 120 Hz in mono and widen the rest"*
|
|
288
288
|
|
|
289
289
|
<p>
|
|
290
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
291
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
290
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/make-plugin-core.png" alt="A generated plugin, Mutate Verb: four large knobs in the core view and a collapsed Advanced header." width="49%">
|
|
291
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/make-plugin-advanced.png" alt="The same plugin with the Advanced drawer open over the core view, showing six more knobs." width="49%">
|
|
292
292
|
</p>
|
|
293
293
|
|
|
294
294
|
- 🎛️ **A simple core, the rest on demand.** A few big knobs up front; everything else lives in an **Advanced** drawer that overlays the view instead of squeezing it.
|
|
@@ -298,7 +298,7 @@ it's **just a plugin**: it keeps working with no bridge, no server and no Claude
|
|
|
298
298
|
- 📏 **Proven by measurement.** It renders with the plugin on and off and checks the audio changed, because a plugin that fails to compile still loads in REAPER.
|
|
299
299
|
- 🗂️ **Easy to find.** Plugins land in your FX list as `… (reaper-mcp)`, and old versions are kept.
|
|
300
300
|
|
|
301
|
-
📖 How it works, the toolkit, the examples and the limits: **[docs/PLUGIN-AUTHORING.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
301
|
+
📖 How it works, the toolkit, the examples and the limits: **[docs/PLUGIN-AUTHORING.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/PLUGIN-AUTHORING.md)**
|
|
302
302
|
|
|
303
303
|
> 🚧 **Coming next:** graphs. Frequency displays with band selection (for an EQ or a multiband
|
|
304
304
|
> compressor), spectrum and gain-reduction meters, and a MIDI keyboard.
|
|
@@ -312,7 +312,7 @@ isn't a knob: a synth's **wavetables**, its **modulation matrix**, a guitar rig'
|
|
|
312
312
|
file**. **Extensions** reach that. They're small add-ons you switch on, and you can have
|
|
313
313
|
Claude build one for the plugin *you* use.
|
|
314
314
|
|
|
315
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
315
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/extensions.svg" alt="Extensions plug into reaper-mcp through a small versioned API: the core on the left, and the Vital, Helix and your-own extensions on the right." width="100%">
|
|
316
316
|
|
|
317
317
|
> 🎹 *"On the Vital on track 2, route LFO 2 to the filter cutoff at 40% and make it a slow triangle."*
|
|
318
318
|
>
|
|
@@ -339,7 +339,7 @@ reaper-mcp extension list # what's installed, and why one can't load
|
|
|
339
339
|
- 🛡️ **A broken extension is skipped**, never a crash, and `reaper-mcp doctor` tells you why.
|
|
340
340
|
- 🧪 **Proven live.** `/new-extension` doesn't finish until the edit shows up in the plugin *and* in the audio.
|
|
341
341
|
|
|
342
|
-
📖 Full guide (the API, Lua handlers, testing, sharing, troubleshooting): **[docs/EXTENSIONS.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
342
|
+
📖 Full guide (the API, Lua handlers, testing, sharing, troubleshooting): **[docs/EXTENSIONS.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/EXTENSIONS.md)**
|
|
343
343
|
|
|
344
344
|
---
|
|
345
345
|
|
|
@@ -355,7 +355,7 @@ reaper-mcp extension list # what's installed, and why one can't load
|
|
|
355
355
|
- 📊 **Bridge status window.** See every action as it happens, with timing and errors,
|
|
356
356
|
in a small window next to REAPER ([see what it shows](#-see-what-your-agent-is-doing)).
|
|
357
357
|
|
|
358
|
-
📖 What it can and can't do to a session, and what isn't covered: **[docs/SAFETY.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
358
|
+
📖 What it can and can't do to a session, and what isn't covered: **[docs/SAFETY.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/SAFETY.md)**.
|
|
359
359
|
|
|
360
360
|
---
|
|
361
361
|
|
|
@@ -365,7 +365,7 @@ You shouldn't have to take its word for it. The **bridge window** opens next to
|
|
|
365
365
|
logs every move the agent makes, as it happens: what it did, how long it took and anything
|
|
366
366
|
that went wrong. With several Claude sessions connected, you can see which one did what.
|
|
367
367
|
|
|
368
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
368
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/bridge-status.png" alt="The MCP Bridge status window: uptime, command count, errors, latency, a commands-per-minute timeline, and a live log of tool calls such as read_track_spectrum, set_track_property and snapshot_save, tagged by session." width="100%">
|
|
369
369
|
|
|
370
370
|
<sub>Demo data. Add <code>?demo</code> to the window's address to explore it without REAPER.</sub>
|
|
371
371
|
|
|
@@ -375,7 +375,7 @@ Every call opens a drawer in plain words (*"midnight-drive wrote new points into
|
|
|
375
375
|
automation on track 5"*) with a picture of the change: **before → after** for edits, a
|
|
376
376
|
readout against your target for measurements.
|
|
377
377
|
|
|
378
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
378
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/bridge-drawer.png" alt="The bridge window with a call open in the drawer: Write automation, with a volume envelope drawn before and after, and the params the agent sent." width="100%">
|
|
379
379
|
|
|
380
380
|
### 📈 What it measured
|
|
381
381
|
|
|
@@ -383,14 +383,14 @@ readout against your target for measurements.
|
|
|
383
383
|
<tr>
|
|
384
384
|
<td width="50%" valign="top">
|
|
385
385
|
|
|
386
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
386
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/spectrum.png" alt="The spectrum view: third-octave bands from 25 Hz to 16 kHz as bars, hot bands in amber." width="100%">
|
|
387
387
|
|
|
388
388
|
**Spectrum**<br><sub>Where the energy sits, band by band, judged by perceived loudness. Hot bands turn amber.</sub>
|
|
389
389
|
|
|
390
390
|
</td>
|
|
391
391
|
<td width="50%" valign="top">
|
|
392
392
|
|
|
393
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
393
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/loudness.png" alt="The loudness view: integrated LUFS against a target range on a scale, with short-term, momentary and true peak readouts and the change since the previous call." width="100%">
|
|
394
394
|
|
|
395
395
|
**Loudness**<br><sub>LUFS against your target, true peak, and how it moved since the last measurement.</sub>
|
|
396
396
|
|
|
@@ -399,14 +399,14 @@ readout against your target for measurements.
|
|
|
399
399
|
<tr>
|
|
400
400
|
<td width="50%" valign="top">
|
|
401
401
|
|
|
402
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
402
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/loudness-curve.png" alt="The loudness curve view: short-term loudness over the length of a song against a target line, with the spans over target shaded." width="100%">
|
|
403
403
|
|
|
404
404
|
**Loudness over time**<br><sub>The whole song's loudness, with the stretches that run over target shaded.</sub>
|
|
405
405
|
|
|
406
406
|
</td>
|
|
407
407
|
<td width="50%" valign="top">
|
|
408
408
|
|
|
409
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
409
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/masking.png" alt="The masking view: a heat map of track pairs against frequency bands, with the worst conflicts and which track to cut." width="100%">
|
|
410
410
|
|
|
411
411
|
**Masking**<br><sub>Which tracks fight, at which frequency, and which one should give way.</sub>
|
|
412
412
|
|
|
@@ -415,14 +415,14 @@ readout against your target for measurements.
|
|
|
415
415
|
<tr>
|
|
416
416
|
<td width="50%" valign="top">
|
|
417
417
|
|
|
418
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
418
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/stereo-bands.png" alt="The stereo view: correlation per frequency band on a minus one to plus one scale." width="100%">
|
|
419
419
|
|
|
420
420
|
**Stereo, per band**<br><sub>Phase correlation per band. Catches a wide or out-of-phase low end before it hurts.</sub>
|
|
421
421
|
|
|
422
422
|
</td>
|
|
423
423
|
<td width="50%" valign="top">
|
|
424
424
|
|
|
425
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
425
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/waveform.png" alt="The waveform view: a rendered track drawn on a decibel scale with its peak, RMS and clipped sample count." width="100%">
|
|
426
426
|
|
|
427
427
|
**Waveform**<br><sub>What a rendered track really looks like, with clipping counted.</sub>
|
|
428
428
|
|
|
@@ -438,14 +438,14 @@ Every edit is drawn **before → after**: new in blue, old dashed or ghosted, re
|
|
|
438
438
|
<tr>
|
|
439
439
|
<td width="50%" valign="top">
|
|
440
440
|
|
|
441
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
441
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/mixer.png" alt="The mixer view: every track as a fader with its level in dB, pan, and mute, solo and arm badges, grouped by folder." width="100%">
|
|
442
442
|
|
|
443
443
|
**Mixer**<br><sub>The session as a mixer: folders, levels, pans, mute, solo and arm.</sub>
|
|
444
444
|
|
|
445
445
|
</td>
|
|
446
446
|
<td width="50%" valign="top">
|
|
447
447
|
|
|
448
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
448
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/routing.png" alt="The routing view: a signal-flow diagram of a track's sends, receives and hardware outputs, with added, changed and removed routes marked." width="100%">
|
|
449
449
|
|
|
450
450
|
**Routing**<br><sub>Sends, receives and outputs as signal flow. Thicker wire means louder.</sub>
|
|
451
451
|
|
|
@@ -454,14 +454,14 @@ Every edit is drawn **before → after**: new in blue, old dashed or ghosted, re
|
|
|
454
454
|
<tr>
|
|
455
455
|
<td width="50%" valign="top">
|
|
456
456
|
|
|
457
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
457
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/automation.png" alt="The automation view: a volume envelope with pooled automation items drawn as blocks tinted by pool." width="100%">
|
|
458
458
|
|
|
459
459
|
**Automation**<br><sub>Envelope points and pooled automation items, before and after.</sub>
|
|
460
460
|
|
|
461
461
|
</td>
|
|
462
462
|
<td width="50%" valign="top">
|
|
463
463
|
|
|
464
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
464
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/piano-roll.png" alt="The piano roll view: added notes in blue, unchanged notes in grey, removed notes dashed, and a velocity lane." width="100%">
|
|
465
465
|
|
|
466
466
|
**Piano roll**<br><sub>MIDI edits as a piano roll: added, kept and removed notes, with velocity.</sub>
|
|
467
467
|
|
|
@@ -470,14 +470,14 @@ Every edit is drawn **before → after**: new in blue, old dashed or ghosted, re
|
|
|
470
470
|
<tr>
|
|
471
471
|
<td width="50%" valign="top">
|
|
472
472
|
|
|
473
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
473
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/pins.png" alt="The plugin pins view: track channels wired into a compressor's input pins, with a newly connected sidechain highlighted." width="100%">
|
|
474
474
|
|
|
475
475
|
**Plugin pins**<br><sub>Which track channels feed which plugin pins. Here, a sidechain just got wired in.</sub>
|
|
476
476
|
|
|
477
477
|
</td>
|
|
478
478
|
<td width="50%" valign="top">
|
|
479
479
|
|
|
480
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
480
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.112.1/docs/assets/views/render.png" alt="The render view: three rendered versions of a song with a waveform, LUFS, peak and length for each, against a loudness target." width="100%">
|
|
481
481
|
|
|
482
482
|
**Renders**<br><sub>Every rendered file with its LUFS, peak and length against your target.</sub>
|
|
483
483
|
|
|
@@ -500,7 +500,7 @@ It has no model of its own, so the AI is whichever one your client runs.
|
|
|
500
500
|
| Client | Status |
|
|
501
501
|
|---|---|
|
|
502
502
|
| **Claude Code** | Tested daily. The installer sets it up, and the `/mixer`, `/critique`, `/mastering` and `/editing` skills are written for it. |
|
|
503
|
-
| **Other MCP clients** (Claude Desktop, Cursor, VS Code, …) | Not tested. The tools work from any client that runs a local stdio server: [config](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
503
|
+
| **Other MCP clients** (Claude Desktop, Cursor, VS Code, …) | Not tested. The tools work from any client that runs a local stdio server: [config](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/REFERENCE.md#other-mcp-clients). The skills only load where the client reads `SKILL.md` files. |
|
|
504
504
|
|
|
505
505
|
**Typed or voice?**
|
|
506
506
|
Typed. reaper-mcp never listens to a microphone for instructions: it gets text from your client.
|
|
@@ -525,17 +525,17 @@ Tried one? [Tell us how it went](https://github.com/mthines/reaper-mcp/issues/72
|
|
|
525
525
|
|
|
526
526
|
**What is it trained on?**
|
|
527
527
|
Nothing. There is no reaper-mcp model and nothing is trained on your sessions.
|
|
528
|
-
The skills and [`knowledge/`](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
528
|
+
The skills and [`knowledge/`](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/knowledge/) are plain text: opinions and checklists your model reads, which you can edit or skip.
|
|
529
529
|
Where your data goes:
|
|
530
530
|
|
|
531
531
|
- **Your model** sees what the tools return: track names, FX settings, meter readings, file paths,
|
|
532
532
|
and MIDI notes when a tool reads them.
|
|
533
|
-
Audio stays on your machine; analysis that needs audio runs in the optional local Python sidecar ([`reaper-mcp setup-sidecar`](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
533
|
+
Audio stays on your machine; analysis that needs audio runs in the optional local Python sidecar ([`reaper-mcp setup-sidecar`](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/REFERENCE.md#cli-commands)).
|
|
534
534
|
- **LoreKit, built-in layer:** the skills look up shared plugin knowledge with a public read-only key,
|
|
535
535
|
so search terms such as plugin names reach LoreKit even if you never connect it.
|
|
536
536
|
- **LoreKit, your layer** (only if you connect it) stores what the skills learn about plugins and your preferences.
|
|
537
537
|
- **Usage telemetry** (on by default, [easy to turn off](#-privacy--telemetry)) sends tool names, the kind of
|
|
538
|
-
error and timings, never content. The bridge page has its own switch: [TELEMETRY.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
538
|
+
error and timings, never content. The bridge page has its own switch: [TELEMETRY.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/TELEMETRY.md#the-bridge-page).
|
|
539
539
|
|
|
540
540
|
---
|
|
541
541
|
|
|
@@ -555,7 +555,7 @@ messages, audio or MIDI. I respect your privacy 🙏
|
|
|
555
555
|
|
|
556
556
|
You're in control: setup asks before anything is sent, and `reaper-mcp telemetry off`
|
|
557
557
|
turns it off for good — no hard feelings. Everything that's collected, and where it
|
|
558
|
-
goes, is in [TELEMETRY.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
558
|
+
goes, is in [TELEMETRY.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/TELEMETRY.md).
|
|
559
559
|
|
|
560
560
|
---
|
|
561
561
|
|
|
@@ -603,7 +603,7 @@ explains its reasoning so you can push back.
|
|
|
603
603
|
<br>
|
|
604
604
|
Every edit is a single undo step, and the mix skills snapshot before and after a task. Use
|
|
605
605
|
<code>/critique</code> or read-only mode if you only want advice. Saving a copy of your project
|
|
606
|
-
before a big session never hurts. <a href="https://github.com/mthines/reaper-mcp/blob/v0.
|
|
606
|
+
before a big session never hurts. <a href="https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/SAFETY.md">What is and isn't guarded</a>.
|
|
607
607
|
</details>
|
|
608
608
|
|
|
609
609
|
<details>
|
|
@@ -611,7 +611,7 @@ before a big session never hurts. <a href="https://github.com/mthines/reaper-mcp
|
|
|
611
611
|
<br>
|
|
612
612
|
Any plugin REAPER can load (VST, VST3, AU, CLAP, JS). It finds what you have installed
|
|
613
613
|
and reaches for the best tool for each job. The ones it already knows are in the
|
|
614
|
-
<a href="https://github.com/mthines/reaper-mcp/blob/v0.
|
|
614
|
+
<a href="https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/PLUGINS.md">built-in plugin list</a>. When it meets a plugin it doesn't know, it
|
|
615
615
|
researches it, inspects its controls live and saves what it learns to LoreKit. You can
|
|
616
616
|
also teach it one up front with <code>/learn-plugin</code>.
|
|
617
617
|
</details>
|
|
@@ -642,12 +642,12 @@ No. It reads meter values and settings from your running session, not your audio
|
|
|
642
642
|
|
|
643
643
|
## 🛠️ For developers
|
|
644
644
|
|
|
645
|
-
- 📖 **[docs/REFERENCE.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
645
|
+
- 📖 **[docs/REFERENCE.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/REFERENCE.md)**: architecture, install internals, CLI,
|
|
646
646
|
environment variables, telemetry, project structure
|
|
647
|
-
- 🧰 **[docs/TOOLS.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
648
|
-
- 🧩 **[docs/EXTENSIONS.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
649
|
-
- 🧑💻 **[DEVELOPMENT.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
650
|
-
- 🧪 **[docs/TESTING.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
647
|
+
- 🧰 **[docs/TOOLS.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/TOOLS.md)**: the main tools by area
|
|
648
|
+
- 🧩 **[docs/EXTENSIONS.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/EXTENSIONS.md)**: write, test and share an extension (the API, Lua handlers, Vital and Helix)
|
|
649
|
+
- 🧑💻 **[DEVELOPMENT.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/DEVELOPMENT.md)**: build, test, run from source, MCP Inspector
|
|
650
|
+
- 🧪 **[docs/TESTING.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.112.1/docs/TESTING.md)**: end-to-end testing guide
|
|
651
651
|
|
|
652
652
|
```
|
|
653
653
|
Claude Code ⇄ MCP server (TypeScript) ⇄ file IPC ⇄ Lua bridge in REAPER ⇄ ReaScript API + JSFX meters
|
package/main.js
CHANGED
|
@@ -674,20 +674,6 @@ function withPageLink(result, links) {
|
|
|
674
674
|
return { ...reply5, content: [...reply5.content, { type: "text", text: `Bridge page (before/after view): ${last}` }] };
|
|
675
675
|
}
|
|
676
676
|
|
|
677
|
-
// apps/reaper-mcp-server/src/call-outcome.ts
|
|
678
|
-
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
679
|
-
var store2 = new AsyncLocalStorage2();
|
|
680
|
-
function trackCallOutcome(fn) {
|
|
681
|
-
const outcome = { logged: false, regression: false };
|
|
682
|
-
return store2.run(outcome, async () => ({ result: await fn(), outcome }));
|
|
683
|
-
}
|
|
684
|
-
function noteLoggedFailure(regression) {
|
|
685
|
-
const outcome = store2.getStore();
|
|
686
|
-
if (!outcome) return;
|
|
687
|
-
outcome.logged = true;
|
|
688
|
-
if (regression) outcome.regression = true;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
677
|
// apps/reaper-mcp-server/src/bridge.ts
|
|
692
678
|
var POLL_INTERVAL_MS = 10;
|
|
693
679
|
var BRIDGE_RPC_SYSTEM = "reaper_bridge";
|
|
@@ -853,7 +839,6 @@ async function sendCommand(type, params = {}, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
|
853
839
|
{ "rpc.method": type, "error.type": "bridge_not_running", "reaper.bridge.state": down.state },
|
|
854
840
|
{ eventName: "reaper.bridge.command.not_sent" }
|
|
855
841
|
);
|
|
856
|
-
noteLoggedFailure(false);
|
|
857
842
|
}
|
|
858
843
|
finish("bridge_not_running");
|
|
859
844
|
return { id: randomUUID2(), success: false, error: message, timestamp: Date.now() };
|
|
@@ -937,7 +922,6 @@ async function sendCommand(type, params = {}, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
|
937
922
|
},
|
|
938
923
|
{ eventName: "reaper.bridge.command.failed" }
|
|
939
924
|
);
|
|
940
|
-
noteLoggedFailure(systemError);
|
|
941
925
|
}
|
|
942
926
|
const tMetrics = now();
|
|
943
927
|
finish(errorType);
|
|
@@ -971,7 +955,6 @@ async function sendCommand(type, params = {}, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
|
971
955
|
{ "rpc.method": type, "reaper.bridge.command.id": id, "error.type": "timeout", "reaper.bridge.timeout_ms": timeoutMs },
|
|
972
956
|
{ eventName: "reaper.bridge.command.timeout" }
|
|
973
957
|
);
|
|
974
|
-
noteLoggedFailure(true);
|
|
975
958
|
finish("timeout");
|
|
976
959
|
return {
|
|
977
960
|
id,
|
|
@@ -987,7 +970,6 @@ async function sendCommand(type, params = {}, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
|
987
970
|
"error.type": errorType,
|
|
988
971
|
...exceptionAttributes(err)
|
|
989
972
|
});
|
|
990
|
-
noteLoggedFailure(true);
|
|
991
973
|
finish(errorType);
|
|
992
974
|
throw err;
|
|
993
975
|
} finally {
|
|
@@ -5365,27 +5347,6 @@ var VENV_PYTHON = join6(SIDECAR_VENV_PATH2, VENV_BIN2, VENV_PYTHON_NAME2);
|
|
|
5365
5347
|
var _rawTimeout = Number(process.env["REAPER_MCP_SIDECAR_TIMEOUT_MS"]);
|
|
5366
5348
|
var ANALYZE_TIMEOUT_MS = Number.isFinite(_rawTimeout) && _rawTimeout > 0 ? _rawTimeout : 6e4;
|
|
5367
5349
|
var QUEUE_WAIT_MS = 5 * 6e4;
|
|
5368
|
-
var SidecarRpcError = class extends Error {
|
|
5369
|
-
// No `name` override: a tool that lets this escape reports `error.type` from the name, which stays `Error`.
|
|
5370
|
-
constructor(message, code) {
|
|
5371
|
-
super(message);
|
|
5372
|
-
this.code = code;
|
|
5373
|
-
}
|
|
5374
|
-
};
|
|
5375
|
-
var INVALID_PARAMS = -32602;
|
|
5376
|
-
var REJECTED_INPUT = /^(Audio file not found|Audio file unreadable|Audio too short|Sample rates differ)\b/;
|
|
5377
|
-
var NOT_INSTALLED = /^Audio understanding sidecar not installed|\b(audiobox-aesthetics not installed|Stem separation is not installed|FluidSynth native library is not installed)\b/;
|
|
5378
|
-
function classifySidecarError(err) {
|
|
5379
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
5380
|
-
if (message.startsWith("Sidecar timeout")) return "timeout";
|
|
5381
|
-
if (message.startsWith("Sidecar busy")) return "busy";
|
|
5382
|
-
if (NOT_INSTALLED.test(message)) return "not_installed";
|
|
5383
|
-
if (err instanceof SidecarRpcError && err.code === INVALID_PARAMS || REJECTED_INPUT.test(message)) return "sidecar_rejected";
|
|
5384
|
-
return "sidecar_error";
|
|
5385
|
-
}
|
|
5386
|
-
function isSidecarRegression(type) {
|
|
5387
|
-
return type === "timeout" || type === "sidecar_error";
|
|
5388
|
-
}
|
|
5389
5350
|
var SidecarClientImpl = class {
|
|
5390
5351
|
process = null;
|
|
5391
5352
|
pending = /* @__PURE__ */ new Map();
|
|
@@ -5473,16 +5434,14 @@ var SidecarClientImpl = class {
|
|
|
5473
5434
|
return result;
|
|
5474
5435
|
} catch (err) {
|
|
5475
5436
|
const message = err instanceof Error ? err.message : String(err);
|
|
5476
|
-
const errorType =
|
|
5477
|
-
const regression = isSidecarRegression(errorType);
|
|
5437
|
+
const errorType = message.startsWith("Sidecar timeout") ? "timeout" : message.startsWith("Sidecar busy") ? "busy" : message.startsWith("Audio understanding sidecar not installed") ? "not_installed" : "sidecar_error";
|
|
5478
5438
|
metricAttrs["error.type"] = errorType;
|
|
5479
5439
|
span.setAttribute("error.type", errorType);
|
|
5480
|
-
|
|
5481
|
-
emitLog(
|
|
5440
|
+
span.setStatus({ code: SpanStatusCode2.ERROR, message: redactHome(message) });
|
|
5441
|
+
emitLog(errorType === "not_installed" || errorType === "busy" ? "warn" : "error", `Sidecar ${method} failed: ${message}`, {
|
|
5482
5442
|
"rpc.method": method,
|
|
5483
5443
|
"error.type": errorType
|
|
5484
|
-
}
|
|
5485
|
-
noteLoggedFailure(regression);
|
|
5444
|
+
});
|
|
5486
5445
|
throw err;
|
|
5487
5446
|
} finally {
|
|
5488
5447
|
span.end();
|
|
@@ -5647,7 +5606,7 @@ var SidecarClientImpl = class {
|
|
|
5647
5606
|
}
|
|
5648
5607
|
this.pending.delete(response.id);
|
|
5649
5608
|
if (response.error) {
|
|
5650
|
-
pending2.reject(new
|
|
5609
|
+
pending2.reject(new Error(response.error.message));
|
|
5651
5610
|
} else if (response.result) {
|
|
5652
5611
|
pending2.resolve(response.result);
|
|
5653
5612
|
} else {
|
|
@@ -9486,26 +9445,19 @@ function instrumentToolHandlers(server) {
|
|
|
9486
9445
|
},
|
|
9487
9446
|
async (span) => {
|
|
9488
9447
|
try {
|
|
9489
|
-
const
|
|
9448
|
+
const collected = await collectPageLinks(() => originalCb(...cbArgs));
|
|
9490
9449
|
const result = withNotices(withPageLink(collected.result, collected.links));
|
|
9491
9450
|
const res = result;
|
|
9492
9451
|
if (res?.isError) {
|
|
9493
9452
|
const errorText = res.content?.[0]?.text ?? "Tool error";
|
|
9494
9453
|
const message = redactHome(errorText).slice(0, MAX_STATUS_MESSAGE);
|
|
9495
|
-
const regression = outcome.regression || isSystemError(classifyBridgeError(errorText.replace(/^Error:\s*/, "")));
|
|
9496
9454
|
metricAttrs["error.type"] = "tool_error";
|
|
9497
9455
|
span.setAttribute("error.type", "tool_error");
|
|
9498
9456
|
span.setAttribute(TOOL_ERROR_MESSAGE, message);
|
|
9499
9457
|
const cause = toolErrorCause(errorText);
|
|
9500
9458
|
if (cause) span.setAttribute("reaper.tool.error.cause", cause);
|
|
9501
|
-
if (
|
|
9502
|
-
|
|
9503
|
-
emitLog(
|
|
9504
|
-
regression ? "error" : "warn",
|
|
9505
|
-
`Tool ${toolName} failed: ${message}`,
|
|
9506
|
-
{ "gen_ai.tool.name": toolName, "error.type": "tool_error" },
|
|
9507
|
-
{ eventName: "reaper.tool.failed" }
|
|
9508
|
-
);
|
|
9459
|
+
if (isSystemError(classifyBridgeError(errorText.replace(/^Error:\s*/, "")))) {
|
|
9460
|
+
span.setStatus({ code: SpanStatusCode3.ERROR, message });
|
|
9509
9461
|
}
|
|
9510
9462
|
}
|
|
9511
9463
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mthines/reaper-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.83.0-beta.112.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP server for controlling REAPER DAW — real-time mixing, FX control, and frequency analysis for AI agents",
|
|
6
6
|
"license": "MIT",
|
package/sidecar/server.py
CHANGED
|
@@ -90,7 +90,7 @@ def _get_audio_duration(path: str) -> float:
|
|
|
90
90
|
info = torchaudio.info(path)
|
|
91
91
|
return info.num_frames / info.sample_rate
|
|
92
92
|
except Exception as exc:
|
|
93
|
-
raise RuntimeError(f"
|
|
93
|
+
raise RuntimeError(f"Cannot read audio file: {path}: {exc}") from exc
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
# ---------------------------------------------------------------------------
|
|
@@ -189,22 +189,13 @@ def handle_analyze(request_id: Any, params: dict) -> str:
|
|
|
189
189
|
return _err(request_id, -32000, f"Inference failed: {exc}")
|
|
190
190
|
|
|
191
191
|
|
|
192
|
-
def _check_file(request_id: Any, params: dict, key: str
|
|
193
|
-
"""Return an error response when params[key] is missing
|
|
192
|
+
def _check_file(request_id: Any, params: dict, key: str) -> str | None:
|
|
193
|
+
"""Return an error response when params[key] is missing or not a file."""
|
|
194
194
|
path = params.get(key)
|
|
195
195
|
if not path:
|
|
196
196
|
return _err(request_id, -32602, f"Missing required param: {key}")
|
|
197
197
|
if not os.path.exists(path):
|
|
198
198
|
return _err(request_id, -32000, f"Audio file not found: {path}")
|
|
199
|
-
if not readable:
|
|
200
|
-
return None
|
|
201
|
-
import soundfile as sf # type: ignore
|
|
202
|
-
try:
|
|
203
|
-
sf.info(path)
|
|
204
|
-
except RuntimeError as exc:
|
|
205
|
-
# The handler reads through soundfile (analysis.load_audio), so this file would fail there too, as a
|
|
206
|
-
# crash-looking "… failed: Error opening …"; say it is the input (an .m4a, a text file) instead.
|
|
207
|
-
return _err(request_id, -32000, f"Audio file unreadable: {path}: {exc}")
|
|
208
199
|
return None
|
|
209
200
|
|
|
210
201
|
|
|
@@ -465,8 +456,7 @@ def handle_chords(request_id: Any, params: dict) -> str:
|
|
|
465
456
|
"""
|
|
466
457
|
import chords
|
|
467
458
|
|
|
468
|
-
|
|
469
|
-
error = _check_file(request_id, params, "path", readable=False)
|
|
459
|
+
error = _check_file(request_id, params, "path")
|
|
470
460
|
if error:
|
|
471
461
|
return error
|
|
472
462
|
try:
|
|
@@ -83,21 +83,6 @@ def test_a_range_is_cut_out_and_its_times_stay_in_file_seconds(wav, fake_model):
|
|
|
83
83
|
assert result["vocabulary"] == "ismir2017"
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
def test_a_whole_file_soundfile_cannot_open_still_reaches_the_model(tmp_path, monkeypatch):
|
|
87
|
-
# The model loads the file itself, so a format soundfile does not read (an .m4a) is not refused up front.
|
|
88
|
-
song = tmp_path / "song.m4a"
|
|
89
|
-
song.write_bytes(b"not a format soundfile reads")
|
|
90
|
-
seen = []
|
|
91
|
-
monkeypatch.setattr(chords, "is_installed", lambda: True)
|
|
92
|
-
monkeypatch.setattr(chords, "_recognize",
|
|
93
|
-
lambda source, vocabulary: seen.append(source) or [{"start_time": 0, "end_time": 2, "chord": "A:min"}])
|
|
94
|
-
|
|
95
|
-
result = call("chords", path=str(song))["result"]
|
|
96
|
-
|
|
97
|
-
assert seen == [str(song)]
|
|
98
|
-
assert result["segments"] == [{"start": 0.0, "end": 2.0, "label": "A:min"}]
|
|
99
|
-
|
|
100
|
-
|
|
101
86
|
def test_refuses_an_unknown_vocabulary_and_a_missing_file(wav, fake_model):
|
|
102
87
|
assert call("chords", path=wav, vocabulary="jazz")["error"]["code"] == -32602
|
|
103
88
|
assert "not found" in call("chords", path="/nope/missing.wav")["error"]["message"]
|
|
@@ -149,19 +149,6 @@ def test_audio_file_not_found():
|
|
|
149
149
|
assert "not found" in resp["error"]["message"].lower()
|
|
150
150
|
|
|
151
151
|
|
|
152
|
-
def test_a_file_that_is_not_audio_is_refused_as_unreadable_input(tmp_path):
|
|
153
|
-
# The phrase is what sidecar.ts classifies as rejected input (sidecar_rejected), not a sidecar fault.
|
|
154
|
-
notes = tmp_path / "reference.m4a"
|
|
155
|
-
notes.write_text("not audio soundfile can open")
|
|
156
|
-
|
|
157
|
-
for method in ("analyze_audio", "analyze"):
|
|
158
|
-
error = parse_response(server.dispatch(json.dumps({
|
|
159
|
-
"jsonrpc": "2.0", "id": 9, "method": method, "params": {"path": str(notes)},
|
|
160
|
-
})))["error"]
|
|
161
|
-
assert error["code"] == -32000
|
|
162
|
-
assert error["message"].startswith(f"Audio file unreadable: {notes}")
|
|
163
|
-
|
|
164
|
-
|
|
165
152
|
# ---------------------------------------------------------------------------
|
|
166
153
|
# Test 4: Audio too short (<0.5s) → JSON-RPC error with duration in message
|
|
167
154
|
# ---------------------------------------------------------------------------
|
|
@@ -213,7 +213,7 @@ def test_failed_soundfont_load_removes_only_the_new_output_folder(tmp_path):
|
|
|
213
213
|
sentinel = tmp_path / "keep.txt"
|
|
214
214
|
sentinel.write_text("user data")
|
|
215
215
|
for _ in range(2):
|
|
216
|
-
with pytest.raises(
|
|
216
|
+
with pytest.raises(RuntimeError, match="SoundFont|soundfontPath"):
|
|
217
217
|
render(params)
|
|
218
218
|
assert not (tmp_path / "render").exists()
|
|
219
219
|
assert sentinel.read_text() == "user data"
|
package/sidecar/voice_render.py
CHANGED
|
@@ -154,15 +154,13 @@ def _synth(lib: Any, font: Path, track: dict[str, Any]) -> Iterator[Any]:
|
|
|
154
154
|
synth = lib.new_fluid_synth(settings)
|
|
155
155
|
if not synth:
|
|
156
156
|
raise RuntimeError("FluidSynth could not allocate an offline synthesizer")
|
|
157
|
-
# The SoundFont is the caller's file: one FluidSynth cannot use is bad input (ValueError, answered -32602
|
|
158
|
-
# and reported as rejected), not a sidecar fault like the allocation failures above.
|
|
159
157
|
font_id = lib.fluid_synth_sfload(synth, os.fsencode(font), 1)
|
|
160
158
|
if font_id < 0:
|
|
161
|
-
raise
|
|
159
|
+
raise RuntimeError("FluidSynth could not load soundfontPath as a SoundFont")
|
|
162
160
|
channel, program = int(track["channel"]), int(track["program"])
|
|
163
161
|
bank = 128 if channel == 9 else 0
|
|
164
162
|
if lib.fluid_synth_program_select(synth, channel, font_id, bank, program) != 0:
|
|
165
|
-
raise
|
|
163
|
+
raise RuntimeError(f"SoundFont has no bank {bank} program {program} for track '{track['name']}'")
|
|
166
164
|
# No audio or MIDI driver is created. Samples only leave through write_float.
|
|
167
165
|
yield synth
|
|
168
166
|
finally:
|