Sitar118 Claude Sonnet 4.6 commited on
Commit
29b4c18
Β·
1 Parent(s): 19d5f13

docs: Sprint 7 task + update paths after folder move to AI MUSIC PRODUCTION

Browse files

- SYNC.md: clean rewrite β€” Sprint 7 task in correct section (CLAUDE CODE β†’ ML INTERN),
removed stale Sprint 5/6 archive content, version stays v0.6.0
- SPRINT-LOG.md: added Sprint 7 entry
- MACHINE-CONTEXT.md: updated build dir path + full cmake/build commands
- CLAUDE.md: updated source path + version to v0.6.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (4) hide show
  1. CLAUDE.md +1 -1
  2. MACHINE-CONTEXT.md +15 -3
  3. SPRINT-LOG.md +7 -0
  4. SYNC.md +176 -293
CLAUDE.md CHANGED
@@ -123,7 +123,7 @@ pluginbridge/
123
  ## Build
124
 
125
  ```bash
126
- cd "/Volumes/T7 Shield/Users/Aditya/pluginbridge/build"
127
  cmake --build . --target PluginBridge_VST3 -- -j4
128
  # Auto-installs to ~/Library/Audio/Plug-Ins/VST3/PluginBridge.vst3
129
  ```
 
123
  ## Build
124
 
125
  ```bash
126
+ cd "/Volumes/T7 Shield/Users/Aditya/Downloads/AI MUSIC PRODUCTION/pluginbridge/build"
127
  cmake --build . --target PluginBridge_VST3 -- -j4
128
  # Auto-installs to ~/Library/Audio/Plug-Ins/VST3/PluginBridge.vst3
129
  ```
MACHINE-CONTEXT.md CHANGED
@@ -29,7 +29,7 @@
29
  | System AU plugins | `/Library/Audio/Plug-Ins/Components/` |
30
  | PluginBridge install | `~/Library/Audio/Plug-Ins/VST3/PluginBridge.vst3` |
31
  | PluginBridge data | `~/Library/PluginBridge/` (safety_db.json, debug.log, blocklist.txt, scan.log) |
32
- | Build dir | `/Volumes/T7 Shield/Users/Aditya/pluginbridge/build/` |
33
  | Ableton log | `~/Library/Preferences/Ableton/Live 12.4/Log.txt` |
34
  | Crash reports | `~/Library/Logs/DiagnosticReports/` |
35
 
@@ -40,9 +40,21 @@ Both `/Library/` and `~/Library/` must be checked to find all installed plugins
40
 
41
  ## CURRENT BUILD STATE (Last updated: 2026-05-17)
42
 
43
- **Last build:** 2026-05-17 ~08:30
44
  **Result:** βœ… Clean β€” `[100%] Built target PluginBridge_VST3`
45
- **Build command:** `cd build && cmake --build . --target PluginBridge_VST3 -- -j4`
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  ---
48
 
 
29
  | System AU plugins | `/Library/Audio/Plug-Ins/Components/` |
30
  | PluginBridge install | `~/Library/Audio/Plug-Ins/VST3/PluginBridge.vst3` |
31
  | PluginBridge data | `~/Library/PluginBridge/` (safety_db.json, debug.log, blocklist.txt, scan.log) |
32
+ | Build dir | `/Volumes/T7 Shield/Users/Aditya/Downloads/AI MUSIC PRODUCTION/pluginbridge/build/` |
33
  | Ableton log | `~/Library/Preferences/Ableton/Live 12.4/Log.txt` |
34
  | Crash reports | `~/Library/Logs/DiagnosticReports/` |
35
 
 
40
 
41
  ## CURRENT BUILD STATE (Last updated: 2026-05-17)
42
 
43
+ **Last build:** 2026-05-17 (after folder move to AI MUSIC PRODUCTION)
44
  **Result:** βœ… Clean β€” `[100%] Built target PluginBridge_VST3`
45
+ **Build command:**
46
+ ```bash
47
+ cd "/Volumes/T7 Shield/Users/Aditya/Downloads/AI MUSIC PRODUCTION/pluginbridge/build"
48
+ cmake --build . --target PluginBridge_VST3 -- -j4
49
+ ```
50
+ **Re-cmake needed after fresh clone:**
51
+ ```bash
52
+ cd "/Volumes/T7 Shield/Users/Aditya/Downloads/AI MUSIC PRODUCTION/pluginbridge/build"
53
+ /opt/homebrew/lib/python3.14/site-packages/cmake/data/bin/cmake .. -G 'Unix Makefiles' \
54
+ -DCMAKE_C_COMPILER=/Library/Developer/CommandLineTools/usr/bin/clang \
55
+ -DCMAKE_CXX_COMPILER=/Library/Developer/CommandLineTools/usr/bin/clang++ \
56
+ -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
57
+ ```
58
 
59
  ---
60
 
SPRINT-LOG.md CHANGED
@@ -16,6 +16,13 @@ Full in-process hosting with safety scan. Ableton-style TreeView picker.
16
  Fixes: deduplication, manufacturer names, background scan conflict, addChildComponent bug.
17
  MCP verified end-to-end. Pro-Q 4 = 737 params via MCP.
18
 
 
 
 
 
 
 
 
19
  ## Sprint 6 βœ… (v0.6.0 β€” Multi-Instance + Channel Selector)
20
  Channel name dropdown in Editor (30 items: Vocals/Drums/Bass/Keys/Synths/Strings/FX/Buses/Custom).
21
  Auto-port via bind_to_any_port β€” each instance gets its own port.
 
16
  Fixes: deduplication, manufacturer names, background scan conflict, addChildComponent bug.
17
  MCP verified end-to-end. Pro-Q 4 = 737 params via MCP.
18
 
19
+ ## Sprint 7 πŸ”„ (v0.7.0 β€” In-Process Param Routing)
20
+ Route MCP set_params/get_params/search_param through inProcessPlugin for SAFE plugins.
21
+ Root cause: after Sprint 5, audio+GUI use in-process instance but MCP still targets Helper's
22
+ hidden instance β†’ EQ changes invisible in Pro-Q 4.
23
+ Fix: three param callbacks on McpServer (same pattern as getAnalysisCallback).
24
+ Also fixes id-vs-index bug: search_param now returns "i" (array index) not VST3 param ID.
25
+
26
  ## Sprint 6 βœ… (v0.6.0 β€” Multi-Instance + Channel Selector)
27
  Channel name dropdown in Editor (30 items: Vocals/Drums/Bass/Keys/Synths/Strings/FX/Buses/Custom).
28
  Auto-port via bind_to_any_port β€” each instance gets its own port.
SYNC.md CHANGED
@@ -6,9 +6,10 @@
6
 
7
  **Version:** v0.6.0
8
  **Build:** βœ… Clean (2026-05-17)
9
- **GUI:** βœ… TreeView picker + in-process createEditor() + live spectrum + channel dropdown βœ…
10
- **MCP:** βœ… Auto-port β€” 6 tools (+ list_instances), registered in Claude Code
11
  **AudioAnalyser:** βœ… LUFS / FFT bands / stereo width / centroid / true peak
 
12
 
13
  ---
14
 
@@ -18,306 +19,186 @@
18
  > Claude Code will test on Mac and answer before you write anything.
19
 
20
  ```
21
- STATUS: TASK READY β€” Sprint 6
 
 
 
22
 
23
- TASK: Channel name dropdown + multi-instance registry + list_instances MCP tool
 
 
 
 
 
 
 
 
24
 
25
  ─────────────────────────────────────────────────────────────
26
- GOAL (producer workflow):
27
- 1. Producer loads PluginBridge on Vocal Bus track
28
- β†’ Selects "Vocal Bus" from dropdown in plugin UI
29
- β†’ Port auto-assigned, invisible to producer
30
- 2. Producer loads PluginBridge on Drum Bus track
31
- β†’ Selects "Drum Bus" from dropdown
32
- 3. Claude: list_instances() β†’ ["Vocal Bus", "Drum Bus"]
 
 
 
 
 
33
  ─────────────────────────────────────────────────────────────
34
 
35
- ── PART 1: Constants.h ──────────────────────────────────────
36
- Add one constant:
37
- static const char* kRegistryPath = "/tmp/pluginbridge-registry.json";
38
-
39
- ── PART 2: New file β€” InstanceRegistry.h (header-only) ──────
40
- No .cpp needed β€” header only. No CMakeLists change needed.
41
- Place at: Source/Plugin/InstanceRegistry.h
42
 
43
- Implement:
44
- namespace InstanceRegistry {
45
- // Write {channelName: port} to registry (atomic: write tmp β†’ rename)
46
- // Read existing file first, update entry, write back
47
- void registerInstance(const std::string& channelName, int port);
48
 
49
- // Remove channelName entry from registry
50
- void unregisterInstance(const std::string& channelName);
51
 
52
- // Read all entries β†’ returns map of {name: port}
53
- std::map<std::string, int> readAll();
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
 
56
- Threading: use write-to-temp + rename for atomic writes (POSIX rename is atomic).
57
- Use nlohmann json (already in libs/). Use std::ofstream / std::ifstream.
58
- Handle missing file gracefully (registerInstance creates it).
59
 
60
- ── PART 3: McpServer.h / McpServer.cpp ─────────────────────
61
- CHANGE constructor:
62
- // Before: McpServer(int port, HelperConnection& helper)
63
- // After: McpServer(HelperConnection& helper) ← no port param
64
- // Port is always auto-assigned via bind_to_any_port
65
-
66
- CHANGE start() β€” use bind_to_any_port (VERIFIED in httplib.h line 1730):
67
- // Instead of: server->listen("127.0.0.1", port)
68
- // Use:
69
- port = server->bind_to_any_port("127.0.0.1"); // OS assigns, returns actual port
70
- server->listen_after_bind(); // blocks, runs server
 
 
 
 
 
 
71
 
72
- ADD channelNameCallback (same pattern as getAnalysisCallback):
73
- std::function<std::string()> channelNameCallback;
74
 
75
- ADD list_instances tool to tools/list response and tools/call dispatch:
76
  {
77
- "name": "list_instances",
78
- "description": "List all PluginBridge instances currently loaded in the DAW. Returns channel names.",
79
- "inputSchema": { "type": "object", "properties": {} }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
81
 
82
- Implementation of list_instances:
83
- auto registry = InstanceRegistry::readAll();
84
- json names = json::array();
85
- for (auto& [name, port] : registry) names.push_back(name);
86
- return names.dump();
87
-
88
- UPDATE get_analysis to prefix channel name:
89
- // Before: "-19.5 LUFS | TP:-17.1 | ..."
90
- // After: "[Vocal Bus] -19.5 LUFS | TP:-17.1 | ..."
91
- std::string channel = channelNameCallback ? channelNameCallback() : "Unknown";
92
- resultText = "[" + channel + "] " + getAnalysisCallback();
93
-
94
- ── PART 4: PluginBridgeProcessor.h / .cpp ──────────────────
95
- ADD member:
96
- juce::String channelName { "Unnamed" };
97
-
98
- ADD public methods:
99
- void setChannelName(const juce::String& name);
100
- juce::String getChannelName() const { return channelName; }
101
-
102
- CHANGE McpServer construction (Constructor):
103
- // Before: mcpServer(std::make_unique<McpServer>(PluginBridgeConstants::kDefaultMcpPort, helper))
104
- // After: mcpServer(std::make_unique<McpServer>(helper))
105
-
106
- AFTER mcpServer->start() β€” register to registry:
107
- InstanceRegistry::registerInstance(channelName.toStdString(), mcpServer->getPort());
108
-
109
- ADD channelNameCallback wiring (next to getAnalysisCallback):
110
- mcpServer->channelNameCallback = [this]() { return channelName.toStdString(); };
111
-
112
- IN setChannelName():
113
- channelName = name;
114
- // Re-register with new name (unregister old, register new)
115
- InstanceRegistry::unregisterInstance(channelName.toStdString());
116
- InstanceRegistry::registerInstance(name.toStdString(), mcpServer->getPort());
117
-
118
- IN Destructor β€” unregister:
119
- InstanceRegistry::unregisterInstance(channelName.toStdString());
120
-
121
- UPDATE getStateInformation β€” save channelName:
122
- state.setProperty("channelName", channelName, nullptr);
123
-
124
- UPDATE setStateInformation β€” restore channelName:
125
- channelName = state.getProperty("channelName", "Unnamed").toString();
126
-
127
- ── PART 5: PluginBridgeEditor.h / .mm ── (AUTHORIZED this sprint)
128
- ADD to PluginBridgeEditor.h:
129
- juce::ComboBox channelDropdown;
130
-
131
- IN PluginBridgeEditor constructor (.mm):
132
- Populate channelDropdown with this EXACT list using addSectionHeading() + addItem():
133
-
134
- ── Vocals ──
135
- Lead Vocal (id:1), Backing Vocal (id:2), Adlibs (id:3)
136
- ── Drums ──
137
- Kick (id:4), Snare (id:5), Hi-Hat (id:6), Overheads (id:7), Percussion (id:8)
138
- ── Bass ──
139
- Bass / 808 (id:9), Bass Guitar (id:10), Sub Bass (id:11), Synth Bass (id:12)
140
- ── Keys & Guitar ──
141
- Piano / Keys (id:13), Acoustic Guitar (id:14), Electric Guitar (id:15)
142
- ── Synths ──
143
- Synth Lead (id:16), Synth Pad / Pluck (id:17)
144
- ── Strings & Brass ──
145
- Strings (id:18), Brass / Woodwind (id:19), Orchestral (id:20)
146
- ── FX ──
147
- Reverb / Delay (id:21), Foley / Ambient (id:22)
148
- ── Buses ──
149
- Vocal Bus (id:23), Drum Bus (id:24), Guitar Bus (id:25), Synth Bus (id:26),
150
- Music Bus (id:27), Instrument Bus (id:28), Master Bus / Mix Bus (id:29)
151
- ── Custom ──
152
- Custom... (id:30)
153
-
154
- channelDropdown.onChange = [this]() {
155
- auto text = channelDropdown.getText();
156
- if (text == "Custom...") {
157
- // Show AlertWindow to enter custom name
158
- juce::AlertWindow::showInputBoxAsync("Channel Name", "Enter channel name:", "",
159
- processorRef.getChannelName(), nullptr,
160
- [this](const juce::String& result) {
161
- if (result.isNotEmpty()) {
162
- channelDropdown.setText(result, juce::dontSendNotification);
163
- processorRef.setChannelName(result);
164
- }
165
- });
166
- } else {
167
- processorRef.setChannelName(text);
168
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  };
170
 
171
- // Set initial value from processor state
172
- channelDropdown.setText(processorRef.getChannelName(), juce::dontSendNotification);
173
-
174
- addAndMakeVisible(channelDropdown);
 
 
 
 
 
 
 
175
 
176
- IN resized():
177
- // Place channelDropdown in the top bar β€” 160px wide, left side
178
- // Existing top bar is the area above the picker/plugin content
179
- // Example (adjust to fit actual layout):
180
- channelDropdown.setBounds(4, 4, 160, 22);
181
 
182
  ── SCOPE ────────────────────────────────────────────────────
183
  TOUCH:
184
- Constants.h
185
- Source/Plugin/InstanceRegistry.h ← NEW (header-only, no CMakeLists needed)
186
- Source/Plugin/McpServer.h / .cpp
187
- Source/Plugin/PluginBridgeProcessor.h / .cpp
188
- Source/Plugin/PluginBridgeEditor.h / .mm ← AUTHORIZED this sprint only
189
 
190
  DO NOT TOUCH:
191
- PluginPickerComponent.mm ← LOCKED
192
- HelperPluginHost.mm ← LOCKED
193
- HelperConnection.cpp ← LOCKED
194
- CMakeLists.txt ← no new .cpp files, no change needed
195
-
196
- ── VERIFIED APIs ────────────────────────────────────────────
197
- httplib bind_to_any_port("127.0.0.1") β†’ returns int port βœ… (libs/httplib.h line 1730)
198
- httplib listen_after_bind() βœ… (libs/httplib.h line 1731)
199
- juce::ComboBox::addSectionHeading(text) βœ…
200
- juce::ComboBox::addItem(text, id) βœ…
201
- juce::AlertWindow::showInputBoxAsync(...) βœ…
202
- nlohmann json already in libs/ βœ…
203
- POSIX rename() for atomic file write βœ…
204
-
205
- STATUS (2026-05-17): Sprint 5 answer β€” prepareToPlay verified safe. See below.
206
- ```
207
-
208
- ANSWER: Use Option B. Here is the exact implementation β€” verified by reading the code.
209
-
210
- --- prepareToPlay() ---
211
-
212
- The iZotope/Neutron crash concern is MOOT. Here is why:
213
- iZotope plugins crash during the safety SCAN β†’ they are marked UNSAFE in the DB
214
- UNSAFE plugins never reach loadInProcessPlugin() β€” they use Helper-only path
215
- loadInProcessPlugin() is ONLY ever called for SAFE plugins
216
- Therefore: calling prepareToPlay() inside loadInProcessPlugin() is safe
217
-
218
- currentSampleRate and currentBlockSize are ALWAYS valid when loadInProcessPlugin()
219
- is called. Ableton calls our prepareToPlay() before audio starts, and users can only
220
- pick a plugin after audio is running. Verified in processor code β€” both are stored
221
- as member variables (currentSampleRate, currentBlockSize).
222
-
223
- ADD these lines in loadInProcessPlugin(), after setBusesLayout() and before addListener():
224
-
225
- if (currentSampleRate > 0 && currentBlockSize > 0)
226
- inProcessPlugin->prepareToPlay(currentSampleRate, currentBlockSize);
227
-
228
- --- processBlock() ---
229
-
230
- I read the current processBlock. The MidiBuffer parameter is unnamed β€” you must name
231
- it to pass to inProcessPlugin. Change the signature too:
232
-
233
- // Before:
234
- void PluginBridgeProcessor::processBlock(juce::AudioBuffer<float>& buffer, juce::MidiBuffer&)
235
-
236
- // After:
237
- void PluginBridgeProcessor::processBlock(juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages)
238
-
239
- Then replace the current early-return guard and shm path with this:
240
-
241
- if (!pluginLoaded) return;
242
-
243
- if (inProcessPlugin != nullptr)
244
- {
245
- // SAFE plugin β€” in-process handles both audio and GUI
246
- inProcessPlugin->processBlock(buffer, midiMessages);
247
- analyser.processBlock(buffer);
248
- return;
249
- }
250
-
251
- // UNSAFE plugin β€” Helper via shm (existing path, unchanged)
252
- if (!helper.isHelperRunning()) return;
253
- auto& shm = helper.getSharedAudio();
254
- if (!shm.isValid()) return;
255
- // ... rest of shm path stays exactly as-is
256
-
257
- NOTE: Keep the Helper spawn for safe plugins β€” still needed for MCP param IPC.
258
- NOTE: Do NOT remove any PBLOG calls.
259
- NOTE: Also update the declaration in PluginBridgeProcessor.h if the signature changes.
260
- ```
261
-
262
- ---
263
-
264
- ## CLAUDE CODE β†’ ML INTERN
265
-
266
- > Read this at the start of every coding session.
267
-
268
- ```
269
- STATUS: TASK READY β€” Sprint 5
270
-
271
- TASK: Route audio through in-process plugin for SAFE plugins (fixes spectrum analyzers)
272
-
273
- PROBLEM (verified on Mac 2026-05-17):
274
- Pro-Q 4 spectrum analyzer shows no signal inside PluginBridge.
275
- Root cause: two separate plugin instances are running β€”
276
- - Helper process instance β†’ handles audio (but has no GUI)
277
- - In-process instance β†’ provides GUI only (but never sees audio)
278
- Pro-Q 4's spectrum belongs to the in-process GUI instance, so it stays empty.
279
- The AudioAnalyser MCP tool confirms audio IS flowing (returned live LUFS/FFT data).
280
-
281
- FIX β€” only touch PluginBridgeProcessor.cpp (and .h if needed):
282
- In processBlock(), check if a safe in-process plugin is loaded.
283
- If yes β†’ call inProcessPlugin->processBlock(buffer, midiMessages) directly.
284
- If no (unsafe, Helper-only) β†’ keep existing shm path unchanged.
285
-
286
- Pseudocode:
287
- if (inProcessPlugin != nullptr)
288
- inProcessPlugin->processBlock(buffer, midiMessages);
289
- else
290
- // existing shm write β†’ Helper β†’ shm readOutput path
291
-
292
- The in-process plugin is already loaded (loadInProcessPlugin runs for SAFE plugins).
293
- You are NOT changing when it loads β€” only adding the audio call in processBlock.
294
-
295
- SCOPE β€” only these files:
296
- TOUCH: PluginBridgeProcessor.cpp (processBlock change, ~5 lines)
297
- PluginBridgeProcessor.h (only if inProcessPlugin member needs exposing)
298
- DO NOT TOUCH:
299
- PluginBridgeEditor.mm ← LOCKED
300
- PluginPickerComponent.mm ← LOCKED
301
- HelperPluginHost.mm ← LOCKED
302
- HelperConnection.cpp ← LOCKED
303
- CMakeLists.txt ← no new files, no changes needed
304
-
305
- VERIFY before pushing:
306
- - Does inProcessPlugin->processBlock() exist in JUCE AudioPluginInstance? YES β€”
307
- it inherits from AudioProcessor which has processBlock(AudioBuffer&, MidiBuffer&)
308
- - Helper still runs for safe plugins (needed for MCP param read/write via Helper IPC)
309
- Do NOT remove the Helper spawn or shm path β€” just skip the shm audio write when
310
- in-process plugin is available.
311
- - Do NOT remove PBLOG calls.
312
-
313
- EXPECTED RESULT after fix:
314
- Pro-Q 4 spectrum analyzer shows live audio. EQ curve interactive.
315
- get_analysis MCP tool still works (AudioAnalyser runs on same buffer).
316
-
317
- Last (2026-05-17): Sprint 4 regression fixed. PluginBridgeEditor.mm was reverted
318
- to CALayerHost (FAILED-APPROACHES #10 β€” never works in Ableton). Restored from
319
- stash. FFT fixed (was allocating on audio thread). PluginPickerComponent.mm was
320
- missing from CMakeLists.txt β€” added. All working now.
321
  ```
322
 
323
  ---
@@ -325,21 +206,23 @@ missing from CMakeLists.txt β€” added. All working now.
325
  ## NEXT PUSH β€” ML Intern fills before every push
326
 
327
  ```
328
- STATUS: READY TO CODE β€” prepareToPlay question answered above
329
 
330
- TASK: Sprint 5 β€” route audio through in-process plugin
331
  FILES CHANGING:
332
- - PluginBridgeProcessor.cpp (processBlock + loadInProcessPlugin)
333
- FILES NOT TOUCHING (confirm locked files are safe):
334
- - PluginBridgeEditor.mm βœ… not touching
335
- - PluginPickerComponent.mm βœ… not touching
336
- - HelperPluginHost.mm βœ… not touching
337
- - HelperConnection.cpp βœ… not touching
338
- NEW FILES (Claude Code must add to CMakeLists.txt):
339
- - none
 
340
  APIS USED (verified by Claude Code? y/n):
341
- - inProcessPlugin->processBlock() β€” y (inherits from AudioProcessor)
342
- - inProcessPlugin->prepareToPlay() β€” NEEDS VERIFICATION (safe for Pro-Q 4?)
 
343
  ```
344
 
345
  ---
@@ -347,9 +230,9 @@ APIS USED (verified by Claude Code? y/n):
347
  ## LAST BUILD RESULT β€” Claude Code fills after pull+build
348
 
349
  ```
350
- Date: 2026-05-17 ~20:00
351
  Commits pulled: 225322d (backend), 6b15202 (channel dropdown)
352
- Build: βœ… Clean
353
- Tests: channel dropdown βœ… (builds) list_instances βœ… (pending Ableton reload test)
354
- Issues: none
355
  ```
 
6
 
7
  **Version:** v0.6.0
8
  **Build:** βœ… Clean (2026-05-17)
9
+ **GUI:** βœ… TreeView picker + in-process createEditor() + live spectrum + channel dropdown
10
+ **MCP:** βœ… 6 tools β€” list_plugins, list_instances, search_param, get_params, set_params, get_analysis
11
  **AudioAnalyser:** βœ… LUFS / FFT bands / stereo width / centroid / true peak
12
+ **⚠️ KNOWN BUG:** set_params/get_params/search_param target Helper's plugin instance, NOT the in-process GUI instance β†’ EQ changes invisible in Pro-Q 4. Sprint 7 fixes this.
13
 
14
  ---
15
 
 
19
  > Claude Code will test on Mac and answer before you write anything.
20
 
21
  ```
22
+ (no pending questions)
23
+ ```
24
+
25
+ ---
26
 
27
+ ## CLAUDE CODE β†’ ML INTERN
28
+
29
+ > Read this at the start of every coding session.
30
+
31
+ ```
32
+ STATUS: TASK READY β€” Sprint 7
33
+
34
+ TASK: Route MCP param ops through in-process plugin for SAFE plugins
35
+ (fix: EQ changes via MCP must appear in Pro-Q 4 / plugin GUI)
36
 
37
  ─────────────────────────────────────────────────────────────
38
+ ROOT CAUSE:
39
+ After Sprint 5, audio routes through inProcessPlugin.
40
+ But search_param / get_params / set_params still use
41
+ HelperConnection IPC β†’ Helper process β†’ Helper's plugin instance.
42
+ That instance has no GUI β€” Pro-Q 4 GUI shows inProcessPlugin's state.
43
+ Result: EQ changes are applied silently to a hidden instance nobody sees.
44
+
45
+ FIX ARCHITECTURE:
46
+ Add three param callbacks to McpServer (same pattern as
47
+ getAnalysisCallback and channelNameCallback already in McpServer.h).
48
+ Processor wires them to inProcessPlugin when SAFE plugin is loaded.
49
+ McpServer uses callbacks when set; falls back to Helper IPC when null.
50
  ─────────────────────────────────────────────────────────────
51
 
52
+ ── PART 1: McpServer.h ──────────────────────────────────────
53
+ ADD three new callbacks (next to existing getAnalysisCallback):
 
 
 
 
 
54
 
55
+ // Param callbacks β€” wired to inProcessPlugin when SAFE, null when UNSAFE
56
+ std::function<std::string(const std::string& keyword)> searchParamCallback;
57
+ std::function<std::string(const std::vector<int>& ids)> getParamsCallback;
58
+ std::function<bool(const std::map<int,float>& values)> setParamsCallback;
 
59
 
60
+ ── PART 2: McpServer.cpp β€” handleToolsCall() ────────────────
61
+ CHANGE search_param handler (in-process first, Helper fallback):
62
 
63
+ else if (toolName == "search_param")
64
+ {
65
+ if (searchParamCallback)
66
+ {
67
+ resultText = searchParamCallback(args.value("keyword",""));
68
+ }
69
+ else
70
+ {
71
+ json cmd = {{"cmd","search_param"},{"keyword",args.value("keyword","")}};
72
+ auto resp = helper.sendCommand(cmd.dump());
73
+ try { auto j = json::parse(resp); resultText = j.value("ok",false) ? j["results"].dump() : "search failed"; }
74
+ catch (...) { resultText = "parse error"; isError = true; }
75
+ }
76
  }
77
 
78
+ CHANGE get_params handler similarly:
 
 
79
 
80
+ else if (toolName == "get_params")
81
+ {
82
+ if (getParamsCallback)
83
+ {
84
+ auto idsJson = args.value("ids", json::array());
85
+ std::vector<int> ids;
86
+ for (auto& v : idsJson) ids.push_back(v.get<int>());
87
+ resultText = getParamsCallback(ids);
88
+ }
89
+ else
90
+ {
91
+ json cmd = {{"cmd","get_params"},{"ids",args.value("ids",json::array())}};
92
+ auto resp = helper.sendCommand(cmd.dump());
93
+ try { auto j = json::parse(resp); resultText = j.value("ok",false) ? j["values"].dump() : "get failed"; }
94
+ catch (...) { resultText = "parse error"; isError = true; }
95
+ }
96
+ }
97
 
98
+ CHANGE set_params handler similarly:
 
99
 
100
+ else if (toolName == "set_params")
101
  {
102
+ if (setParamsCallback)
103
+ {
104
+ auto valuesJson = args.value("values", json::object());
105
+ std::map<int,float> values;
106
+ for (auto& [k,v] : valuesJson.items())
107
+ values[std::stoi(k)] = v.get<float>();
108
+ bool ok = setParamsCallback(values);
109
+ resultText = ok ? "ok" : "set failed";
110
+ if (!ok) isError = true;
111
+ }
112
+ else
113
+ {
114
+ json cmd = {{"cmd","set_params"},{"values",args.value("values",json::object())}};
115
+ auto resp = helper.sendCommand(cmd.dump());
116
+ try { auto j = json::parse(resp); resultText = j.value("ok",false) ? "ok" : "set failed"; }
117
+ catch (...) { resultText = "parse error"; isError = true; }
118
+ }
119
  }
120
 
121
+ ALSO update search_param tool description in handleToolsList():
122
+ // Before: "Search params by keyword"
123
+ // After: "Search params by keyword. Returns index 'i' and current value. Use 'i' as key for set_params/get_params."
124
+
125
+ ── PART 3: PluginBridgeProcessor.cpp β€” wire callbacks ──────
126
+ Call wireInProcessParamCallbacks() from loadInProcessPlugin() AFTER
127
+ inProcessPlugin is ready. Call clearInProcessParamCallbacks() from
128
+ unloadInProcessPlugin() BEFORE inProcessPlugin is cleared.
129
+
130
+ Wire searchParamCallback:
131
+ mcpServer->searchParamCallback = [this](const std::string& keyword) -> std::string {
132
+ auto& params = inProcessPlugin->getParameters();
133
+ json results = json::array();
134
+ std::string kw = keyword;
135
+ std::transform(kw.begin(), kw.end(), kw.begin(), ::tolower);
136
+ for (int i = 0; i < params.size(); ++i)
137
+ {
138
+ std::string name = params[i]->getName(128).toStdString();
139
+ std::string nameLow = name;
140
+ std::transform(nameLow.begin(), nameLow.end(), nameLow.begin(), ::tolower);
141
+ if (nameLow.find(kw) != std::string::npos)
142
+ results.push_back({{"i", i}, {"name", name}, {"value", params[i]->getValue()}});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  }
144
+ return results.dump();
145
+ };
146
+ // NOTE: "i" = array index. Use this as key for set_params/get_params.
147
+ // This also fixes the id-vs-index bug from Sprint 6.
148
+
149
+ Wire getParamsCallback:
150
+ mcpServer->getParamsCallback = [this](const std::vector<int>& ids) -> std::string {
151
+ auto& params = inProcessPlugin->getParameters();
152
+ json values = json::object();
153
+ for (int idx : ids)
154
+ if (idx >= 0 && idx < params.size())
155
+ values[std::to_string(idx)] = params[idx]->getValue();
156
+ return values.dump();
157
  };
158
 
159
+ Wire setParamsCallback:
160
+ mcpServer->setParamsCallback = [this](const std::map<int,float>& values) -> bool {
161
+ juce::MessageManager::callAsync([this, values]() {
162
+ auto& p = inProcessPlugin->getParameters();
163
+ for (auto& [idx, val] : values)
164
+ if (idx >= 0 && idx < p.size())
165
+ p[idx]->setValueNotifyingHost(val);
166
+ });
167
+ return true;
168
+ };
169
+ // setValueNotifyingHost β†’ notifies plugin GUI, changes appear in Pro-Q 4 instantly.
170
 
171
+ Clear in clearInProcessParamCallbacks():
172
+ mcpServer->searchParamCallback = nullptr;
173
+ mcpServer->getParamsCallback = nullptr;
174
+ mcpServer->setParamsCallback = nullptr;
 
175
 
176
  ── SCOPE ────────────────────────────────────────────────────
177
  TOUCH:
178
+ Source/Plugin/McpServer.h ← add 3 callbacks
179
+ Source/Plugin/McpServer.cpp ← use callbacks in handleToolsCall(), update description
180
+ Source/Plugin/PluginBridgeProcessor.cpp ← wire/clear callbacks
 
 
181
 
182
  DO NOT TOUCH:
183
+ PluginBridgeEditor.mm ← LOCKED
184
+ PluginPickerComponent.mm ← LOCKED
185
+ HelperPluginHost.mm ← LOCKED
186
+ HelperConnection.cpp ← LOCKED
187
+ CMakeLists.txt ← no new files
188
+
189
+ ── VERIFIED APIs (Claude Code β€” 2026-05-17) ─────────────────
190
+ inProcessPlugin->getParameters() β†’ juce::Array<AudioProcessorParameter*> βœ…
191
+ params[i]->getName(128).toStdString() β†’ parameter name string βœ…
192
+ params[i]->getValue() β†’ float 0.0–1.0 βœ…
193
+ params[i]->setValueNotifyingHost(float) β†’ sets value + notifies GUI βœ…
194
+ juce::MessageManager::callAsync(lambda) β†’ dispatch to message thread βœ…
195
+ getInProcessPlugin() on Processor β†’ already public (PluginBridgeProcessor.h line 64) βœ…
196
+
197
+ ── EXPECTED RESULT ──────────────────────────────────────────
198
+ search_param "freq" β†’ returns in-process Pro-Q 4 params with index "i"
199
+ set_params {"26": 0.748} β†’ Band 2 moves to ~4kHz in Pro-Q 4 GUI immediately
200
+ get_params [26] β†’ returns current value from in-process instance
201
+ UNSAFE plugins: callbacks null β†’ falls back to Helper IPC (unchanged)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  ```
203
 
204
  ---
 
206
  ## NEXT PUSH β€” ML Intern fills before every push
207
 
208
  ```
209
+ STATUS: READY TO CODE β€” Sprint 7
210
 
211
+ TASK: Route MCP param ops through in-process plugin (fix EQ-invisible-in-GUI bug)
212
  FILES CHANGING:
213
+ - Source/Plugin/McpServer.h
214
+ - Source/Plugin/McpServer.cpp
215
+ - Source/Plugin/PluginBridgeProcessor.cpp
216
+ FILES NOT TOUCHING:
217
+ - PluginBridgeEditor.mm βœ…
218
+ - PluginPickerComponent.mm βœ…
219
+ - HelperPluginHost.mm βœ…
220
+ - HelperConnection.cpp βœ…
221
+ NEW FILES: none
222
  APIS USED (verified by Claude Code? y/n):
223
+ - inProcessPlugin->getParameters() β€” y
224
+ - params[i]->setValueNotifyingHost(v) β€” y
225
+ - juce::MessageManager::callAsync() β€” y
226
  ```
227
 
228
  ---
 
230
  ## LAST BUILD RESULT β€” Claude Code fills after pull+build
231
 
232
  ```
233
+ Date: 2026-05-17 (after folder move to AI MUSIC PRODUCTION)
234
  Commits pulled: 225322d (backend), 6b15202 (channel dropdown)
235
+ Build: βœ… Clean β€” [100%] Built target PluginBridge_VST3
236
+ Tests: channel dropdown βœ… list_instances βœ… port 16620 first-instance βœ…
237
+ Issues: Sprint 7 pending β€” EQ changes not visible in Pro-Q 4 GUI
238
  ```