How to
Game music loops
A menu theme or level loop that repeats without a click or a gap, as an Ogg and a WAV in your repo.
When to use it
Background music for a game, a menu screen or a product video, with or without lyrics. Code can synthesise a loop, and in our test Claude Code's own numpy track looped perfectly, but it sounded like programmer synth music. A model gives you a produced-sounding track; the loop step makes it repeat cleanly.
What to ask your agent
Make a 30-second cozy adventure loop for the menu screen: instrumental, warm acoustic guitar, flute, 100 bpm.
What your agent sends
Claude Code calls vvgen_generate_music. This is the prompt from our test, with
bpm and loop added (the loop option did not exist yet when we ran it):
{
"prompt": "cozy instrumental adventure game loop, warm acoustic guitar, pizzicato strings, soft flute melody, light hand percussion, gentle and hopeful, 100 bpm, C major",
"instrumental": true,
"duration": 30,
"bpm": 100,
"loop": true,
"wait_seconds": 50
}
Music runs as a job. With wait_seconds a little longer than the track, the result usually comes back in the same
call; our 30-second track took about 20 seconds. Otherwise the agent polls vvgen_get_job.
loop: true cuts the track to whole bars (set bpm so the bars are exact), crossfades the end into the start and
keeps the peak under -1 dBTP at the same loudness. The words "seamless loop" in the prompt do nothing on their own.
What comes back
The track as an MP3, plus .loop.ogg and .loop.wav beside it. Use the Ogg or the WAV in the game: an MP3 adds a
short silence at the start when it's encoded, which you hear on every repeat. The result carries the length and a
waveform picture, never the audio itself, so the agent can't listen: play it yourself before it ships.
The free checks measure what the loop step fixed. On the track above, before: the jump at the wrap was 28.4 times the average step between samples, with 1.43 s of near-silence at the end. After: 0.07 times, no silent tail, peak -1.41 dBTP, loudness unchanged.
Tips from the playbook your agent carries:
- Draft at 30 seconds and pick by ear. The model ignores
seed, so every take is a new piece and a take can't be re-rendered longer. Keep the one you like. - Name the instruments, tempo and key. "Children's" tends to add a glockenspiel.
- If a track sounds thin, muddy or harsh, the agent repeats the same call with
"post": ["polish"]. The cached track is reused and only the free processing runs.
In Cursor and Codex
Same tool, same arguments: see the Cursor and Codex quickstarts.
What it costs
| A 30-second track | 8 credits ($0.08) |
|---|---|
| A one-minute track | 15 credits ($0.15) |
| The loop step and its checks | 0 credits |
From the price card. Your agent gets a quote before each call. Failed results and cache hits cost nothing.
Add it to Claude
One connector for Claude on the web, desktop and mobile, and for Claude Code when it's signed in with your Claude account. Cursor, Codex, Windsurf and other MCP clients are in the quickstarts.
In Claude Code, without a key
claude mcp add -s user --transport http \
vincevangen https://api.vincevangen.com/mcpThen run /mcp in Claude Code to sign in.