# From a Blank Timeline to a Finished VOCALOID Song ## Engineering an Agent-Native VOCALOID3 MCP for Composition, Tuning, Rendering, Mixing, Mastering, and Verified Delivery - **Project checkpoint:** 2026-07-18; paired VSQX delivery update 2026-07-19 - **Implementation:** TypeScript, Model Context Protocol, native Win32 helpers, VOCALOID3 Editor, FluidSynth, FFmpeg - **Primary verified voice:** IA_ROCKS - **Implementation baseline described:** local commit `91545a0`, with the later paired-delivery convention documented below - **Current verification:** 47 tests discovered, 45 passed, 2 intentionally skipped, 0 failed - **繁體中文版:** [從空白 Timeline 到一首完成的 VOCALOID 歌曲](from-blank-timeline-to-finished-vocaloid-song.md) --- ## Abstract This project began with a deceptively simple idea: expose VOCALOID through an MCP server so that a coding agent could help make a Vocaloid song. The crucial word was **song**. A successful system could not stop at generating a Standard MIDI File, emitting a few notes, converting an existing VSQX project, or making the editor pronounce isolated syllables. The intended user experience was much closer to this: > Give an agent a creative brief, lyrics, or even an empty timeline. Let it design form, melody, harmony, rhythm, phonemes, vocal expression, accompaniment, tempo and meter changes, mix intent, and delivery targets. Then let the same agent produce a native VOCALOID project, render the licensed voice through the original editor, assemble stems, master the result, listen analytically, revise bounded sections, and deliver a verified stereo WAV with provenance. That requirement transformed the work from “write some XML” into a small production system. It required reverse engineering enough of a legacy 32-bit Windows application to automate it safely; understanding Yamaha's VSQ3/VSQ4 data model; designing a canonical song representation suitable for long-running agent sessions; separating creative intent from derived artifacts; building deterministic accompaniment and audio-processing backends; and, perhaps most importantly, reducing the interaction cost until a fresh agent could use the system without repeatedly rediscovering its schema. This article reconstructs the entire engineering path from the first native probe to the three complete IA_ROCKS delivery pairs now in `artifacts/songs/` and `artifacts/vsqxs/`. It includes the dead ends, crashes, false assumptions, interface redesigns, quality failures, and test evidence. It also draws a strict boundary between what the system has actually proven and what still requires better instruments, broader voice coverage, human listening, or future protocol work. This is not a claim that software has solved musical taste. It is a report on building an auditable instrument through which an agent can exercise musical judgment. --- ## Contents 1. [The real problem: complete production, not MIDI generation](#1-the-real-problem-complete-production-not-midi-generation) 2. [Constraints and definition of done](#2-constraints-and-definition-of-done) 3. [The final system at a glance](#3-the-final-system-at-a-glance) 4. [Phase I: archaeology, schemas, and native reverse engineering](#4-phase-i-archaeology-schemas-and-native-reverse-engineering) 5. [Phase II: generating native VSQX from zero](#5-phase-ii-generating-native-vsqx-from-zero) 6. [Phase III: safely automating the original VOCALOID3 Editor](#6-phase-iii-safely-automating-the-original-vocaloid3-editor) 7. [Phase IV: moving from vocal snippets to structured songs](#7-phase-iv-moving-from-vocal-snippets-to-structured-songs) 8. [Phase V: long-form rhythm, fast lyrics, arrangement, and mastering](#8-phase-v-long-form-rhythm-fast-lyrics-arrangement-and-mastering) 9. [Phase VI: the canonical song manifest](#9-phase-vi-the-canonical-song-manifest) 10. [Phase VII: Japanese lyrics and inspectable tuning gestures](#10-phase-vii-japanese-lyrics-and-inspectable-tuning-gestures) 11. [Phase VIII: stems, score-versus-render analysis, and reproducible mixing](#11-phase-viii-stems-score-versus-render-analysis-and-reproducible-mixing) 12. [Phase IX: preflight, host readiness, history, and delivery](#12-phase-ix-preflight-host-readiness-history-and-delivery) 13. [Phase X: redesigning the MCP for agents](#13-phase-x-redesigning-the-mcp-for-agents) 14. [The complete production workflow](#14-the-complete-production-workflow) 15. [Independent agent evaluations](#15-independent-agent-evaluations) 16. [Three complete style closures](#16-three-complete-style-closures) 17. [Failure ledger: what broke and what each failure taught us](#17-failure-ledger-what-broke-and-what-each-failure-taught-us) 18. [Testing and evidence strategy](#18-testing-and-evidence-strategy) 19. [Chronological checkpoint history](#19-chronological-checkpoint-history) 20. [Repository map and reproducibility](#20-repository-map-and-reproducibility) 21. [Safety, provenance, and operational boundaries](#21-safety-provenance-and-operational-boundaries) 22. [What is proven, what is not, and what should come next](#22-what-is-proven-what-is-not-and-what-should-come-next) 23. [Engineering lessons that generalize beyond VOCALOID](#23-engineering-lessons-that-generalize-beyond-vocaloid) 24. [Appendix: production tools and resources](#24-appendix-production-tools-and-resources) --- ## 1. The real problem: complete production, not MIDI generation Many “AI music” integrations choose MIDI as their boundary. That is understandable: MIDI notes are easy to create, validate, and route to an instrument. But a Vocaloid performance contains information that ordinary MIDI does not represent faithfully: - lyrics and language-specific phonemes; - singer identity and voicebank component binding; - note-level velocity as consonant timing rather than conventional loudness; - accent, decay, opening, bend depth, bend length, and portamento flags; - vibrato type, onset, depth envelope, and rate envelope; - time-varying DYN, BRE, BRI, CLE, GEN, POR, PIT, and PBS curves; - musical-part boundaries, pre-measures, mixer settings, and singer events; - native editor behavior, including licensed synthesis and project compatibility. An agent that emits only MIDI can suggest a melody. It cannot claim to have created the actual vocal performance. Likewise, a system that generates VSQX but never opens it in the target editor has only proven that its XML parser is satisfied—not that VOCALOID accepts, renders, or preserves it. We therefore adopted a much stronger definition: > The MCP is complete only when an agent can begin without an input VSQX, preserve musical and production intent in an inspectable canonical model, compile native VOCALOID artifacts, render the selected licensed voice through the original editor, render accompaniment, produce and mix isolated stems, master to explicit targets, run independent delivery checks, and retain enough provenance to reproduce or revise the result. This definition changed every architectural decision. VSQX became a derived format rather than the sole database. Audio analysis became part of the workflow rather than an afterthought. Tool design had to optimize not only capability coverage but also context cost, retry cost, and mutation safety. A long song had to survive dozens of calls without asking the agent to resend thousands of events every time. ### 1.1 “Agent-assisted” does not mean “agent-hidden” The agent remains responsible for artistic choices: - song form and section energy; - melodic contour and tessitura; - chord progression and harmonic tension; - where fast syllabic writing is intentional; - where a breath, rest, melisma, harmony entrance, or tempo change belongs; - stereo placement and effect intent; - whether a warning describes a defect or a deliberate style choice. The MCP supplies affordances and guardrails. It does not silently compose a generic song behind a single `make_song` button, and it does not auto-correct every unusual passage into stylistic blandness. Its analyzers report observable risk; they do not substitute numeric thresholds for taste. ### 1.2 Why “from zero” mattered At several points it would have been easy to start with a known-good VSQX, replace its notes, and describe the result as generation. We explicitly rejected that shortcut. The earliest independent Codex proof created an eight-measure project containing 41 original notes and 62 control points without reading or copying an existing song. Yamaha's native loader later enumerated 351 objects from that generated project. Existing projects were used only as format or behavior oracles: examples against which to compare native structure, object trees, and editor behavior. They were never used as hidden musical templates for the final compositions. --- ## 2. Constraints and definition of done The development environment imposed several constraints that are easy to miss when looking only at the finished tool list. ### 2.1 Legacy application boundary VOCALOID3 Editor and its libraries are 32-bit Windows software. Most of the orchestration and MCP implementation runs in a modern Linux/WSL environment under Node.js. Native validation and rendering therefore cross an operating-system and architecture boundary: ```text Codex / MCP client | | JSON-RPC over stdio v Node.js TypeScript MCP server in WSL/Linux | | validated Windows paths + bounded subprocess protocol v 32-bit native Windows helpers | +--> Yamaha Vsq3.dll loader/probe | +--> original VOCALOID3 Editor UI and licensed synthesis ``` This is why the project contains both TypeScript modules and native C/PowerShell helpers. Trying to pretend that the editor was a normal HTTP service would have hidden the hardest reliability problems rather than solving them. ### 2.2 The original editor is the synthesis authority The system may inspect installed VVD metadata, but a file on disk does not prove that a singer is registered, licensed, or usable by the current editor. Only an actual render proves availability. For the production workflow, the original VOCALOID3 Editor—not a reimplementation—is the authority for voice synthesis. This also establishes a licensing boundary. The reverse-engineering work was used to understand file loading and legitimate installed behavior. It did not patch activation checks, bypass voice registration, redistribute voice data, or attempt to replace the licensed engine. ### 2.3 Local, single-user MCP transport The current server uses MCP over `stdio`, which is appropriate for a local desktop bridge. It avoids exposing a legacy editor and filesystem paths over a network. A future remote service would need authentication, tenant isolation, secret management, and a substantially different threat model; none of that is implied by the current local design. ### 2.4 One verified production voice The final style evaluations use the exact IA_ROCKS component ID: ```text BDREB7P2KTWKYDC5 ``` Another locally visible identifier, `BLRGDDR4M3WM2LC6`, belongs to IA rather than IA_ROCKS. Confusing those IDs once was enough to justify a single canonical constant and an active voice-readiness probe. The architecture supports other voices, but this checkpoint claims end-to-end production evidence only for IA_ROCKS. ### 2.5 A concrete completion matrix The following table summarizes the standard eventually used to decide whether the project had a real closed loop. | Layer | Required evidence | | --- | --- | | Composition | A new song can start from an empty manifest; no source VSQX is required. | | Lyrics | Original text, kana reading, normalized reading, mora alignment, and locked phonemes remain distinguishable. | | Vocal expression | High-level intent compiles into inspectable native note styles, vibrato data, and control curves. | | Structure | Multiple sections, vocal tracks, parts, tempo changes, meter changes, and reusable arrangement patterns are supported. | | Native compatibility | XSD validation and Yamaha's own Vsq3 loader both accept generated VSQX. | | Voice synthesis | The original editor renders non-silent audio without singer substitution. | | Accompaniment | Multi-instrument and drum arrangements render to verified stereo audio. | | Iteration | Stable IDs and bounded edits allow section-scale changes without resending the whole song. | | Stems | Vocal and instrument tracks can be rendered separately with explicit pan/dry decisions and artifact provenance. | | Mix | Ordered effects and section dynamics are deterministic and stored as intent. | | Master | Integrated loudness, LRA, true peak, clipping, and stereo balance are measured independently. | | Delivery | A final WAV is accepted only when its dependency chain and hashes are current; the matching current-composition VSQX is published under the same basename. | | Recovery | Failed renders do not produce false artifacts; successful prior work can be resumed. | | Agent usability | The default tool catalog is compact, typed, documented, and supplemented by on-demand resources. | --- ## 3. The final system at a glance The mature system has five conceptually separate planes. ```text CREATIVE / CONTROL PLANE Agent brief, lyrics, revisions, listening notes | v 20-tool production MCP profile + resources, typed outputs, dry-run, preflight | v canonical *.song.json timeline | form | harmony | vocals | arrangement | mix | review | +----------------+----------------+ | | v v NATIVE VOCAL PLANE INSTRUMENT PLANE VSQ3/VSQ4 compiler patterns/placements XSD + native loader FluidSynth + SF2 VOCALOID3 Editor per-track stems per-vocal-track stems | | | +----------------+----------------+ v AUDIO PRODUCTION PLANE alignment -> effects -> automation stem sum -> bus -> analysis -> master | v EVIDENCE / DELIVERY PLANE hashes | dependencies | history | reviews | QC | v artifacts/songs/-