Content
# Music2DAW
Music2DAW is a .NET 10 toolkit for inspecting, editing, and exporting FL Studio
project files (`.flp`). It combines an FLP parser, a lossless event rewriter,
an arranged MIDI exporter, and a local stdio MCP server for VS Code and
Copilot.
The project is intended for developers and AI agents that need a reproducible
way to inspect FL Studio projects, make targeted edits, export interoperable
data, and open results in FL Studio for final audible verification.
## Capabilities
- Inspect FLP metadata, channels, generators, samples, patterns, piano-roll
notes, playlist clips, mixer inserts, effect slots, plugin states, embedded
preset text hints, and sequenced-instrument risk warnings.
- Export arranged Type 1 Standard MIDI with FL tempo, PPQ, playlist clips,
channel tracks, MIDI channel assignments, and conservative General MIDI
programs.
- Write a JSON manifest containing FL-specific instrument and mixer
information that MIDI cannot represent.
- Extract raw channel and mixer plugin-state blobs without modifying the source
project.
- Write a new FLP copy with targeted tempo, channel, routing, note, playlist,
and mixer edits.
- Launch an FLP project in FL Studio.
- Expose the same inspect, edit, export, and launch workflow through a local
stdio MCP server.
## Build
The setup script restores and builds the .NET 10 solution, runs the tests, and
produces the MCP server DLL used by `.vscode/mcp.json`.
```powershell
.\scripts\setup-agent-tools.ps1
```
Use `-SkipTests` for a quick local rebuild when a full test run is not needed.
For agent use without a .NET SDK, download the self-contained Windows CLI and
VS Code skills bundle from the latest GitHub release. See [`setup.md`](setup.md)
for installation and workspace setup.
## Choose an interface
Music2DAW provides two interfaces over the same `Music2Daw.Core` services and
edit-request model.
### CLI
Use the CLI from any environment with terminal access:
```powershell
dotnet run --project src\Music2Daw.Cli -- inspect "C:\path\song.flp"
dotnet run --project src\Music2Daw.Cli -- export `
"C:\path\song.flp" `
"C:\path\output"
dotnet run --project src\Music2Daw.Cli -- edit `
"C:\path\base.flp" `
"C:\path\new-song.flp" `
"C:\path\edit-request.json"
dotnet run --project src\Music2Daw.Cli -- launch `
"C:\path\song.flp"
```
An export directory contains:
```text
song.mid
song.manifest.json
plugin-states/
```
### VS Code MCP
Build the solution, then start the checked-in server configuration from VS
Code:
1. Run `MCP: List Servers`.
2. Start `music2daw`.
3. Allow Copilot to use the available tools.
The server exposes:
- `fl_studio_capabilities`
- `inspect_flp`
- `edit_flp`
- `export_music_bundle`
- `launch_fl_studio_project`
The configured server command is:
```powershell
dotnet src\Music2Daw.Mcp\bin\Debug\net10.0\Music2Daw.Mcp.dll
```
Restart the `music2daw` server after rebuilding so VS Code discovers updated
tool schemas.
## Safe editing behavior
Music2DAW never modifies a source FLP in place. Editing writes to a distinct
output path, changes only targeted FL events, preserves other events, writes
through a temporary file, and reparses the result before publishing it.
For MCP and CLI edits:
- Pattern, channel, mixer, and playlist track IDs are zero-based.
- Note and playlist positions use the project's PPQ ticks.
- `append` can layer notes onto an existing pattern.
- `playlistAdditions` can append clips without replacing the arrangement.
- Supplying `playlist` explicitly replaces the complete arrangement.
- `pluginStateCopies` can copy a complete opaque instrument state from one
existing channel to another.
Keep `song-brief.yaml` and `edit-request.json` with the project so an edit
remains reviewable and reproducible.
## AI-first FLP workflow
The repository treats an FL Studio project as a reproducible build artifact:
```text
song brief + structural template + edit request
-> FLP output
-> inspection and export reports
-> FL Studio listening check
```
The complete workflow is documented in
[`docs/AI_FIRST_FLP_WORKFLOW.md`](docs/AI_FIRST_FLP_WORKFLOW.md):
1. Inspect the source project.
2. Write a musical brief.
3. Create a structured `edit-request.json`.
4. Build a new FLP output.
5. Inspect the output and verify expected changes.
6. Export MIDI, manifest, and plugin-state files.
7. Launch FL Studio and listen for preset, sample, balance, transition, and
clipping problems.
8. Save revisions as new FLP files.
For a new composition, use a valid FLP as a structural and plugin-state
template only. Replace every inherited note-bearing pattern/channel pair and
replace the entire playlist.
Reusable workflow resources are available in:
- `.github/skills/create-flp-project/`
- `.github/skills/edit-flp-project/`
- `.github/prompts/`
- `templates/flp-project/`
## Format limits
FLP is an undocumented and evolving binary format. The parser has been
verified with FL Studio `25.1.2.4896`, including the 80-byte FL Studio 25
playlist record layout. Other FL Studio 25 builds should be tested before
relying on mixer or playlist details for archival conversion.
Third-party plugin presets remain opaque vendor data. Music2DAW preserves
untouched raw events and plugin-state bytes, but MIDI export uses a best-effort
General MIDI program inferred from channel, generator, plugin, and sample
names.
Music2DAW edits known FL event records rather than simulating FL Studio UI
input. It does not currently create arbitrary generators or effects from
nothing, reconstruct opaque vendor preset internals, or provide a stable
external replacement for FL Studio's native plugin loading. Final preset,
sample, routing, and sound-quality validation must happen in FL Studio.
## Attribution and licensing
Music2DAW is licensed under the
[GNU General Public License, version 3 or later](LICENSE).
This repository includes a modified copy of
[Monad FLParser](https://github.com/monadgroup/FLParser). The original GPL-3.0
license text is retained in
[`src/Monad.FLParser/LICENSE`](src/Monad.FLParser/LICENSE).
Monad FLParser credits
[andrewrk/node-flp](https://github.com/andrewrk/node-flp) as an upstream
basis. The parser documentation and original attribution are retained in
[`src/Monad.FLParser/README.md`](src/Monad.FLParser/README.md).
FL Studio is a product of
[Image-Line](https://www.image-line.com/flstudio/). Music2DAW is an
independent project and is not presented as an official Image-Line tool.
## Validation
For parser or editor changes:
```powershell
dotnet build Music2Daw.slnx
dotnet test tests\Music2Daw.Tests\Music2Daw.Tests.csproj
```
For an edited project:
```powershell
dotnet run --project src\Music2Daw.Cli -- inspect <output.flp>
dotnet run --project src\Music2Daw.Cli -- export <output.flp> <export-directory>
```
Inspect the output before using it, and keep the source project unchanged.