@mthines/reaper-mcp 0.83.0-beta.118.1 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -44
- package/bridge-ui/mcp_bridge.html +4 -4
- package/claude/skills/make-plugin/SKILL.md +17 -1
- package/claude/skills/make-plugin/examples/drum-pads.jsfx +89 -0
- package/claude/skills/make-plugin/examples/drum-pads.presets.json +6 -0
- package/claude/skills/make-plugin/examples/pad-midi.jsfx +84 -0
- package/claude/skills/make-plugin/examples/pad-midi.presets.json +6 -0
- package/claude/skills/make-plugin/examples/step-sequencer.jsfx +169 -0
- package/claude/skills/make-plugin/examples/step-sequencer.presets.json +47 -0
- package/claude/skills/make-plugin/reference/midi-editor-mouse.md +76 -0
- package/claude/skills/make-plugin/reference/toolkit.md +10 -2
- package/main.js +69 -6
- package/package.json +1 -1
- package/reaper/mcp_ui.jsfx-inc +839 -34
package/main.js
CHANGED
|
@@ -9034,7 +9034,49 @@ var UI_API = {
|
|
|
9034
9034
|
ui_bandknob: 4,
|
|
9035
9035
|
ui_fband: 3,
|
|
9036
9036
|
ui_kput: 2,
|
|
9037
|
-
ui_kpoll: 0
|
|
9037
|
+
ui_kpoll: 0,
|
|
9038
|
+
ui_padon: 2,
|
|
9039
|
+
ui_padoff: 1,
|
|
9040
|
+
ui_padkey: 1,
|
|
9041
|
+
ui_pads: 4,
|
|
9042
|
+
ui_notename: 1,
|
|
9043
|
+
ui_padmap: 4,
|
|
9044
|
+
ui_sqkey: 1,
|
|
9045
|
+
ui_sqlen: 1,
|
|
9046
|
+
ui_sqfeel: 1,
|
|
9047
|
+
ui_sqname: 1,
|
|
9048
|
+
ui_sqlane: 1,
|
|
9049
|
+
ui_sqclear: 3,
|
|
9050
|
+
ui_sqat: 2,
|
|
9051
|
+
ui_sqadd: 4,
|
|
9052
|
+
ui_sqdel: 2,
|
|
9053
|
+
ui_sqfind: 3,
|
|
9054
|
+
ui_sqnear: 2,
|
|
9055
|
+
ui_sqsnap: 2,
|
|
9056
|
+
ui_sqcell: 2,
|
|
9057
|
+
ui_help: 2,
|
|
9058
|
+
ui_tipdraw: 0,
|
|
9059
|
+
ui_sqlsel: 1,
|
|
9060
|
+
ui_squbase: 2,
|
|
9061
|
+
ui_sqpush: 0,
|
|
9062
|
+
ui_sqpush1: 0,
|
|
9063
|
+
ui_squndo: 0,
|
|
9064
|
+
ui_sqredo: 0,
|
|
9065
|
+
ui_sqvorg: 0,
|
|
9066
|
+
ui_sqvel: 1,
|
|
9067
|
+
ui_sqsetlen: 1,
|
|
9068
|
+
ui_sqadj: 5,
|
|
9069
|
+
ui_sqlanes: 1,
|
|
9070
|
+
ui_sqchip: 6,
|
|
9071
|
+
ui_sqcol: 1,
|
|
9072
|
+
ui_seq: 4,
|
|
9073
|
+
ui_sqdesel: 0,
|
|
9074
|
+
ui_sqselall: 0,
|
|
9075
|
+
ui_sqdelsel: 0,
|
|
9076
|
+
ui_sqorg: 0,
|
|
9077
|
+
ui_sqshift: 1,
|
|
9078
|
+
ui_sqmarq: 5,
|
|
9079
|
+
ui_sqcount: 0
|
|
9038
9080
|
};
|
|
9039
9081
|
var MAX_CORE_WIDGETS = 5;
|
|
9040
9082
|
var MAX_ADVANCED_WIDGETS = 8;
|
|
@@ -9057,6 +9099,21 @@ function wrongMinMaxCalls(code) {
|
|
|
9057
9099
|
}
|
|
9058
9100
|
return out2;
|
|
9059
9101
|
}
|
|
9102
|
+
function whileWithoutBody(source) {
|
|
9103
|
+
const code = source.replace(/"[^"\n]*"/g, (s) => " ".repeat(s.length));
|
|
9104
|
+
const out2 = [];
|
|
9105
|
+
for (const m of code.matchAll(/\bwhile\s*\(/g)) {
|
|
9106
|
+
let depth = 1;
|
|
9107
|
+
let i = (m.index ?? 0) + m[0].length;
|
|
9108
|
+
for (; i < code.length && depth > 0; i++) {
|
|
9109
|
+
if (code[i] === "(") depth++;
|
|
9110
|
+
else if (code[i] === ")") depth--;
|
|
9111
|
+
}
|
|
9112
|
+
const next = code.slice(i).match(/\S/)?.[0];
|
|
9113
|
+
if (next !== void 0 && next !== "(" && next !== ";" && next !== ")") out2.push(m.index ?? 0);
|
|
9114
|
+
}
|
|
9115
|
+
return out2;
|
|
9116
|
+
}
|
|
9060
9117
|
function sections2(code) {
|
|
9061
9118
|
const out2 = /* @__PURE__ */ new Map();
|
|
9062
9119
|
let name = "header";
|
|
@@ -9076,12 +9133,13 @@ function sections2(code) {
|
|
|
9076
9133
|
}
|
|
9077
9134
|
var WIDGET = /\bui_(knob|toggle|choice|fhandle)\s*\(\s*(\d+)/g;
|
|
9078
9135
|
var BANDKNOB = /\bui_bandknob\s*\(\s*(\d+)\s*,\s*(\d+)/g;
|
|
9136
|
+
var PADMAP = /\bui_padmap\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/g;
|
|
9079
9137
|
var FBAND = /\bui_fband\s*\(\s*(\d+)\s*,\s*(\d+)/g;
|
|
9080
9138
|
var FTHRESH = /\bui_fthresh\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/g;
|
|
9081
9139
|
var HEADER = /\bui_header\s*\(\s*(\d+)\s*,\s*(\d+)/g;
|
|
9082
9140
|
var TRANSFER = /\bui_transfer\s*\(\s*(\d+)\s*,\s*(\d+)/g;
|
|
9083
|
-
var COUNTED = /\bui_(knob|toggle|choice|meter|freqgraph|grmeter|transfer|keyboard|bandknob)\s*\(/g;
|
|
9084
|
-
var GRAPHS = /\bui_(freqgraph|grmeter|transfer|keyboard)\s*\(/g;
|
|
9141
|
+
var COUNTED = /\bui_(knob|toggle|choice|meter|freqgraph|grmeter|transfer|keyboard|pads|padmap|seq|bandknob)\s*\(/g;
|
|
9142
|
+
var GRAPHS = /\bui_(freqgraph|grmeter|transfer|keyboard|pads|seq)\s*\(/g;
|
|
9085
9143
|
var countWidgets = (t) => [...t.matchAll(COUNTED)].length;
|
|
9086
9144
|
function uiCalls(code) {
|
|
9087
9145
|
const out2 = [];
|
|
@@ -9147,9 +9205,9 @@ function lintJsfx(source) {
|
|
|
9147
9205
|
if (!/\bui_begin\s*\(/.test(gfx.text)) add2("no-ui-begin", "error", "@gfx must call ui_begin(core_rows, adv_rows) and draw inside it.", gfx.line);
|
|
9148
9206
|
const at = gfx.text.search(/\bui_section\s*\(/);
|
|
9149
9207
|
const core2 = at === -1 ? gfx.text : gfx.text.slice(0, at);
|
|
9150
|
-
const
|
|
9208
|
+
const adv2 = at === -1 ? "" : gfx.text.slice(at);
|
|
9151
9209
|
if (countWidgets(core2) > MAX_CORE_WIDGETS) add2("core-overflow", "error", `${countWidgets(core2)} widgets before the first ui_section (max ${MAX_CORE_WIDGETS}): keep the core view to what is changed in most uses and move the rest behind ui_section("Advanced").`, gfx.line);
|
|
9152
|
-
if (countWidgets(
|
|
9210
|
+
if (countWidgets(adv2) > MAX_ADVANCED_WIDGETS) add2("advanced-overflow", "warning", `${countWidgets(adv2)} advanced widgets (max ${MAX_ADVANCED_WIDGETS}): does every one earn its place?`, gfx.line);
|
|
9153
9211
|
const byIndex = new Map(sliders.map((s) => [s.index, s]));
|
|
9154
9212
|
const used = /* @__PURE__ */ new Set();
|
|
9155
9213
|
for (const m of gfx.text.matchAll(WIDGET)) {
|
|
@@ -9166,6 +9224,7 @@ function lintJsfx(source) {
|
|
|
9166
9224
|
const ranges = [];
|
|
9167
9225
|
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]);
|
|
9168
9226
|
for (const m of gfx.text.matchAll(BANDKNOB)) ranges.push(["ui_bandknob", Number(m[1]), Number(m[2])]);
|
|
9227
|
+
for (const m of gfx.text.matchAll(PADMAP)) ranges.push(["ui_padmap", Number(m[1]), Math.min(16, Number(m[2]) * Number(m[3]))]);
|
|
9169
9228
|
for (const m of gfx.text.matchAll(FBAND)) ranges.push(["ui_fband", Number(m[1]), Number(m[2])]);
|
|
9170
9229
|
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])]);
|
|
9171
9230
|
for (const [fn, first, count] of ranges) {
|
|
@@ -9185,7 +9244,8 @@ function lintJsfx(source) {
|
|
|
9185
9244
|
}
|
|
9186
9245
|
const ser = secs.get("serialize");
|
|
9187
9246
|
if (ser && !/\bfile_var\s*\(\s*0\s*,\s*ui_adv_open\s*\)/.test(ser.text)) add2("no-serialize", "error", "The @serialize section must start with file_var(0, ui_adv_open); so the Advanced section keeps its state.", ser.line);
|
|
9188
|
-
|
|
9247
|
+
const adv = code.replace(/file_avail\s*\(\s*0\s*\)\s*>=\s*0\s*\?\s*ui_adv_open\s*=\s*0/g, (x) => " ".repeat(x.length));
|
|
9248
|
+
for (const m of adv.matchAll(/\bui_adv_open\s*=(?!=)/g)) {
|
|
9189
9249
|
add2("ui-state-reset", "warning", "The plugin assigns ui_adv_open: REAPER re-runs @init (and this code) when playback starts, so the Advanced drawer would snap shut on Play. Leave it to the toolkit; @serialize restores it with file_var(0, ui_adv_open).", lineOf(m.index ?? 0));
|
|
9190
9250
|
}
|
|
9191
9251
|
for (const m of code.matchAll(/\bui_cAccent\s*=(?!=)|\bui_theme\s*\(/g)) {
|
|
@@ -9203,6 +9263,9 @@ function lintJsfx(source) {
|
|
|
9203
9263
|
add2("ui-arity", "error", `${c.name}() takes ${expected} argument${expected === 1 ? "" : "s"}, this call has ${c.args}: EEL2 would drop the whole plugin or read the wrong values.`, lineOf(c.at));
|
|
9204
9264
|
}
|
|
9205
9265
|
}
|
|
9266
|
+
for (const at of whileWithoutBody(code)) {
|
|
9267
|
+
add2("while-no-body", "error", "while (condition) needs its body in parentheses: while (cond) ( statement; ); with a bare statement after it the section silently did nothing when tried in REAPER.", lineOf(at));
|
|
9268
|
+
}
|
|
9206
9269
|
for (const c of wrongMinMaxCalls(code)) {
|
|
9207
9270
|
add2("two-arg-minmax", "error", `max/min take exactly two arguments, this call has ${c.count}: REAPER would fail to compile the whole plugin and pass the audio through. Nest them: max(max(a, b), c).`, lineOf(c.at));
|
|
9208
9271
|
}
|
package/package.json
CHANGED