@mthines/reaper-mcp 0.82.0 → 0.83.0-beta.110.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/LICENSE +1 -1
- package/README.md +50 -45
- package/claude/skills/make-plugin/SKILL.md +17 -1
- package/claude/skills/make-plugin/examples/multiband-compressor.jsfx +1 -1
- package/claude/skills/make-plugin/reference/toolkit.md +4 -3
- package/main.js +86 -12
- package/package.json +1 -1
- package/reaper/mcp_ui.jsfx-inc +167 -35
package/LICENSE
CHANGED
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.110.1/docs/assets/logo-dark.svg">
|
|
5
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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.110.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.110.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.110.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.110.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.110.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.110.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.110.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.110.1/docs/PLUGINS.md) ([how it works](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.110.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.110.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.110.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.110.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.110.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.110.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.110.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
|
>
|
|
@@ -324,12 +324,13 @@ Claude build one for the plugin *you* use.
|
|
|
324
324
|
|---|---|---|
|
|
325
325
|
| 🎹 | **`vital`** | Read a Vital patch and edit its settings, **mod matrix** and **LFO shapes**; build **wavetables** (1-256 frames) from classic shapes or harmonic recipes |
|
|
326
326
|
| 🎸 | **`helix`** | Build and edit Line 6 **Helix presets** with up to 8 snapshots, check them against real models, and load them into Helix Native, **backed up and rolled back** if anything else changed |
|
|
327
|
+
| 🎼 | **`composition`** | Write MIDI from notation: **chord progressions** (`"Cm7, Fm7, Bb7, Eb"`) and step-sequencer **drum patterns** with GM and GGD Invasion maps |
|
|
327
328
|
| 🧩 | **yours** | `/new-extension Serum`: Claude researches the plugin's format, probes it on a scratch track, writes the tools **with tests** and proves they change the sound |
|
|
328
329
|
|
|
329
330
|
**Switch one on**, then restart Claude Code:
|
|
330
331
|
|
|
331
332
|
```bash
|
|
332
|
-
reaper-mcp extension add vital # or: helix
|
|
333
|
+
reaper-mcp extension add vital # or: helix, composition
|
|
333
334
|
reaper-mcp extension list # what's installed, and why one can't load
|
|
334
335
|
```
|
|
335
336
|
|
|
@@ -338,7 +339,7 @@ reaper-mcp extension list # what's installed, and why one can't load
|
|
|
338
339
|
- 🛡️ **A broken extension is skipped**, never a crash, and `reaper-mcp doctor` tells you why.
|
|
339
340
|
- 🧪 **Proven live.** `/new-extension` doesn't finish until the edit shows up in the plugin *and* in the audio.
|
|
340
341
|
|
|
341
|
-
📖 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.110.1/docs/EXTENSIONS.md)**
|
|
342
343
|
|
|
343
344
|
---
|
|
344
345
|
|
|
@@ -354,7 +355,7 @@ reaper-mcp extension list # what's installed, and why one can't load
|
|
|
354
355
|
- 📊 **Bridge status window.** See every action as it happens, with timing and errors,
|
|
355
356
|
in a small window next to REAPER ([see what it shows](#-see-what-your-agent-is-doing)).
|
|
356
357
|
|
|
357
|
-
📖 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.110.1/docs/SAFETY.md)**.
|
|
358
359
|
|
|
359
360
|
---
|
|
360
361
|
|
|
@@ -364,7 +365,7 @@ You shouldn't have to take its word for it. The **bridge window** opens next to
|
|
|
364
365
|
logs every move the agent makes, as it happens: what it did, how long it took and anything
|
|
365
366
|
that went wrong. With several Claude sessions connected, you can see which one did what.
|
|
366
367
|
|
|
367
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
368
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
368
369
|
|
|
369
370
|
<sub>Demo data. Add <code>?demo</code> to the window's address to explore it without REAPER.</sub>
|
|
370
371
|
|
|
@@ -374,7 +375,7 @@ Every call opens a drawer in plain words (*"midnight-drive wrote new points into
|
|
|
374
375
|
automation on track 5"*) with a picture of the change: **before → after** for edits, a
|
|
375
376
|
readout against your target for measurements.
|
|
376
377
|
|
|
377
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
378
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
378
379
|
|
|
379
380
|
### 📈 What it measured
|
|
380
381
|
|
|
@@ -382,14 +383,14 @@ readout against your target for measurements.
|
|
|
382
383
|
<tr>
|
|
383
384
|
<td width="50%" valign="top">
|
|
384
385
|
|
|
385
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
386
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
386
387
|
|
|
387
388
|
**Spectrum**<br><sub>Where the energy sits, band by band, judged by perceived loudness. Hot bands turn amber.</sub>
|
|
388
389
|
|
|
389
390
|
</td>
|
|
390
391
|
<td width="50%" valign="top">
|
|
391
392
|
|
|
392
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
393
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
393
394
|
|
|
394
395
|
**Loudness**<br><sub>LUFS against your target, true peak, and how it moved since the last measurement.</sub>
|
|
395
396
|
|
|
@@ -398,14 +399,14 @@ readout against your target for measurements.
|
|
|
398
399
|
<tr>
|
|
399
400
|
<td width="50%" valign="top">
|
|
400
401
|
|
|
401
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
402
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
402
403
|
|
|
403
404
|
**Loudness over time**<br><sub>The whole song's loudness, with the stretches that run over target shaded.</sub>
|
|
404
405
|
|
|
405
406
|
</td>
|
|
406
407
|
<td width="50%" valign="top">
|
|
407
408
|
|
|
408
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
409
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
409
410
|
|
|
410
411
|
**Masking**<br><sub>Which tracks fight, at which frequency, and which one should give way.</sub>
|
|
411
412
|
|
|
@@ -414,14 +415,14 @@ readout against your target for measurements.
|
|
|
414
415
|
<tr>
|
|
415
416
|
<td width="50%" valign="top">
|
|
416
417
|
|
|
417
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
418
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
418
419
|
|
|
419
420
|
**Stereo, per band**<br><sub>Phase correlation per band. Catches a wide or out-of-phase low end before it hurts.</sub>
|
|
420
421
|
|
|
421
422
|
</td>
|
|
422
423
|
<td width="50%" valign="top">
|
|
423
424
|
|
|
424
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
425
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
425
426
|
|
|
426
427
|
**Waveform**<br><sub>What a rendered track really looks like, with clipping counted.</sub>
|
|
427
428
|
|
|
@@ -437,14 +438,14 @@ Every edit is drawn **before → after**: new in blue, old dashed or ghosted, re
|
|
|
437
438
|
<tr>
|
|
438
439
|
<td width="50%" valign="top">
|
|
439
440
|
|
|
440
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
441
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
441
442
|
|
|
442
443
|
**Mixer**<br><sub>The session as a mixer: folders, levels, pans, mute, solo and arm.</sub>
|
|
443
444
|
|
|
444
445
|
</td>
|
|
445
446
|
<td width="50%" valign="top">
|
|
446
447
|
|
|
447
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
448
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
448
449
|
|
|
449
450
|
**Routing**<br><sub>Sends, receives and outputs as signal flow. Thicker wire means louder.</sub>
|
|
450
451
|
|
|
@@ -453,14 +454,14 @@ Every edit is drawn **before → after**: new in blue, old dashed or ghosted, re
|
|
|
453
454
|
<tr>
|
|
454
455
|
<td width="50%" valign="top">
|
|
455
456
|
|
|
456
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
457
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
457
458
|
|
|
458
459
|
**Automation**<br><sub>Envelope points and pooled automation items, before and after.</sub>
|
|
459
460
|
|
|
460
461
|
</td>
|
|
461
462
|
<td width="50%" valign="top">
|
|
462
463
|
|
|
463
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
464
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
464
465
|
|
|
465
466
|
**Piano roll**<br><sub>MIDI edits as a piano roll: added, kept and removed notes, with velocity.</sub>
|
|
466
467
|
|
|
@@ -469,14 +470,14 @@ Every edit is drawn **before → after**: new in blue, old dashed or ghosted, re
|
|
|
469
470
|
<tr>
|
|
470
471
|
<td width="50%" valign="top">
|
|
471
472
|
|
|
472
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
473
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
473
474
|
|
|
474
475
|
**Plugin pins**<br><sub>Which track channels feed which plugin pins. Here, a sidechain just got wired in.</sub>
|
|
475
476
|
|
|
476
477
|
</td>
|
|
477
478
|
<td width="50%" valign="top">
|
|
478
479
|
|
|
479
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
480
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.83.0-beta.110.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%">
|
|
480
481
|
|
|
481
482
|
**Renders**<br><sub>Every rendered file with its LUFS, peak and length against your target.</sub>
|
|
482
483
|
|
|
@@ -499,7 +500,7 @@ It has no model of its own, so the AI is whichever one your client runs.
|
|
|
499
500
|
| Client | Status |
|
|
500
501
|
|---|---|
|
|
501
502
|
| **Claude Code** | Tested daily. The installer sets it up, and the `/mixer`, `/critique`, `/mastering` and `/editing` skills are written for it. |
|
|
502
|
-
| **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.110.1/docs/REFERENCE.md#other-mcp-clients). The skills only load where the client reads `SKILL.md` files. |
|
|
503
504
|
|
|
504
505
|
**Typed or voice?**
|
|
505
506
|
Typed. reaper-mcp never listens to a microphone for instructions: it gets text from your client.
|
|
@@ -515,22 +516,26 @@ Nobody has tested a local model end to end yet, so treat it as an experiment. Wh
|
|
|
515
516
|
A model that invents parameters or drops JSON fields fails there.
|
|
516
517
|
Pick an instruction-tuned model your client lists with native tool calling, the biggest your machine runs.
|
|
517
518
|
- **Speed:** each turn sends those 51k tokens again, so on a laptop GPU expect slow turns.
|
|
519
|
+
- **A smaller tool set:** set `REAPER_MCP_PROFILE` in your client's server `env` to load only what you need. `mixing` (122 tools),
|
|
520
|
+
`music` (127), `analysis` (79) or `minimal` (56), all under the 128 tools some clients allow; unset or `full` loads all 189.
|
|
521
|
+
Combine them with category names or an extension (`mixing,midi`, `mixing,composition`); a combination can go over 128, so check the count the server logs at start.
|
|
522
|
+
`list_tool_categories` then lists only what is loaded.
|
|
518
523
|
|
|
519
524
|
Tried one? [Tell us how it went](https://github.com/mthines/reaper-mcp/issues/72), and we'll list what works here.
|
|
520
525
|
|
|
521
526
|
**What is it trained on?**
|
|
522
527
|
Nothing. There is no reaper-mcp model and nothing is trained on your sessions.
|
|
523
|
-
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.110.1/knowledge/) are plain text: opinions and checklists your model reads, which you can edit or skip.
|
|
524
529
|
Where your data goes:
|
|
525
530
|
|
|
526
531
|
- **Your model** sees what the tools return: track names, FX settings, meter readings, file paths,
|
|
527
532
|
and MIDI notes when a tool reads them.
|
|
528
|
-
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.110.1/docs/REFERENCE.md#cli-commands)).
|
|
529
534
|
- **LoreKit, built-in layer:** the skills look up shared plugin knowledge with a public read-only key,
|
|
530
535
|
so search terms such as plugin names reach LoreKit even if you never connect it.
|
|
531
536
|
- **LoreKit, your layer** (only if you connect it) stores what the skills learn about plugins and your preferences.
|
|
532
537
|
- **Usage telemetry** (on by default, [easy to turn off](#-privacy--telemetry)) sends tool names, the kind of
|
|
533
|
-
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.110.1/TELEMETRY.md#the-bridge-page).
|
|
534
539
|
|
|
535
540
|
---
|
|
536
541
|
|
|
@@ -550,7 +555,7 @@ messages, audio or MIDI. I respect your privacy 🙏
|
|
|
550
555
|
|
|
551
556
|
You're in control: setup asks before anything is sent, and `reaper-mcp telemetry off`
|
|
552
557
|
turns it off for good — no hard feelings. Everything that's collected, and where it
|
|
553
|
-
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.110.1/TELEMETRY.md).
|
|
554
559
|
|
|
555
560
|
---
|
|
556
561
|
|
|
@@ -598,7 +603,7 @@ explains its reasoning so you can push back.
|
|
|
598
603
|
<br>
|
|
599
604
|
Every edit is a single undo step, and the mix skills snapshot before and after a task. Use
|
|
600
605
|
<code>/critique</code> or read-only mode if you only want advice. Saving a copy of your project
|
|
601
|
-
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.110.1/docs/SAFETY.md">What is and isn't guarded</a>.
|
|
602
607
|
</details>
|
|
603
608
|
|
|
604
609
|
<details>
|
|
@@ -606,7 +611,7 @@ before a big session never hurts. <a href="https://github.com/mthines/reaper-mcp
|
|
|
606
611
|
<br>
|
|
607
612
|
Any plugin REAPER can load (VST, VST3, AU, CLAP, JS). It finds what you have installed
|
|
608
613
|
and reaches for the best tool for each job. The ones it already knows are in the
|
|
609
|
-
<a href="https://github.com/mthines/reaper-mcp/blob/v0.
|
|
614
|
+
<a href="https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.110.1/docs/PLUGINS.md">built-in plugin list</a>. When it meets a plugin it doesn't know, it
|
|
610
615
|
researches it, inspects its controls live and saves what it learns to LoreKit. You can
|
|
611
616
|
also teach it one up front with <code>/learn-plugin</code>.
|
|
612
617
|
</details>
|
|
@@ -637,12 +642,12 @@ No. It reads meter values and settings from your running session, not your audio
|
|
|
637
642
|
|
|
638
643
|
## 🛠️ For developers
|
|
639
644
|
|
|
640
|
-
- 📖 **[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.110.1/docs/REFERENCE.md)**: architecture, install internals, CLI,
|
|
641
646
|
environment variables, telemetry, project structure
|
|
642
|
-
- 🧰 **[docs/TOOLS.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
643
|
-
- 🧩 **[docs/EXTENSIONS.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
644
|
-
- 🧑💻 **[DEVELOPMENT.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
645
|
-
- 🧪 **[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.110.1/docs/TOOLS.md)**: the main tools by area
|
|
648
|
+
- 🧩 **[docs/EXTENSIONS.md](https://github.com/mthines/reaper-mcp/blob/v0.83.0-beta.110.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.110.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.110.1/docs/TESTING.md)**: end-to-end testing guide
|
|
646
651
|
|
|
647
652
|
```
|
|
648
653
|
Claude Code ⇄ MCP server (TypeScript) ⇄ file IPC ⇄ Lua bridge in REAPER ⇄ ReaScript API + JSFX meters
|
|
@@ -80,7 +80,7 @@ Cut before you add. If a control could be a sensible fixed value, make it one. P
|
|
|
80
80
|
example in `examples/` (`mutate-verb.jsfx` random and granular plus reverb, `tape-sat.jsfx`
|
|
81
81
|
nonlinear plus tilt EQ, `width-bass-mono.jsfx` linear stereo plus meter, `multiband-compressor.jsfx` frequency graph with
|
|
82
82
|
crossover handles in Hz, per-band gain reduction and a transfer curve via `ui_freqgraph`,
|
|
83
|
-
`ui_fhandle`, `ui_grmeter`, `ui_transfer`; `ui_keyboard` shows MIDI notes) and read it. Each has its
|
|
83
|
+
`ui_fhandle`, `ui_fthresh`, `ui_grmeter`, `ui_transfer`; `ui_fband` gives bands one level each and `ui_keyboard` shows and plays MIDI notes; no shipped example uses those two, see `reference/toolkit.md`) and read it. Each has its
|
|
84
84
|
suggested presets beside it (`<name>.presets.json`): the shape `write_jsfx` takes.
|
|
85
85
|
|
|
86
86
|
### Step 2: Write the source
|
|
@@ -94,6 +94,22 @@ example and change what the spec changes. The shape is always:
|
|
|
94
94
|
`ui_mem`; compute coefficients in `update()`, called from `@init`, `@slider` and
|
|
95
95
|
`@block: ui_changed() ? update();`.
|
|
96
96
|
- `@gfx` draws the core row(s), then `ui_section("Advanced") ? ( ... )` for the rest.
|
|
97
|
+
- **Bands on a frequency graph are always directly editable, unless the user says otherwise.** A plugin
|
|
98
|
+
with bands (a crossover, a multiband or split, an EQ) draws `ui_freqgraph` with a `ui_fhandle` per
|
|
99
|
+
band edge, and then **a per-band control on the graph itself**: `ui_fthresh(thr, ratio, gain, n)` for
|
|
100
|
+
dynamics (hover a band and drag up or down for its threshold, Shift-drag for its gain, wheel for its
|
|
101
|
+
ratio) or `ui_fband(first, n, fmt)` for one level per band (drag up or down, Shift = fine). Both
|
|
102
|
+
select the band on a click, and one `ui_bandknob(first, n, "Label", fmt)` per band parameter edits
|
|
103
|
+
the selected band. Never ship bands whose only controls are plain knobs: the multiband example is
|
|
104
|
+
the model.
|
|
105
|
+
- **A keyboard is for playing as well as showing, and it sits along the bottom.** `ui_keyboard(21, 108,
|
|
106
|
+
"Keys")` (the full range, or 36-96 for a small window; make the window wide enough, about 700 px for
|
|
107
|
+
88 keys) as the **last** core row, below the knobs, short and full width like Vital's and Odin's. A
|
|
108
|
+
click or a drag across the keys plays. The keys fill the bottom of their cell, so the keyboard row must be the
|
|
109
|
+
last of the `ui_begin` core rows and the count must match the rows you draw (`ui_tall(2)` on the knob row
|
|
110
|
+
above it makes the keys a short strip right above the Advanced bar): read it in `@block` with `while (ui_kpoll()) ( ui_kv > 0 ?
|
|
111
|
+
<note on ui_kn, ui_kv> : <note off ui_kn> );` next to the MIDI-in loop (a synth turns them into
|
|
112
|
+
voices, a MIDI effect `midisend`s them). Notes from MIDI light the keys with `ui_kkey(note, vel)`.
|
|
97
113
|
- Do not write the toolkit: `write_jsfx` inlines it.
|
|
98
114
|
- Never assign `ui_adv_open` (or any `ui_` state) in plugin code: REAPER re-runs `@init` when
|
|
99
115
|
playback starts, so the Advanced drawer would snap shut on Play (lint `ui-state-reset`).
|
|
@@ -44,17 +44,18 @@ Every widget is one block, label above, control, value below, sized the same acr
|
|
|
44
44
|
| `ui_gshow(on)` / `ui_gfeed2(buf, n)` | before / after: with `ui_gshow(slider)` on, the graph also draws the input as a second, lighter line labelled Input / Output; feed it with `ui_gfeed2` only while shown (a second FFT costs). Put a `ui_toggle` for it in Advanced | a `<0,1,1{Off,On}>` slider |
|
|
45
45
|
| `ui_fhandle(idx, "Label")` | a draggable band edge on the graph, bound to slider `idx` in Hz; drag, wheel, double-click for a value box, modifier-click resets; stays between its neighbours; automates like a knob | a Hz slider, e.g. `<40,800,1>`; call it after `ui_freqgraph`, in left-to-right order |
|
|
46
46
|
| `ui_fthresh(thr_first, ratio_first, gain_first, n)` | a threshold line across each of `n` bands (the handles + 1) on the graph; hover a band and drag up/down to move its threshold, **Shift**-drag its gain, wheel = its ratio, click selects it | `n` threshold sliders from `thr_first` (dB, -60..0), `n` ratio sliders from `ratio_first`, `n` gain sliders from `gain_first`; call it after the handles |
|
|
47
|
+
| `ui_fband(first_idx, n, fmt)` | one level line per band on the graph, for bands with a single amount (an EQ's gain, a split's level): hover a band and drag up or down (the slider's full range across the graph height), **Shift**-drag for fine steps, wheel = a small step, click selects it, double-click types a value, modifier-click resets; `fmt` as for knobs (1 = dB) | `n` sliders from `first_idx`; call it after the handles; pair it with `ui_bandknob` |
|
|
47
48
|
| `ui_bandknob(first_idx, n, "Label", fmt)` | a knob on the selected band's slider (`first_idx + ui_fsel`), labelled with the band (Low / Mid / High, else Band N) | `n` sliders from `first_idx`; counts as one widget |
|
|
48
49
|
| `ui_grmeter(n, "Label")` | `n` (1-8) gain-reduction bars hanging from the top, amber from 6 dB, red from 12; a click selects the band | `ui_gr(k, db)` per band from `@block` (db 0 or more) |
|
|
49
50
|
| `ui_transfer(thr_idx, ratio_idx, knee_db)` | a compressor transfer curve that follows the threshold and ratio sliders (the selected band's, `thr_idx + ui_fsel`, with a graph), with a live level dot | `ui_glevel(db)` from `@block` |
|
|
50
|
-
| `ui_keyboard(lo, hi, "Label")` | piano keys `lo`..`hi` (MIDI notes),
|
|
51
|
+
| `ui_keyboard(lo, hi, "Label")` | piano keys `lo`..`hi` (MIDI notes, 21-108 is the full 88), short and full width: put it as the last core row, below the knobs. **Playable**: press a key to play it (higher up the key = softer), drag across keys for a glissando, release to stop | `ui_kkey(note, vel)` on note on, `ui_kkey(note, 0)` on note off, for notes the plugin hears; the notes the user plays arrive in `@block` through `while (ui_kpoll()) ( ... )`: each 1 means `ui_kn` is a note and `ui_kv` its velocity (0 = off) |
|
|
51
52
|
| `ui_tall(span)` | the next `ui_row` is `span` times as tall (a graph needs height); knobs in it keep their size | none |
|
|
52
53
|
|
|
53
54
|
Use `ui_boot(2)` in a plugin with these feeds: it redraws only when a feed, a control or the window
|
|
54
55
|
changed, so silence costs nothing (`ui_boot(1)` redraws every frame, `ui_boot(0)` only on change).
|
|
55
56
|
Feeds are rounded to a visible step before they count as change. A graph widget counts as one
|
|
56
57
|
widget for the core limit. The selected band is `ui_fsel` (0-based), which the plugin may read.
|
|
57
|
-
Memory map: 0..1023 core, 1024+ graph data (`ui_fg` trace, `ui_ge` band edges, `ui_grm`, `ui_kb`),
|
|
58
|
+
Memory map: 0..1023 core, 1024+ graph data (`ui_fg` trace, `ui_ge` band edges, `ui_grm`, `ui_kb`, `ui_kq` the played-key queue),
|
|
58
59
|
`ui_mem` (2048) is where your buffers start. `examples/multiband-compressor.jsfx` uses them all.
|
|
59
60
|
|
|
60
61
|
`fmt` for knobs: `0` number (`0.00`), `1` dB, `2` percent of 0..1, `3` Hz or kHz, `4` ms, `5` integer.
|
|
@@ -72,7 +73,7 @@ when the user turns on the FX window's **+ > Send all keyboard input to plug-in*
|
|
|
72
73
|
the plugin; then it closes the value box, the About dialog, then the drawer (and the window
|
|
73
74
|
closes with its close button, as every key now goes to the plugin).
|
|
74
75
|
|
|
75
|
-
**Header
|
|
76
|
+
**Header bars.** A plugin with a Mix and/or an Output slider calls `ui_header(mix_idx, out_idx)` in `@gfx` before `ui_begin` (0 for one it does not have): two slim horizontal bars in the top right (like Vital's), Output rightmost, dragged left/right with the usual gestures, the value shown while hovered. Do not draw those sliders as widgets too (they leave the core view and its widget count). The header band is one line: the plugin name and the bars are vertically centred on it, with an equal gap above and below, and the first row starts after it (the same with or without Mix / Output).
|
|
76
77
|
|
|
77
78
|
Every plugin also gets, with no code of its own: its name in small spaced capitals at the top-left
|
|
78
79
|
(hidden in a very narrow window), and a small "reaper-mcp" credit at the bottom right
|
package/main.js
CHANGED
|
@@ -4240,13 +4240,21 @@ function registerExtensionCategory(extension, description, tools) {
|
|
|
4240
4240
|
TOOL_CATEGORIES[name] = { name, description, tools };
|
|
4241
4241
|
return name;
|
|
4242
4242
|
}
|
|
4243
|
+
var visibleCategories = null;
|
|
4244
|
+
function setVisibleCategories(names) {
|
|
4245
|
+
visibleCategories = names;
|
|
4246
|
+
}
|
|
4247
|
+
function visible() {
|
|
4248
|
+
if (!visibleCategories) return TOOL_CATEGORIES;
|
|
4249
|
+
return Object.fromEntries(Object.entries(TOOL_CATEGORIES).filter(([n]) => visibleCategories?.has(n)));
|
|
4250
|
+
}
|
|
4243
4251
|
function registerCategoryTools(server) {
|
|
4244
4252
|
server.tool(
|
|
4245
4253
|
"list_tool_categories",
|
|
4246
|
-
`List all available tool categories with descriptions and tool names. Use this to discover what tools are available without loading every tool schema. Categories: ${Object.keys(
|
|
4254
|
+
`List all available tool categories with descriptions and tool names. Use this to discover what tools are available without loading every tool schema. Categories: ${Object.keys(visible()).join(", ")}.`,
|
|
4247
4255
|
{},
|
|
4248
4256
|
async () => {
|
|
4249
|
-
const categories = Object.values(
|
|
4257
|
+
const categories = Object.values(visible()).map((cat) => ({
|
|
4250
4258
|
name: cat.name,
|
|
4251
4259
|
description: cat.description,
|
|
4252
4260
|
toolCount: cat.tools.length,
|
|
@@ -4267,9 +4275,9 @@ function registerCategoryTools(server) {
|
|
|
4267
4275
|
category: z26.string().describe('Category name (e.g. "tracks", "fx", "midi", "media", "transport", "markers", "envelopes", "analysis", "discovery")')
|
|
4268
4276
|
},
|
|
4269
4277
|
async ({ category }) => {
|
|
4270
|
-
const cat =
|
|
4278
|
+
const cat = visible()[category];
|
|
4271
4279
|
if (!cat) {
|
|
4272
|
-
const available = Object.keys(
|
|
4280
|
+
const available = Object.keys(visible()).join(", ");
|
|
4273
4281
|
return {
|
|
4274
4282
|
content: [{
|
|
4275
4283
|
type: "text",
|
|
@@ -4299,9 +4307,9 @@ function registerCategoryTools(server) {
|
|
|
4299
4307
|
category: z26.string().describe('Category name (e.g. "tracks", "fx", "midi", "media", "transport", "markers", "envelopes", "analysis", "discovery")')
|
|
4300
4308
|
},
|
|
4301
4309
|
async ({ category }) => {
|
|
4302
|
-
const cat =
|
|
4310
|
+
const cat = visible()[category];
|
|
4303
4311
|
if (!cat) {
|
|
4304
|
-
const available = Object.keys(
|
|
4312
|
+
const available = Object.keys(visible()).join(", ");
|
|
4305
4313
|
return {
|
|
4306
4314
|
content: [{
|
|
4307
4315
|
type: "text",
|
|
@@ -4324,6 +4332,45 @@ function registerCategoryTools(server) {
|
|
|
4324
4332
|
);
|
|
4325
4333
|
}
|
|
4326
4334
|
|
|
4335
|
+
// apps/reaper-mcp-server/src/profile.ts
|
|
4336
|
+
var PROFILES = {
|
|
4337
|
+
/** Smoke test and basic control. */
|
|
4338
|
+
minimal: ["project", "tracks", "fx", "transport", "discovery", "selection"],
|
|
4339
|
+
/** Mixing and mastering: measure, set levels and FX, route, automate, snapshot, render. */
|
|
4340
|
+
mixing: ["project", "tracks", "fx", "fx_files", "transport", "discovery", "selection", "routing", "plan", "analysis", "snapshots", "envelopes", "actions", "knowledge", "recording"],
|
|
4341
|
+
/** Writing and editing music and arrangements (no takes or actions). Adding categories or an extension, e.g. `mixing,composition`, can push a profile past 128. */
|
|
4342
|
+
music: ["project", "tracks", "fx", "transport", "discovery", "selection", "midi", "media", "arrange", "markers", "tempo", "envelopes", "plan"],
|
|
4343
|
+
/** Inspect and measure; the tracks and project categories still hold a few writers, so this is not read-only. */
|
|
4344
|
+
analysis: ["project", "tracks", "transport", "discovery", "selection", "routing", "markers", "tempo", "analysis", "knowledge"]
|
|
4345
|
+
};
|
|
4346
|
+
function resolveProfile(value = process.env["REAPER_MCP_PROFILE"]) {
|
|
4347
|
+
const parts = (value ?? "").split(",").map((p) => p.trim()).filter(Boolean);
|
|
4348
|
+
if (parts.length === 0 || parts.includes("full")) return { name: "full", categories: null, extensions: [] };
|
|
4349
|
+
const categories = /* @__PURE__ */ new Set();
|
|
4350
|
+
const extensions = [];
|
|
4351
|
+
for (const part of parts) {
|
|
4352
|
+
const profile = PROFILES[part];
|
|
4353
|
+
if (profile) profile.forEach((c) => categories.add(c));
|
|
4354
|
+
else {
|
|
4355
|
+
categories.add(part);
|
|
4356
|
+
if (!(part in TOOL_CATEGORIES)) extensions.push(part);
|
|
4357
|
+
}
|
|
4358
|
+
}
|
|
4359
|
+
return { name: parts.join(","), categories, extensions };
|
|
4360
|
+
}
|
|
4361
|
+
function blockedTools(categories) {
|
|
4362
|
+
if (!categories) return /* @__PURE__ */ new Set();
|
|
4363
|
+
const all = /* @__PURE__ */ new Set();
|
|
4364
|
+
const kept = /* @__PURE__ */ new Set();
|
|
4365
|
+
for (const cat of Object.values(TOOL_CATEGORIES)) {
|
|
4366
|
+
for (const t of cat.tools) {
|
|
4367
|
+
all.add(t);
|
|
4368
|
+
if (categories.has(cat.name)) kept.add(t);
|
|
4369
|
+
}
|
|
4370
|
+
}
|
|
4371
|
+
return new Set([...all].filter((t) => !kept.has(t)));
|
|
4372
|
+
}
|
|
4373
|
+
|
|
4327
4374
|
// apps/reaper-mcp-server/src/tools/aesthetics.ts
|
|
4328
4375
|
import { z as z27 } from "zod/v4";
|
|
4329
4376
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
@@ -8780,10 +8827,14 @@ var UI_API = {
|
|
|
8780
8827
|
ui_keyboard: 3,
|
|
8781
8828
|
ui_fthresh: 4,
|
|
8782
8829
|
ui_header: 2,
|
|
8783
|
-
|
|
8830
|
+
ui_hbar: 4,
|
|
8831
|
+
ui_pill: 4,
|
|
8784
8832
|
ui_gfeed2: 2,
|
|
8785
8833
|
ui_gshow: 1,
|
|
8786
|
-
ui_bandknob: 4
|
|
8834
|
+
ui_bandknob: 4,
|
|
8835
|
+
ui_fband: 3,
|
|
8836
|
+
ui_kput: 2,
|
|
8837
|
+
ui_kpoll: 0
|
|
8787
8838
|
};
|
|
8788
8839
|
var MAX_CORE_WIDGETS = 5;
|
|
8789
8840
|
var MAX_ADVANCED_WIDGETS = 8;
|
|
@@ -8825,6 +8876,7 @@ function sections2(code) {
|
|
|
8825
8876
|
}
|
|
8826
8877
|
var WIDGET = /\bui_(knob|toggle|choice|fhandle)\s*\(\s*(\d+)/g;
|
|
8827
8878
|
var BANDKNOB = /\bui_bandknob\s*\(\s*(\d+)\s*,\s*(\d+)/g;
|
|
8879
|
+
var FBAND = /\bui_fband\s*\(\s*(\d+)\s*,\s*(\d+)/g;
|
|
8828
8880
|
var FTHRESH = /\bui_fthresh\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/g;
|
|
8829
8881
|
var HEADER = /\bui_header\s*\(\s*(\d+)\s*,\s*(\d+)/g;
|
|
8830
8882
|
var TRANSFER = /\bui_transfer\s*\(\s*(\d+)\s*,\s*(\d+)/g;
|
|
@@ -8914,6 +8966,7 @@ function lintJsfx(source) {
|
|
|
8914
8966
|
const ranges = [];
|
|
8915
8967
|
for (const m of gfx.text.matchAll(HEADER)) for (const v of [m[1], m[2]]) if (Number(v) > 0) ranges.push(["ui_header", Number(v), 1]);
|
|
8916
8968
|
for (const m of gfx.text.matchAll(BANDKNOB)) ranges.push(["ui_bandknob", Number(m[1]), Number(m[2])]);
|
|
8969
|
+
for (const m of gfx.text.matchAll(FBAND)) ranges.push(["ui_fband", Number(m[1]), Number(m[2])]);
|
|
8917
8970
|
for (const m of gfx.text.matchAll(FTHRESH)) ranges.push(["ui_fthresh", Number(m[1]), Number(m[4])], ["ui_fthresh", Number(m[2]), Number(m[4])], ["ui_fthresh", Number(m[3]), Number(m[4])]);
|
|
8918
8971
|
for (const [fn, first, count] of ranges) {
|
|
8919
8972
|
for (let idx = first; idx < first + count; idx++) {
|
|
@@ -9394,12 +9447,20 @@ function instrumentToolHandlers(server) {
|
|
|
9394
9447
|
return originalTool(...args);
|
|
9395
9448
|
};
|
|
9396
9449
|
}
|
|
9397
|
-
function
|
|
9450
|
+
function applyProfile(server, profile) {
|
|
9451
|
+
setVisibleCategories(profile.categories);
|
|
9452
|
+
const blocked = blockedTools(profile.categories);
|
|
9453
|
+
if (blocked.size === 0) return;
|
|
9454
|
+
const register = server.tool.bind(server);
|
|
9455
|
+
server.tool = (...args) => blocked.has(args[0]) ? void 0 : register(...args);
|
|
9456
|
+
}
|
|
9457
|
+
function createServer(profile = resolveProfile()) {
|
|
9398
9458
|
const server = new McpServer({
|
|
9399
9459
|
name: "reaper-mcp",
|
|
9400
9460
|
version: "0.1.0"
|
|
9401
9461
|
});
|
|
9402
9462
|
instrumentToolHandlers(server);
|
|
9463
|
+
applyProfile(server, profile);
|
|
9403
9464
|
registerProjectTools(server);
|
|
9404
9465
|
registerTrackTools(server);
|
|
9405
9466
|
registerFxTools(server);
|
|
@@ -9728,9 +9789,13 @@ async function loadOne(server, ext) {
|
|
|
9728
9789
|
return skipped(err instanceof Error ? err.message : String(err));
|
|
9729
9790
|
}
|
|
9730
9791
|
}
|
|
9731
|
-
async function loadExtensions(server, root = getExtensionsDir()) {
|
|
9792
|
+
async function loadExtensions(server, root = getExtensionsDir(), include) {
|
|
9732
9793
|
const statuses = [];
|
|
9733
9794
|
for (const ext of await discoverExtensions(root)) {
|
|
9795
|
+
if (include && !include(ext.manifest?.name ?? ext.folder)) {
|
|
9796
|
+
statuses.push({ name: ext.manifest?.name ?? ext.folder, status: "skipped", reason: "not in the REAPER_MCP_PROFILE", tools: [] });
|
|
9797
|
+
continue;
|
|
9798
|
+
}
|
|
9734
9799
|
if (!ext.manifest) {
|
|
9735
9800
|
statuses.push({ name: ext.folder, status: "skipped", reason: ext.errors.join("; "), tools: [] });
|
|
9736
9801
|
} else {
|
|
@@ -10613,11 +10678,20 @@ async function serve() {
|
|
|
10613
10678
|
});
|
|
10614
10679
|
startupSpan.setAttribute("reaper.bridge.connected", bridge.state === "connected");
|
|
10615
10680
|
startupSpan.setAttribute("reaper.bridge.state", bridge.state);
|
|
10616
|
-
const
|
|
10617
|
-
|
|
10681
|
+
const profile = resolveProfile();
|
|
10682
|
+
const server = createServer(profile);
|
|
10683
|
+
const selected = profile.categories;
|
|
10684
|
+
const loadedExtensions = await loadExtensions(server, void 0, selected ? (name) => selected.has(name) : void 0);
|
|
10685
|
+
for (const ext of loadedExtensions) {
|
|
10618
10686
|
if (ext.status === "loaded") log(`Extension ${ext.name} ${ext.version ?? ""} loaded (${ext.tools.length} tools)`);
|
|
10619
10687
|
else log(`Extension ${ext.name} skipped: ${ext.reason}`);
|
|
10620
10688
|
}
|
|
10689
|
+
if (selected) {
|
|
10690
|
+
log(`Tool profile "${profile.name}": ${Object.keys(server._registeredTools).length} tools`);
|
|
10691
|
+
for (const name of profile.extensions) {
|
|
10692
|
+
if (!loadedExtensions.some((e) => e.name === name && e.status === "loaded")) log(`REAPER_MCP_PROFILE names "${name}", which is neither a profile, a tool category nor a loaded extension`);
|
|
10693
|
+
}
|
|
10694
|
+
}
|
|
10621
10695
|
const transport = new StdioServerTransport();
|
|
10622
10696
|
await server.connect(transport);
|
|
10623
10697
|
server.server.oninitialized = () => {
|
package/package.json
CHANGED
package/reaper/mcp_ui.jsfx-inc
CHANGED
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
// 1168..1199 ui_grm gain reduction per band in dB (8) -- slots 8..31 spare
|
|
24
24
|
// 1200..1327 ui_kb MIDI keyboard: velocity per note 0..127 (0 = off)
|
|
25
25
|
// 1328..1455 ui_fi the input trace for the before/after view (same 96 points as ui_fg)
|
|
26
|
-
// 1456..
|
|
26
|
+
// 1456..1489 ui_kq the keys played with the mouse: 16 note/velocity slots, then head and tail (ui_kpoll)
|
|
27
|
+
// 1490..2047 spare for the toolkit
|
|
27
28
|
// 2048.. ui_mem the plugin
|
|
28
29
|
// Every global starts with ui_. Sliders must be UNNAMED (slider1:0.5<0,1,0.01>Label): named
|
|
29
30
|
// sliders do not keep their value in sliderN, which the toolkit reads through slider(idx).
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
// @serialize file_var(0, ui_adv_open); // added for you when the plugin has none
|
|
47
48
|
|
|
48
49
|
ui_ver = 1.3;
|
|
49
|
-
ui_hm = 0; ui_ho = 0; // the header
|
|
50
|
+
ui_hm = 0; ui_ho = 0; // the header bars' sliders (ui_header), 0 = none
|
|
50
51
|
|
|
51
52
|
// Design tokens: the bridge status page's palette (apps/bridge-ui/src/styles.css). The accent is
|
|
52
53
|
// the plugin's own: write_jsfx emits ui_theme($xRRGGBB) after this block (from the plugin's name,
|
|
@@ -75,7 +76,7 @@ ui_pver = 0; ui_nctl = 0; ui_akind = 0; ui_example = 0;
|
|
|
75
76
|
ui_min = 0; ui_max = 65; ui_def = 130; ui_stp = 195;
|
|
76
77
|
ui_mtr = 400; // meter state: 2 slots per meter (level in dB, last time)
|
|
77
78
|
ui_gn = 96; // frequency graph trace points (log-spaced); at most 128
|
|
78
|
-
ui_fg = 1024; ui_ge = 1152; ui_grm = 1168; ui_kb = 1200; ui_fi = 1328; ui_gt = ui_fg; // graph widgets' memory, see the map above
|
|
79
|
+
ui_fg = 1024; ui_ge = 1152; ui_grm = 1168; ui_kb = 1200; ui_fi = 1328; ui_kq = 1456; ui_gt = ui_fg; // graph widgets' memory, see the map above
|
|
79
80
|
ui_mem = 2048; // first free memory index for the plugin's own buffers
|
|
80
81
|
// REAPER re-runs @init when playback starts (and on sample-rate changes): the UI state below
|
|
81
82
|
// is set once, so pressing Play never closes the drawer or drops a drag. Plugin code must not
|
|
@@ -304,8 +305,9 @@ function ui_namedraw() local(x, y, i, c, n) (
|
|
|
304
305
|
gfx_w >= 150 * ui_s ? (
|
|
305
306
|
gfx_setfont(5);
|
|
306
307
|
ui_caps(#ui_name);
|
|
307
|
-
|
|
308
|
-
|
|
308
|
+
gfx_measurestr("A", ui_tw, ui_th);
|
|
309
|
+
x = ui_pad; y = 15 * ui_s - ui_th / 2; // centred on the header band, level with the Mix / Output bars
|
|
310
|
+
ui_c(ui_cAccent, 0.9); gfx_circle(x + 1.5 * ui_s, 15 * ui_s, 1.5 * ui_s, 1, 1);
|
|
309
311
|
x += 8 * ui_s;
|
|
310
312
|
ui_c(ui_cMuted, 0.85);
|
|
311
313
|
i = 0; n = strlen(#ui_txt);
|
|
@@ -384,14 +386,18 @@ function ui_arow(x, y, w, label, val) (
|
|
|
384
386
|
ui_c(ui_cText, 1); gfx_x = x + 70 * ui_s; gfx_y = y; gfx_drawstr(val);
|
|
385
387
|
);
|
|
386
388
|
|
|
387
|
-
// The About dialog: what reaper-mcp is, where to find it,
|
|
388
|
-
// click outside it or on its x. In a
|
|
389
|
-
|
|
389
|
+
// The About dialog: what reaper-mcp is, where to find it, this plugin's facts and how the controls are
|
|
390
|
+
// used (the gestures every knob, bar and handle shares). Closes on a click outside it or on its x. In a
|
|
391
|
+
// short window the description lines go first, then the plugin's facts; the gestures stay while they fit.
|
|
392
|
+
function ui_aboutdraw() local(w, h, x, y, lh, nd, rows, bx, cy, hitx, kb, av) (
|
|
390
393
|
lh = 13 * ui_s;
|
|
391
|
-
|
|
392
|
-
|
|
394
|
+
av = gfx_h - 16 * ui_s;
|
|
395
|
+
kb = av >= 225 * ui_s + 2 * lh; // the gesture block: a heading and five lines
|
|
396
|
+
av -= kb * 91 * ui_s;
|
|
397
|
+
nd = av - 186 * ui_s >= 3 * lh ? 3 : 0; // the description is all three lines or none, never cut mid-sentence
|
|
398
|
+
rows = nd > 0 ? 6 : max(2, min(6, floor((av - 108 * ui_s) / lh)));
|
|
393
399
|
w = min(gfx_w - 16 * ui_s, 300 * ui_s);
|
|
394
|
-
h = (12 + 22 + 6 + 4 + 28 + 10 + 16 + 10) * ui_s + nd * lh + rows * lh;
|
|
400
|
+
h = (12 + 22 + 6 + 4 + 28 + 10 + 16 + 10) * ui_s + nd * lh + rows * lh + kb * 91 * ui_s;
|
|
395
401
|
x = (gfx_w - w) / 2; y = max(8 * ui_s, (gfx_h - h) / 2);
|
|
396
402
|
bx = x + w - 26 * ui_s;
|
|
397
403
|
hitx = mouse_x >= bx && mouse_x < bx + 20 * ui_s && mouse_y >= y + 8 * ui_s && mouse_y < y + 28 * ui_s;
|
|
@@ -432,6 +438,16 @@ function ui_aboutdraw() local(w, h, x, y, lh, nd, rows, bx, cy, hitx) (
|
|
|
432
438
|
);
|
|
433
439
|
rows > 4 ? ( sprintf(#ui_txt, "%d", ui_nctl); ui_arow(x, y, w, "Controls", #ui_txt); y += lh; );
|
|
434
440
|
rows > 5 ? ( ui_arow(x, y, w, "Written", strlen(#ui_date) ? #ui_date : "-"); y += lh; );
|
|
441
|
+
kb ? (
|
|
442
|
+
y += 10 * ui_s;
|
|
443
|
+
ui_c(ui_cLine, 1); gfx_rect(x, y - 6 * ui_s, w - 28 * ui_s, max(1, ui_s));
|
|
444
|
+
gfx_setfont(2); ui_c(ui_cMuted, 1); gfx_x = x; gfx_y = y; gfx_drawstr("CONTROLS"); y += 16 * ui_s;
|
|
445
|
+
ui_arow(x, y, w, "Drag", "change the value"); y += lh;
|
|
446
|
+
ui_arow(x, y, w, "Shift-drag", "fine adjust (10x finer)"); y += lh;
|
|
447
|
+
ui_arow(x, y, w, "Wheel", "step the value"); y += lh;
|
|
448
|
+
ui_arow(x, y, w, "Dbl-click", "type an exact value"); y += lh;
|
|
449
|
+
ui_arow(x, y, w, "Cmd-click", "reset to default (Ctrl, Alt too)"); y += lh;
|
|
450
|
+
);
|
|
435
451
|
gfx_setfont(1);
|
|
436
452
|
);
|
|
437
453
|
);
|
|
@@ -511,32 +527,60 @@ function ui_ctl(idx, fmt, label, x, y) local(lo, hi, st, t, fine) (
|
|
|
511
527
|
);
|
|
512
528
|
|
|
513
529
|
// Mix and Output in the top right of every plugin that has them: call ui_header(mix_idx, out_idx) in @gfx
|
|
514
|
-
// before ui_begin (0 = this plugin has no such slider). Two
|
|
530
|
+
// before ui_begin (0 = this plugin has no such slider). Two slim horizontal bars with the usual gestures; the
|
|
515
531
|
// label shows the value while you hover or drag. Do not draw those two sliders as widgets as well.
|
|
516
532
|
function ui_header(m, o) ( ui_hm = max(0, floor(m)); ui_ho = max(0, floor(o)); );
|
|
517
533
|
|
|
518
|
-
//
|
|
519
|
-
function
|
|
520
|
-
r =
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
534
|
+
// A pill exactly h pixels tall: the end caps are circles of diameter h, so they never stick out past the bar.
|
|
535
|
+
function ui_pill(x, y, w, h) local(r) (
|
|
536
|
+
r = h / 2;
|
|
537
|
+
w <= h ? gfx_rect(x, y, w, h) : (
|
|
538
|
+
gfx_rect(x + r, y, w - h, h);
|
|
539
|
+
gfx_circle(x + r - 0.5, y + r - 0.5, r - 0.5, 1, 1);
|
|
540
|
+
gfx_circle(x + w - r - 0.5, y + r - 0.5, r - 0.5, 1, 1);
|
|
541
|
+
);
|
|
542
|
+
);
|
|
543
|
+
|
|
544
|
+
// One slim horizontal bar (like the level bar in Vital's header) whose right edge is xr; returns the x of the
|
|
545
|
+
// next one to its left. Drag left or right (Shift = fine), wheel, double-click to type, modifier-click resets.
|
|
546
|
+
// The header band is centred on y = 15 px, the same line the plugin name sits on.
|
|
547
|
+
function ui_hbar(idx, label, fmt, xr) local(bw, bh, bx, cy, by, lo, hi, st, t, t0, hot, tt, x0, x1) (
|
|
548
|
+
bw = 58 * ui_s; bh = 6 * ui_s; bx = xr - bw; cy = 15 * ui_s;
|
|
549
|
+
by = cy - 0.5 * ui_s; // the caps' ink sits half a pixel above the line box's middle: the bar follows the ink
|
|
550
|
+
lo = ui_min[idx]; hi = ui_max[idx]; st = ui_stp[idx];
|
|
551
|
+
ui_hit = !(ui_core && ui_blocked) && !ui_modal && mouse_x >= xr - 112 * ui_s && mouse_x < xr && mouse_y >= cy - 10 * ui_s && mouse_y < cy + 10 * ui_s;
|
|
552
|
+
ui_hit && ui_press ? (
|
|
553
|
+
tt = time_precise();
|
|
554
|
+
(mouse_cap & 52) ? ui_reset(idx) :
|
|
555
|
+
(ui_lci == idx && tt - ui_lct < 0.45) ? ui_edopen(idx, fmt, label, bx, cy + 12 * ui_s) :
|
|
556
|
+
( ui_active = idx; ui_lx = mouse_x; ui_acc = slider(idx); ui_lci = idx; ui_lct = tt; );
|
|
557
|
+
);
|
|
558
|
+
ui_active == idx && ui_down ? (
|
|
559
|
+
ui_acc = min(hi, max(lo, ui_acc + (mouse_x - ui_lx) / (bw * ((mouse_cap & 8) ? 10 : 1)) * (hi - lo)));
|
|
560
|
+
ui_lx = mouse_x;
|
|
561
|
+
ui_set(idx, ui_q(idx, ui_acc));
|
|
562
|
+
);
|
|
563
|
+
ui_hit && mouse_wheel != 0 ? (
|
|
564
|
+
ui_set(idx, ui_q(idx, slider(idx) + sign(mouse_wheel) * (st > 0 ? st : (hi - lo) / ((mouse_cap & 8) ? 200 : 40))));
|
|
565
|
+
);
|
|
566
|
+
ui_active == idx && ui_rel ? ( slider_automate(2 ^ (idx - 1), 1); ui_active = 0; );
|
|
524
567
|
t = min(1, max(0, (slider(idx) - lo) / (hi - lo)));
|
|
525
568
|
t0 = (lo < 0 && hi > 0) ? -lo / (hi - lo) : 0;
|
|
526
569
|
hot = ui_active == idx || ui_hit;
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
570
|
+
ui_c(hot ? ui_cTrackHot : ui_cTrack, 1); ui_pill(bx, by - bh / 2, bw, bh);
|
|
571
|
+
abs(t - t0) > 0.002 ? (
|
|
572
|
+
x0 = bx + bw * min(t, t0); x1 = bx + bw * max(t, t0);
|
|
573
|
+
ui_c(ui_active == idx ? ui_cAccentAct : (hot ? ui_cAccentHi : ui_cAccent), 1);
|
|
574
|
+
ui_pill(x0, by - bh / 2, max(1, x1 - x0), bh);
|
|
575
|
+
);
|
|
576
|
+
ui_c(hot ? ui_cText : ui_cMuted, 1); gfx_rect(bx + bw * t - ui_s / 2, by - bh, max(1, ui_s), bh * 2);
|
|
533
577
|
gfx_setfont(2);
|
|
534
578
|
hot ? ui_fmtv(fmt, slider(idx)) : ui_caps(label);
|
|
535
579
|
gfx_measurestr(#ui_txt, ui_tw, ui_th);
|
|
536
580
|
ui_c(ui_active == idx ? ui_cAccent : (hot ? ui_cText : ui_cMuted), 1);
|
|
537
|
-
gfx_x =
|
|
581
|
+
gfx_x = bx - 6 * ui_s - ui_tw; gfx_y = cy - ui_th / 2; gfx_drawstr(#ui_txt);
|
|
538
582
|
gfx_setfont(1);
|
|
539
|
-
xr -
|
|
583
|
+
xr - 118 * ui_s;
|
|
540
584
|
);
|
|
541
585
|
|
|
542
586
|
// Returns 1 when the frame needs drawing. Nothing changed = nothing drawn, the old frame stays.
|
|
@@ -574,15 +618,15 @@ function ui_begin(core_rows, adv_rows) local(h, i, now, e, top) (
|
|
|
574
618
|
gfx_setfont(4, "Arial", 15 * ui_s, 'b');
|
|
575
619
|
gfx_setfont(5, "Arial", 8.5 * ui_s, 'b');
|
|
576
620
|
gfx_setfont(1);
|
|
577
|
-
ui_ytop =
|
|
578
|
-
ui_nlim = gfx_w - ui_pad - ((ui_hm > 0) + (ui_ho > 0)) *
|
|
621
|
+
ui_ytop = 25 * ui_s; // name and bars are centred on y = 15; the first row's own padding makes the gap below match the 11 px above
|
|
622
|
+
ui_nlim = gfx_w - ui_pad - ((ui_hm > 0) + (ui_ho > 0)) * 118 * ui_s;
|
|
579
623
|
ui_namedraw();
|
|
580
624
|
ui_core = 1;
|
|
581
625
|
ui_blocked = adv_rows > 0 && (ui_adv_open || ui_p > 0);
|
|
582
|
-
(ui_hm || ui_ho) && gfx_w >=
|
|
626
|
+
(ui_hm || ui_ho) && gfx_w >= 280 * ui_s ? (
|
|
583
627
|
i = gfx_w - ui_pad;
|
|
584
|
-
ui_ho ? i =
|
|
585
|
-
ui_hm ? i =
|
|
628
|
+
ui_ho ? i = ui_hbar(ui_ho, "Output", 1, i);
|
|
629
|
+
ui_hm ? i = ui_hbar(ui_hm, "Mix", 2, i);
|
|
586
630
|
);
|
|
587
631
|
// core: the window minus the drawer's closed bar (or the footer line when there is no drawer)
|
|
588
632
|
ui_rowh = (gfx_h - ui_ytop - (adv_rows > 0 ? ui_bar + 4 * ui_s : ui_pad + (ui_credit ? 6 * ui_s : 0))) / max(1, core_rows);
|
|
@@ -783,6 +827,24 @@ function ui_kkey(note, vel) local(n, q0, q1) (
|
|
|
783
827
|
ui_kb[n] = q1 ? min(127, max(1, vel)) : 0;
|
|
784
828
|
);
|
|
785
829
|
|
|
830
|
+
// The keys the user plays with the mouse reach @block through a small queue (ui_kq: 16 slots of note and
|
|
831
|
+
// velocity, then a head and a tail). ui_kput is called by the keyboard widget; the plugin calls ui_kpoll() in
|
|
832
|
+
// @block until it returns 0: each 1 means ui_kn is a note and ui_kv its velocity (0 = note off).
|
|
833
|
+
// A note-on is queued only while two slots are free, so every queued note-on keeps room for its note-off
|
|
834
|
+
// (a full queue drops the newest event; a lost note-off would leave the note stuck when @block resumes).
|
|
835
|
+
function ui_kput(note, vel) local(t, f) (
|
|
836
|
+
t = (ui_kq[33] + 1) % 16;
|
|
837
|
+
f = (ui_kq[32] - ui_kq[33] + 15) % 16; // free slots
|
|
838
|
+
f >= (vel > 0 ? 2 : 1) ? ( ui_kq[ui_kq[33] * 2] = note; ui_kq[ui_kq[33] * 2 + 1] = vel; ui_kq[33] = t; );
|
|
839
|
+
);
|
|
840
|
+
function ui_kpoll() (
|
|
841
|
+
ui_kq[32] != ui_kq[33] ? (
|
|
842
|
+
ui_kn = ui_kq[ui_kq[32] * 2]; ui_kv = ui_kq[ui_kq[32] * 2 + 1];
|
|
843
|
+
ui_kq[32] = (ui_kq[32] + 1) % 16;
|
|
844
|
+
1;
|
|
845
|
+
) : 0;
|
|
846
|
+
);
|
|
847
|
+
|
|
786
848
|
// ---- frequency graph ----------------------------------------------------------------------------
|
|
787
849
|
|
|
788
850
|
// x of a frequency and the frequency of an x on the current graph (log axis, 20 Hz to 20 kHz).
|
|
@@ -984,6 +1046,58 @@ function ui_fthresh(thr_first, ratio_first, gain_first, n) local(k, a, b, x, y,
|
|
|
984
1046
|
);
|
|
985
1047
|
);
|
|
986
1048
|
|
|
1049
|
+
// ---- per-band levels --------------------------------------------------------------------------------
|
|
1050
|
+
|
|
1051
|
+
// A level line across each band of the frequency graph, one slider per band (first_idx .. first_idx + n - 1, any
|
|
1052
|
+
// range, drawn across the graph's height), for a plugin whose bands each have one amount (an EQ's gain, a split's
|
|
1053
|
+
// level). Hover a band and drag up or down to change its level, Shift-drag for fine steps, wheel for small steps,
|
|
1054
|
+
// a click selects the band (ui_fsel, which ui_bandknob follows), double-click types a value, Cmd/Ctrl/Alt-click
|
|
1055
|
+
// resets it. fmt is the knob formats (1 = dB). n is the number of bands (the handles + 1). Call it after the handles.
|
|
1056
|
+
function ui_fband(first_idx, n, fmt) local(k, a, b, y, idx, lo, hi, hot, drag, near, i, sel, t, mn, mx) (
|
|
1057
|
+
n = max(1, min(8, floor(n)));
|
|
1058
|
+
k = 0;
|
|
1059
|
+
loop(n,
|
|
1060
|
+
idx = first_idx + k; mn = ui_min[idx]; mx = ui_max[idx];
|
|
1061
|
+
lo = k == 0 ? 20 : slider(ui_ge[k - 1]); hi = k == n - 1 ? 20000 : slider(ui_ge[k]);
|
|
1062
|
+
a = ui_fxof(lo); b = ui_fxof(hi);
|
|
1063
|
+
y = ui_gy + ui_gh * (1 - (slider(idx) - mn) / (mx - mn));
|
|
1064
|
+
near = 0; i = 0;
|
|
1065
|
+
loop(n - 1, abs(mouse_x - ui_fxof(slider(ui_ge[i]))) < 9 * ui_s ? near = 1; i += 1;);
|
|
1066
|
+
hot = !near && !(ui_core && ui_blocked) && !ui_modal && ui_active == 0 && mouse_x >= a && mouse_x < b
|
|
1067
|
+
&& mouse_y >= ui_gy && mouse_y < ui_gy + ui_gh;
|
|
1068
|
+
hot && ui_press ? (
|
|
1069
|
+
ui_fsel = k; t = time_precise();
|
|
1070
|
+
(mouse_cap & 52) ? ui_reset(idx) :
|
|
1071
|
+
(ui_lci == idx && t - ui_lct < 0.45) ? ui_edopen(idx, fmt, "Level", (a + b) / 2, y) :
|
|
1072
|
+
( ui_active = idx; ui_ftd = 1; ui_ly = mouse_y; ui_acc = slider(idx); ui_lci = idx; ui_lct = t; );
|
|
1073
|
+
ui_press = 0;
|
|
1074
|
+
);
|
|
1075
|
+
ui_ftd && ui_active == idx && ui_down ? ( // only a drag this widget started
|
|
1076
|
+
ui_acc = min(mx, max(mn, ui_acc - (mouse_y - ui_ly) * (mx - mn) / ui_gh * ((mouse_cap & 8) ? 0.2 : 1)));
|
|
1077
|
+
ui_ly = mouse_y;
|
|
1078
|
+
ui_set(idx, ui_q(idx, ui_acc));
|
|
1079
|
+
);
|
|
1080
|
+
hot && mouse_wheel != 0 ? ui_set(idx, ui_q(idx, slider(idx) + sign(mouse_wheel) * (ui_stp[idx] > 0 ? ui_stp[idx] : (mx - mn) / 48))); // a stepped slider moves one step, or ui_q would round the nudge away
|
|
1081
|
+
ui_active == idx && ui_rel ? ( slider_automate(2 ^ (idx - 1), 1); ui_active = 0; ui_ftd = 0; );
|
|
1082
|
+
drag = ui_active == idx;
|
|
1083
|
+
(hot || drag) ? ui_gany = 2;
|
|
1084
|
+
sel = k == ui_fsel;
|
|
1085
|
+
y = ui_gy + ui_gh * (1 - (slider(idx) - mn) / (mx - mn));
|
|
1086
|
+
(hot || drag) ? ( ui_c(ui_cAccent, 0.07); gfx_rect(a, ui_gy, max(1, b - a), ui_gh); );
|
|
1087
|
+
ui_c(drag ? ui_cAccentAct : (sel || hot ? ui_cAccentHi : ui_cAccent), drag ? 1 : (sel ? 0.95 : (hot ? 0.8 : 0.4)));
|
|
1088
|
+
gfx_rect(a + 2 * ui_s, y, max(1, b - a - 4 * ui_s), max(1, sel ? 2 * ui_s : ui_s));
|
|
1089
|
+
(sel || hot || drag) && b - a > 50 * ui_s ? (
|
|
1090
|
+
gfx_setfont(2);
|
|
1091
|
+
fmt == 1 ? sprintf(#ui_txt, "%+.1f dB", slider(idx)) : ui_fmtv(fmt, slider(idx));
|
|
1092
|
+
gfx_measurestr(#ui_txt, ui_tw, ui_th);
|
|
1093
|
+
ui_c(drag || sel ? ui_cAccent : ui_cText, 1);
|
|
1094
|
+
gfx_x = a + 6 * ui_s; gfx_y = max(ui_gy + 2 * ui_s, y - ui_th - 3 * ui_s); gfx_drawstr(#ui_txt);
|
|
1095
|
+
gfx_setfont(1);
|
|
1096
|
+
);
|
|
1097
|
+
k += 1;
|
|
1098
|
+
);
|
|
1099
|
+
);
|
|
1100
|
+
|
|
987
1101
|
// A knob for the selected band's slider: slider first_idx + ui_fsel of n, its label prefixed with the
|
|
988
1102
|
// band's name (Low / Mid / High for 3 bands, Low / High for 2, else Band N).
|
|
989
1103
|
function ui_bandknob(first_idx, n, label, fmt) local(k) (
|
|
@@ -1076,23 +1190,27 @@ function ui_transfer(thr_idx, ratio_idx, knee_db) local(k, t, r, bs, bx, by, i,
|
|
|
1076
1190
|
// ---- MIDI keyboard ------------------------------------------------------------------------------
|
|
1077
1191
|
|
|
1078
1192
|
// Piano keys lo..hi (MIDI notes; start and end on white keys: C, D, E, F, G, A, B), the notes fed with
|
|
1079
|
-
// ui_kkey lit in the accent.
|
|
1080
|
-
|
|
1193
|
+
// ui_kkey lit in the accent. Playable: a click or drag queues notes the plugin reads with ui_kpoll() in @block
|
|
1194
|
+
// (a JSFX cannot send MIDI from @gfx, so the plugin sounds them itself).
|
|
1195
|
+
function ui_keyboard(lo, hi, label) local(nw, n, pc, wi, ww, kx, ky, kw, kh, bk, x, v, k, hn, hw, vel) (
|
|
1081
1196
|
ui_cell();
|
|
1082
1197
|
nw = 0; n = lo;
|
|
1083
1198
|
loop(hi - lo + 1, ((2 ^ (n % 12)) & 1354) ? 0 : nw += 1; n += 1;);
|
|
1084
1199
|
kw = ui_rw - 8 * ui_s; kx = ui_rx + 4 * ui_s; ky = ui_ry + 16 * ui_s;
|
|
1085
|
-
kh = min(ui_rh - 20 * ui_s,
|
|
1200
|
+
kh = min(ui_rh - 20 * ui_s, 52 * ui_s);
|
|
1201
|
+
ky = ui_ry + ui_rh - kh - 4 * ui_s; // along the bottom of its cell
|
|
1086
1202
|
nw > 0 && kh > 16 * ui_s ? (
|
|
1087
1203
|
ww = kw / nw;
|
|
1088
1204
|
gfx_setfont(2); ui_caps(label);
|
|
1089
|
-
ui_c(ui_cMuted, 1); gfx_x = kx; gfx_y =
|
|
1205
|
+
ui_c(ui_cMuted, 1); gfx_x = kx; gfx_y = ky - 14 * ui_s; gfx_drawstr(#ui_txt);
|
|
1090
1206
|
gfx_setfont(1);
|
|
1207
|
+
hn = -1; hw = -1;
|
|
1091
1208
|
// white keys
|
|
1092
1209
|
wi = 0; n = lo;
|
|
1093
1210
|
loop(hi - lo + 1,
|
|
1094
1211
|
((2 ^ (n % 12)) & 1354) ? 0 : (
|
|
1095
1212
|
x = kx + wi * ww; v = ui_kb[n] > 0;
|
|
1213
|
+
mouse_x >= x && mouse_x < x + ww && mouse_y >= ky && mouse_y < ky + kh ? hw = n;
|
|
1096
1214
|
v ? ui_c(ui_cAccent, 1) : ui_cm(ui_cPanel2, ui_cText, 0.82);
|
|
1097
1215
|
ui_rrect(x + 0.5 * ui_s, ky, ww - ui_s, kh, 3 * ui_s);
|
|
1098
1216
|
wi += 1;
|
|
@@ -1105,6 +1223,7 @@ function ui_keyboard(lo, hi, label) local(nw, n, pc, wi, ww, kx, ky, kw, kh, bk,
|
|
|
1105
1223
|
((2 ^ (n % 12)) & 1354) ? (
|
|
1106
1224
|
wi > 0 ? (
|
|
1107
1225
|
bk = ww * 0.6; x = kx + wi * ww - bk / 2; v = ui_kb[n] > 0;
|
|
1226
|
+
mouse_x >= x && mouse_x < x + bk && mouse_y >= ky && mouse_y < ky + kh * 0.62 ? hn = n;
|
|
1108
1227
|
ui_c(ui_cLine, 1); ui_rrect(x - ui_s, ky, bk + 2 * ui_s, kh * 0.62 + ui_s, 3 * ui_s);
|
|
1109
1228
|
v ? ui_cm(ui_cAccent, ui_cBg, 0.35) : ui_cm(ui_cBg, ui_cPanel2, 0.5);
|
|
1110
1229
|
ui_rrect(x, ky, bk, kh * 0.62, 3 * ui_s);
|
|
@@ -1112,5 +1231,18 @@ function ui_keyboard(lo, hi, label) local(nw, n, pc, wi, ww, kx, ky, kw, kh, bk,
|
|
|
1112
1231
|
) : wi += 1;
|
|
1113
1232
|
n += 1;
|
|
1114
1233
|
);
|
|
1234
|
+
// play the keys: press = note on (higher up the key = softer), drag across keys = glissando, release = note off
|
|
1235
|
+
hn < 0 ? hn = hw;
|
|
1236
|
+
vel = floor(35 + 92 * min(1, max(0, (mouse_y - ky) / kh)));
|
|
1237
|
+
hn >= 0 && ui_active == 0 && ui_press && !(ui_core && ui_blocked) && !ui_modal ? (
|
|
1238
|
+
ui_active = 64; ui_kheld = hn + 1; ui_kput(hn, vel); ui_kkey(hn, vel); ui_press = 0;
|
|
1239
|
+
);
|
|
1240
|
+
ui_active == 64 && ui_down && hn >= 0 && hn + 1 != ui_kheld ? (
|
|
1241
|
+
ui_kput(ui_kheld - 1, 0); ui_kkey(ui_kheld - 1, 0);
|
|
1242
|
+
ui_kheld = hn + 1; ui_kput(hn, vel); ui_kkey(hn, vel);
|
|
1243
|
+
);
|
|
1244
|
+
ui_active == 64 && !ui_down ? (
|
|
1245
|
+
ui_kput(ui_kheld - 1, 0); ui_kkey(ui_kheld - 1, 0); ui_kheld = 0; ui_active = 0;
|
|
1246
|
+
);
|
|
1115
1247
|
);
|
|
1116
1248
|
);
|