flmcp-studio 0.4.0__tar.gz

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.
Files changed (67) hide show
  1. flmcp_studio-0.4.0/.gitignore +79 -0
  2. flmcp_studio-0.4.0/CHANGELOG.md +320 -0
  3. flmcp_studio-0.4.0/LICENSE +21 -0
  4. flmcp_studio-0.4.0/PKG-INFO +341 -0
  5. flmcp_studio-0.4.0/README.md +288 -0
  6. flmcp_studio-0.4.0/docs/ARCHITECTURE.md +145 -0
  7. flmcp_studio-0.4.0/docs/FL_API_2026.md +95 -0
  8. flmcp_studio-0.4.0/docs/LIMITATIONS.md +190 -0
  9. flmcp_studio-0.4.0/docs/TOOLS.md +272 -0
  10. flmcp_studio-0.4.0/fl_bridge/device_FLStudioMCP.py +2236 -0
  11. flmcp_studio-0.4.0/fl_bridge/piano_roll/ComposeWithLLM.pyscript +222 -0
  12. flmcp_studio-0.4.0/mcpb/.mcpbignore +10 -0
  13. flmcp_studio-0.4.0/mcpb/icon.png +0 -0
  14. flmcp_studio-0.4.0/mcpb/manifest.json +76 -0
  15. flmcp_studio-0.4.0/mcpb/pyproject.toml +6 -0
  16. flmcp_studio-0.4.0/mcpb/src/server.py +7 -0
  17. flmcp_studio-0.4.0/pyproject.toml +110 -0
  18. flmcp_studio-0.4.0/server.json +47 -0
  19. flmcp_studio-0.4.0/src/fl_studio_mcp/__init__.py +2 -0
  20. flmcp_studio-0.4.0/src/fl_studio_mcp/__main__.py +6 -0
  21. flmcp_studio-0.4.0/src/fl_studio_mcp/audio_analysis.py +220 -0
  22. flmcp_studio-0.4.0/src/fl_studio_mcp/bridge_client.py +373 -0
  23. flmcp_studio-0.4.0/src/fl_studio_mcp/cli.py +588 -0
  24. flmcp_studio-0.4.0/src/fl_studio_mcp/file_bridge.py +172 -0
  25. flmcp_studio-0.4.0/src/fl_studio_mcp/fl_windows.py +311 -0
  26. flmcp_studio-0.4.0/src/fl_studio_mcp/gui_voice.py +472 -0
  27. flmcp_studio-0.4.0/src/fl_studio_mcp/keystroke.py +127 -0
  28. flmcp_studio-0.4.0/src/fl_studio_mcp/midi_wake.py +73 -0
  29. flmcp_studio-0.4.0/src/fl_studio_mcp/paths.py +32 -0
  30. flmcp_studio-0.4.0/src/fl_studio_mcp/prompts.py +136 -0
  31. flmcp_studio-0.4.0/src/fl_studio_mcp/protocol.py +32 -0
  32. flmcp_studio-0.4.0/src/fl_studio_mcp/resources/__init__.py +1 -0
  33. flmcp_studio-0.4.0/src/fl_studio_mcp/resources/project.py +81 -0
  34. flmcp_studio-0.4.0/src/fl_studio_mcp/server.py +81 -0
  35. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/__init__.py +5 -0
  36. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/_meta.py +67 -0
  37. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/_toolsets.py +117 -0
  38. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/arrangement.py +35 -0
  39. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/audio.py +323 -0
  40. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/automation.py +67 -0
  41. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/channels.py +127 -0
  42. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/generators.py +422 -0
  43. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/meta.py +132 -0
  44. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/mixer.py +101 -0
  45. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/patterns.py +111 -0
  46. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/piano_roll.py +195 -0
  47. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/playlist.py +83 -0
  48. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/plugins.py +93 -0
  49. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/project.py +67 -0
  50. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/transport.py +103 -0
  51. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/ui.py +55 -0
  52. flmcp_studio-0.4.0/src/fl_studio_mcp/tools/voice.py +314 -0
  53. flmcp_studio-0.4.0/src/fl_studio_mcp/voice_to_midi.py +559 -0
  54. flmcp_studio-0.4.0/tests/test_audio_analysis.py +49 -0
  55. flmcp_studio-0.4.0/tests/test_audio_dnb.py +47 -0
  56. flmcp_studio-0.4.0/tests/test_bridge_handlers.py +443 -0
  57. flmcp_studio-0.4.0/tests/test_bridge_helpers.py +92 -0
  58. flmcp_studio-0.4.0/tests/test_cli.py +171 -0
  59. flmcp_studio-0.4.0/tests/test_file_bridge.py +83 -0
  60. flmcp_studio-0.4.0/tests/test_fl_windows.py +147 -0
  61. flmcp_studio-0.4.0/tests/test_generators.py +64 -0
  62. flmcp_studio-0.4.0/tests/test_lazy_imports.py +39 -0
  63. flmcp_studio-0.4.0/tests/test_polyphonic.py +143 -0
  64. flmcp_studio-0.4.0/tests/test_protocol.py +515 -0
  65. flmcp_studio-0.4.0/tests/test_release_metadata.py +32 -0
  66. flmcp_studio-0.4.0/tests/test_server_build.py +300 -0
  67. flmcp_studio-0.4.0/tests/test_voice_to_midi.py +109 -0
@@ -0,0 +1,79 @@
1
+ # --- Python ---------------------------------------------------------------
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ *.egg
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+ wheels/
11
+ .eggs/
12
+ *.manifest
13
+ *.spec
14
+
15
+ # --- Virtual envs ---------------------------------------------------------
16
+ .venv/
17
+ venv/
18
+ env/
19
+ ENV/
20
+
21
+ # --- Testing / coverage ---------------------------------------------------
22
+ .pytest_cache/
23
+ .tox/
24
+ .nox/
25
+ .coverage
26
+ .coverage.*
27
+ coverage.xml
28
+ htmlcov/
29
+ .cache
30
+
31
+ # --- Type checkers / linters ---------------------------------------------
32
+ .mypy_cache/
33
+ .pyre/
34
+ .pytype/
35
+ .ruff_cache/
36
+
37
+ # --- Editors / IDEs -------------------------------------------------------
38
+ .vscode/
39
+ .idea/
40
+ *.swp
41
+ *.swo
42
+ *~
43
+
44
+ # --- OS artifacts ---------------------------------------------------------
45
+ .DS_Store
46
+ Thumbs.db
47
+ Desktop.ini
48
+
49
+ # --- Local agent / tool config (may contain absolute paths) --------------
50
+ .claude/
51
+ .cursor/
52
+ .codeium/
53
+ .aider*
54
+
55
+ # --- Runtime artifacts produced by the bridge ----------------------------
56
+ # JSON request/state files that the piano-roll pyscript exchanges with the
57
+ # FL side — they're regenerated on every tool call and are user-specific.
58
+ fLMCP_request.json
59
+ fLMCP_state.json
60
+
61
+ # --- Audio capture scratch -----------------------------------------------
62
+ # Mic recordings go to the system temp dir by default, but keep the repo
63
+ # clean if anything lands here.
64
+ *.wav
65
+ *.flac
66
+ *.mp3
67
+ *.ogg
68
+ !tests/**/fixtures/*.wav
69
+
70
+ # --- Bridge transport files (when FLMCP_BRIDGE_DIR points inside the repo) -
71
+ mcp_command.json
72
+ mcp_response.json
73
+ mcp_heartbeat.json
74
+ mcp_command.lock
75
+ mcp_command.*.tmp
76
+ fLMCP_log.txt
77
+
78
+ # --- Claude Desktop bundles (built by `npx @anthropic-ai/mcpb pack mcpb`) --
79
+ *.mcpb
@@ -0,0 +1,320 @@
1
+ # Changelog
2
+
3
+ All notable changes to fLMCP are documented here. This project adheres to
4
+ [Semantic Versioning](https://semver.org/).
5
+
6
+ ## [Unreleased]
7
+
8
+ ## [0.4.0] — 2026-11-22
9
+
10
+ Works on FL Studio 2025 and 2026 again, on MCP SDK 2.x, and installs with one
11
+ command.
12
+
13
+ ### Breaking
14
+
15
+ - **The PyPI distribution is now `flmcp-studio`.** `fl-studio-mcp` on PyPI belongs
16
+ to a different project, and PyPI rejects `flmcp` as too similar to `f1-mcp`.
17
+ Install with `uvx flmcp-studio install`. The command is `flmcp` (plus a
18
+ `flmcp-studio` alias for uvx). The import package (`fl_studio_mcp`) and the
19
+ legacy `fl-studio-mcp` command stay. The MCP client entry is renamed to
20
+ `flmcp`, and `flmcp install` removes the old `fl-studio-mcp` entries.
21
+ - **The TCP bridge is gone.** FL Studio 2025/2026 run controller scripts in a
22
+ sandboxed sub-interpreter without threads or sockets (#1). The bridge now
23
+ uses a file transport (protocol 2). Re-run `flmcp install` so FL gets the new
24
+ `device_FLStudioMCP.py`.
25
+ - **Requires `mcp>=2.3,<3`.** The server moved from the removed
26
+ `mcp.server.fastmcp` to `mcp.server.mcpserver` (#3).
27
+
28
+ ### Added
29
+
30
+ - **Claude Desktop bundle (`mcpb/`).** `npx @anthropic-ai/mcpb pack mcpb`
31
+ builds `flmcp-<version>.mcpb`, a one-click install for Claude Desktop that
32
+ runs the PyPI package with uv and exposes the tool groups and the timeout as
33
+ extension settings. CI validates and packs it on every push.
34
+ - **File + MIDI-wake transport (protocol 2).** Atomic command and response
35
+ files, a once-a-second heartbeat with bridge/FL/API versions, a
36
+ cross-process lock, `time_ns` ids that survive clock rollback, stale-command
37
+ suppression on FL start, batched actions, and fail-fast "bridge unavailable"
38
+ when FL isn't listening. An optional CC 119 / ch 16 wake through a loopMIDI
39
+ port named `fLMCP` brings round-trips down to tens of milliseconds.
40
+ Thanks to @cgradusov (#2) and @marcostolosa (#4, #5), whose PRs first proved
41
+ a file-based transport inside FL 2025's sandbox.
42
+ - **`flmcp` CLI.**
43
+ - `flmcp install` copies the FL scripts into FL's real user data folder,
44
+ creates the loopMIDI port, assigns the controller, and registers the server
45
+ with Claude Desktop, Claude Code, Cursor and VS Code, backing up configs
46
+ first.
47
+ - `flmcp doctor` checks files, outdated scripts, the MIDI port and controller
48
+ assignment, FL process, heartbeat, live ping and version mismatch.
49
+ - `flmcp config` prints per-client snippets, including Codex.
50
+ - `flmcp uninstall` removes everything again.
51
+ - Running `flmcp` with no arguments starts the server, so `uvx flmcp-studio` just
52
+ works.
53
+ - **The FL scripts ship inside the wheel**, so installing from PyPI/uvx needs no
54
+ git clone.
55
+ - **MCP 2 features.** Every tool has a title and read-only / destructive /
56
+ idempotent annotations, and returns structured output.
57
+ - **6 guided prompts:** *Make a Beat*, *Write a Chord Progression*, *Hum to
58
+ Melody*, *Flip Audio to Drum & Bass*, *Review a Mix*, *Project Overview*.
59
+ - **Toolsets:** `FLMCP_TOOLSETS` (`all`, `core`, `lean` or any group list) and
60
+ `FLMCP_DISABLE_TOOLS`. The new `fl_list_toolsets` tool lists them.
61
+ - **FL Studio 2026 API support** (gated, so FL 2024/2025 keep working):
62
+ - `pattern_set_length`, which really sets the length now (in bars, beats or
63
+ steps; FL's unit turned out to be steps, not beats as documented).
64
+ - New `pattern_clear` tool, which empties a pattern's notes and steps.
65
+ - `pattern_clone` can copy into a chosen pattern (`dest_index`).
66
+ - New `channel_get_swing` / `channel_set_swing` tools for the Channel rack swing.
67
+ - New `ui_show_picker` tool, which opens the plugin or project picker.
68
+ - `project_metadata` reports title, author and genre.
69
+ - `mixer_count` reports `insert_count`.
70
+ - `fl_introspect` tool, backed by the new `meta.introspect` bridge action. It
71
+ lists which scripting functions the running FL build exposes, with optional
72
+ docstrings.
73
+ - `fl_ping` warns when the bridge script inside FL is older than the server and
74
+ tells you how to update it.
75
+ - `server.json` for the official MCP Registry (`io.github.geezoria/flmcp`).
76
+ - CI on Windows/macOS/Linux × Python 3.10/3.12/3.13 with a wheel smoke test,
77
+ issue and PR templates, `CONTRIBUTING.md`, `SECURITY.md`, `AGENTS.md`, and a
78
+ generated `docs/TOOLS.md` (`scripts/gen_tools_doc.py`).
79
+ - `docs/FL_API_2026.md`: FL 2026 scripting API changes (API 45).
80
+ - `scripts/live_check.py` (replaces `smoke_test.py`) runs every read-only tool
81
+ against a running FL through the real MCP server. With `--write` it also runs
82
+ the edits, each one restored afterwards, a pattern lifecycle, and every
83
+ piano-roll tool on a scratch pattern. 104 checks pass on FL 26.1.7.
84
+
85
+ ### Changed
86
+
87
+ - `scripts/install_windows.ps1` / `uninstall_windows.ps1` are thin wrappers
88
+ around `flmcp install` / `flmcp uninstall`.
89
+ - Bridge, CLI and FL user data folder detection honour FL's *Shared data*
90
+ registry setting and `FLMCP_BRIDGE_DIR`.
91
+ - Rewrote README, ARCHITECTURE and LIMITATIONS for the new transport.
92
+ - **Piano-roll tools need no setup on Windows.** The server runs ComposeWithLLM
93
+ from the piano roll's Tools menu with posted window messages, so it doesn't
94
+ depend on the script being the selected one, on focus, or on Ctrl+Alt+Y. FL
95
+ doesn't come to the front and the mouse and keyboard stay free. It falls
96
+ back to the hotkey, and results report which one ran in `trigger`
97
+ (`tools_menu` or `hotkey`).
98
+
99
+ ### Fixed
100
+
101
+ - Tool errors reach the model. MCP 2 replaces any exception that isn't a
102
+ `ToolError` with "Error executing tool X", so the model never learned that a
103
+ bridge call failed with, say, a bad index, or that a call timed out. Every
104
+ tool now passes its error text on.
105
+ - Mixer tools check the track against the project's inserts. FL 2026 projects
106
+ can have fewer than 125. FL raised a bare "Index out of range" for most
107
+ calls, and `channel_route_to_mixer` silently routed to the last insert
108
+ instead.
109
+ - `channel_solo` can unsolo. On FL 26.1.7 a second `soloChannel()` call
110
+ doesn't undo a solo, so the other channels stayed muted. The bridge now
111
+ unmutes every channel, as FL's own Solo button does. Found by an end-to-end
112
+ run through Claude Code.
113
+ - `transport_play` reports the state it switched to. FL's `isPlaying()` lags
114
+ within a callback, so the tool used to answer `is_playing: false` right after
115
+ starting playback.
116
+ - When ComposeWithLLM doesn't answer, the piano-roll tools empty the request
117
+ queue. Queued edits used to run on the next unrelated script run.
118
+ - `pattern_clear` no longer returns `cleared: false` after a successful clear.
119
+ FL 26.1.7 clears without asking for confirmation.
120
+ - Pattern tools no longer treat `patterns.patternCount()` as the highest
121
+ pattern index. It is 0 in a fresh project even though *Pattern 1* exists,
122
+ so `pattern_set_length` and friends rejected valid patterns, and
123
+ `pattern_create` / `pattern_list` could miss or overwrite patterns after a
124
+ gap. Indices are now checked against `patternMax()`, and "in use" means
125
+ having content or a custom name.
126
+ - `pattern_clone` reports the index FL really cloned into.
127
+ - `flmcp doctor` no longer reports a working bridge as broken on FL 2026.
128
+ There, FL never calls the script's `OnIdle`, so the heartbeat only refreshes
129
+ on MIDI wakes. Doctor now pings through a wake, and it treats a missing
130
+ loopMIDI port as a real problem.
131
+ - Transport tools now act on the song while a plugin window has focus. FL
132
+ sends `transport.start/stop/record` to a focused plugin that has its own
133
+ transport, such as Edison, so `transport_stop` could leave the song playing.
134
+ The bridge first moves focus to the Playlist and reports `refocused_from`.
135
+ The automation recorder does the same.
136
+ - Automation recording works on FL 2026. Arming Record opens FL's "What would
137
+ you like to record?" prompt. The recorder used to start playback in the same
138
+ callback, which closed the prompt and cancelled the arm. Its points then
139
+ failed with "Operation unsafe at current time", and the end of the run could
140
+ leave Record armed. The bridge now runs the recording as a state machine over
141
+ ticks. It arms, waits for the prompt to be answered, starts playback, and
142
+ counts point times from there. It retries a point that hits "unsafe", then
143
+ stops and disarms without ever arming Record again. On Windows the server
144
+ answers the prompt with *Notes and automation*, and the result says so.
145
+ Verified on FL 26.1.7: a mixer-volume ramp recorded into the pattern and
146
+ played back. The heartbeat reports the recorder's state, and the client
147
+ keeps waking FL until the run ends.
148
+ - Plugin tools work on FL 2026. `plugins.getParamValueString` takes at most 4
149
+ arguments there, not the 5 in the API stubs, so `plugin_get_param` and
150
+ `plugin_set_param` failed with a `TypeError`. `plugin_params` swallowed the
151
+ same error and returned an empty list. The bridge now handles both forms, and
152
+ `plugin_params` reports a failing parameter instead of dropping it. On a
153
+ sampler or an empty slot the tools return `no plugin at …` with a hint.
154
+ `plugin_set_param` returns the value it set, because FL reports a mixer
155
+ effect's old value until the next callback. Verified on FLEX and on
156
+ Emphasizer.
157
+ - `playlist_list_markers` lists marker names through
158
+ `arrangement.getMarkerName`. It used to return nothing. FL exposes no marker
159
+ positions.
160
+ - "Operation unsafe at current time" errors now name the FL dialog that is in
161
+ the way (Windows). `transport_record` reports when the record prompt opened,
162
+ and `ui_focused_window` returns `focused_form_caption`.
163
+ - `flmcp doctor` reports when more than one FL Studio instance is running.
164
+ They share the bridge folder, so they race for commands and a single call
165
+ can run in both.
166
+ - `flmcp install` now really assigns the controller. It also writes the MIDI
167
+ input's `Type="-3"`, which marks a script controller. Without it FL ignored
168
+ `ScriptFolder`, and users had to pick *fLMCP Bridge* in MIDI Settings by
169
+ hand. `flmcp doctor` warns when an input names the bridge with another Type.
170
+ Verified end to end on FL 26.1.7: with FL closed, the registry was reset to a
171
+ fresh state, then install ran and FL started. The bridge answered without
172
+ any clicks.
173
+
174
+ ## [0.3.0] — 2026-06-17
175
+
176
+ ### Added — polyphonic transcription (Spotify Basic Pitch)
177
+
178
+ - **`polyphonic=True` flag** on `voice_record_and_transcribe`,
179
+ `voice_transcribe_file`, `voice_to_piano_roll`, `audio_analyze`,
180
+ `audio_melody_to_piano_roll` and `song_to_dnb_flip`. When set, transcription
181
+ uses Spotify Basic Pitch (ML, polyphonic) instead of the default monophonic
182
+ pyin engine — so chords, guitar strums, piano and full-mix melodic content
183
+ come through with overlapping notes preserved. Default stays monophonic
184
+ (lightweight, no extra deps). This finally makes `song_to_dnb_flip`'s melody
185
+ extraction faithful to chordal sources.
186
+ - New engine functions `transcribe_polyphonic()` and the pure, unit-tested
187
+ converter `_basic_pitch_to_notes()` in `voice_to_midi.py`; `analyze_audio()`
188
+ gained a `polyphonic` parameter. Verified end-to-end against the real Basic
189
+ Pitch library (a C-major triad transcribes to 3 simultaneous notes).
190
+ - New `[polyphonic]` extra with the Basic Pitch runtime deps, and a
191
+ `-Polyphonic` switch on the Windows installer.
192
+ - **Note:** `pip install basic-pitch` is broken on Python 3.12 (it pins
193
+ `tensorflow<2.15.1`, which has no 3.12 build). fLMCP installs Basic Pitch
194
+ with `--no-deps` and runs inference on the **ONNX** runtime instead (no
195
+ TensorFlow). The installer's `-Polyphonic` switch does this automatically;
196
+ manual users run `pip install "fl-studio-mcp[polyphonic]"` (now `flmcp-studio[polyphonic]`) then
197
+ `pip install basic-pitch --no-deps`.
198
+ - Tools now report which `engine` produced the notes.
199
+
200
+ ## [0.2.0] — 2026-06-17
201
+
202
+ A correctness, robustness and testability pass. Every change below was verified
203
+ against the official [FL Studio API stubs](https://pypi.org/project/fl-studio-api-stubs/)
204
+ where it touches the FL API, and the offline test suite grew from 15 to 63 tests.
205
+
206
+ ### Fixed — correctness bugs
207
+
208
+ - **Colors were red/blue swapped.** FL Studio stores colors as `0xRRGGBB`
209
+ (verified via `utils.RGBToColor(255,0,0) == 0xFF0000`), but the bridge encoded
210
+ and decoded them as `0xBBGGRR`. Every color set through fLMCP showed up with
211
+ red and blue swapped in FL. `_color_to_int` / `_int_to_color_hex` now use the
212
+ correct byte order, accept `[r,g,b]` lists, and mask the high byte on read.
213
+ Covered by `tests/test_bridge_helpers.py`.
214
+ - **`channel_set_pitch` set the wrong thing.** It used `setChannelPitch` mode 0,
215
+ which is a *factor of the pitch-bend range* (`-1..1`), not semitones — so a
216
+ request for "12 semitones" clamped to max bend. It now uses mode 1 (cents,
217
+ `semitones × 100`), the only non-broken semitone path in FL's API, and reports
218
+ `pitch_semitones` + `pitch_cents`.
219
+ - **`channel_solo` / `mixer_arm` ignored the requested state.** Both FL functions
220
+ are toggle-only, so passing `solo=true` / `armed=false` did nothing meaningful.
221
+ They now read the current state and toggle only when it differs.
222
+ - **`playlist_mute_track` / `playlist_solo_track` ignored the requested state.**
223
+ Now use FL's value argument (`-1` toggle, `0/1` set) to honor `muted` / `solo`.
224
+ - **`channel_*_step_sequence(pattern=…)` ignored the pattern.** FL's grid-bit API
225
+ only reaches the selected pattern; the bridge now jumps to the requested
226
+ pattern and restores the previous selection afterwards.
227
+ - **`ui_focused_window` returned garbage.** It called `ui.getFocused(-1)`, but
228
+ that function reports whether a *specific* widget is focused. It now scans the
229
+ known windows and returns the focused window name + `focused_form_id`.
230
+ - **`channel_mute` used inconsistent index space.** Reads used the global channel
231
+ index while the write used the local index; both now use the global index, and
232
+ the write uses FL's direct value argument.
233
+ - **`song_to_dnb_flip` sub-bass octave** comment/code/hint disagreed; aligned to
234
+ MIDI 24–35 (C1–B1).
235
+
236
+ The next group were all the same class of error — FL functions have a
237
+ `mode` / `pickupMode` argument *before* `useGlobalIndex`, and the bridge was
238
+ passing `True` (intending "global index") into that earlier slot:
239
+
240
+ - **`channel_info.volume` was wrong.** `getChannelVolume(i, True)` set
241
+ `mode=True`, returning the value in **decibels** from the local index, not
242
+ the normalized 0..1 global value. Now `getChannelVolume(i, False, True)`,
243
+ with `volume_db` reported separately.
244
+ - **`channel_set_volume` / `channel_set_pan` set `pickupMode=1`** instead of
245
+ using the global index. Now pass `(…, 0, True)` (pickup off, global index).
246
+ Same fix in the channel-volume / channel-pan automation paths.
247
+ - **`plugin_set_param` and the value-string read set `pickupMode`** instead of
248
+ `useGlobalIndex` — channel-plugin parameters were read/written against the
249
+ wrong index space. Now pass the explicit `pickupMode=0` slot.
250
+ - **`channel_*_grid_bit` / step-sequencer ops used the local index**; now use
251
+ the global index to match the rest of the channel API.
252
+ - **`channel_quick_quantize` called `quickQuantize()` with no arguments**, but
253
+ `index` is required — it would have raised `TypeError` in FL. Now passes the
254
+ channel index explicitly.
255
+ - **`plugin_set_preset` / `playlist_refresh` called non-existent FL functions**
256
+ (`plugins.setPreset`, `playlist.refresh`) — they would have raised
257
+ `AttributeError`. Both now degrade gracefully with a clear note.
258
+ - **`ui_show_window("plugin")` used a bogus window id.** `midi.widPlugin` does
259
+ not exist; FL has `widPluginEffect` (6) and `widPluginGenerator` (7). The
260
+ window map now uses the real constants and adds `plugin_generator` /
261
+ `plugin_effect` names.
262
+
263
+ Every FL API call the bridge makes (224 references; 105 distinct real calls)
264
+ was cross-checked against the official API stubs as part of this pass.
265
+
266
+ ### Fixed — robustness
267
+
268
+ - **The server no longer needs the audio extras to start.** `numpy` / `librosa` /
269
+ `sounddevice` / `soundfile` were imported at module load, so a base install
270
+ (without the — previously non-existent — `[audio]` extra) failed to boot the
271
+ *entire* server, killing transport/mixer/everything. These are now imported
272
+ lazily, only when a voice/audio tool actually runs. Guarded by
273
+ `tests/test_lazy_imports.py`.
274
+ - **Missing `[audio]` extra.** The README told users to `pip install
275
+ "fl-studio-mcp[audio]"`, but `pyproject.toml` defined no such group. Added
276
+ `audio`, `gui` and `dev` optional-dependency groups; the Windows installer now
277
+ installs `[audio,gui]` by default (`-SkipAudio` to opt out).
278
+ - **Friendly errors when audio deps are missing.** Voice/audio tools return a
279
+ structured `{ok: false, error: "...pip install fl-studio-mcp[audio]..."}`
280
+ instead of an `ImportError` traceback.
281
+ - **Automation no longer freezes FL.** `automation_record_*` previously slept
282
+ between points *inside `OnIdle`*, blocking FL's main thread and freezing the UI
283
+ for the whole clip. Rewritten as a non-blocking scheduler that applies points
284
+ by monotonic deadline across idle ticks; tools return immediately with
285
+ `{"mode": "async"}`.
286
+ - **The FL bridge is now importable offline.** Its FL-only imports are guarded,
287
+ so the pure helpers (color, position mapping, the handler table) can be unit
288
+ tested without FL Studio.
289
+
290
+ ### Added — features
291
+
292
+ - **Generators honor `channel` / `pattern`.** `gen_emit_chord_progression`,
293
+ `gen_emit_melody`, `gen_emit_bassline` and `gen_emit_arpeggio` accepted a
294
+ `channel` argument that was silently ignored. When the TCP bridge is online,
295
+ the target channel's piano roll is now opened automatically before the notes
296
+ are written.
297
+ - **Piano-roll tools accept optional `channel` / `pattern`** for the same
298
+ auto-routing, matching the documented signatures.
299
+ - **`voice_notes_to_piano_roll` gained `quantize_grid_sec`** and validates the
300
+ scale name.
301
+
302
+ ### Removed
303
+
304
+ - **`fl_bridge/piano_roll/fLMCP_bridge.pyscript`** — dead, never installed, and a
305
+ footgun: it tried to bind a second TCP server on the same port (`9876`) as the
306
+ device script. Nothing referenced it.
307
+
308
+ ### Tests / tooling
309
+
310
+ - New: `test_voice_to_midi.py`, `test_audio_analysis.py`, `test_bridge_helpers.py`,
311
+ `test_audio_dnb.py`, `test_file_bridge.py`, `test_lazy_imports.py`; expanded
312
+ `test_generators.py` and `test_server_build.py`. 15 → 63 tests, all offline.
313
+ - `pyproject.toml`: project URLs, classifiers, keywords, `[tool.pytest.ini_options]`,
314
+ version bumped to `0.2.0`. Added a top-level `LICENSE` file (MIT).
315
+
316
+ ## [0.1.0] — 2026-04-22
317
+
318
+ - Initial release: 159 MCP tools + 7 resources covering transport, patterns,
319
+ channels, mixer, plugins, piano roll, playlist, arrangement, automation,
320
+ project, UI, high-level generators, voice-to-MIDI and audio-file analysis.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 fLMCP contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.