Fit a track to a video
fit_musicFits a music track to a video cut by trimming or looping whole bars, aligning the drop to a chosen hit, ending on a beat, ducking under voice, and setting loudness.
Instructions
Fits a music track to a video cut: makes it exactly the given length by cutting or looping whole bars, lands its drop on the hit, ends it on a beat, ducks it under a voice and sets its loudness. Writes fitted.wav, cues.json (every beat, bar, seam and the hit, in seconds and frames), seams.png and FIT.md (what was done and where to listen). Give cues.json to check_video to check the cuts land on the beat. (musicfit 0.1.2, on this machine.)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"track": "<track>",
"length": "<length>"
},
"name": "fit_music"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bpm | No | The tempo, when the one found is half or double the real one. | |
| end | No | How it ends: auto, natural (the track's own ending) or fade (default auto). | |
| fps | No | Frame rate for frame numbers, like 30, 25 or 29.97 (default 30). | |
| hit | No | Where the drop lands in the result, in seconds or frames like 825f. | |
| drop | No | Where the drop is in the track (default: found). | |
| duck | No | How far the music dips under the voice, in dB (default 10). | |
| fade | No | Length of the closing fade, in whole beats (default a bar). | |
| lufs | No | Loudness target in LUFS (default -14). | |
| meter | No | Beats to a bar (default: found). | |
| track | Yes | The music file, or a video whose sound to use; anything ffmpeg reads. | |
| voice | No | A voice track on the video's timeline; the music dips under it. | |
| length | Yes | How long the result is: seconds like 32 or 32s, frames like 960f, or 1:05. | |
| out_dir | No | Folder to save into, absolute or relative to /app. Default: musicfit-{stem:track}. | |
| wait_seconds | No | How long to wait for the result before returning a job_id to wait on. 45 is safe for clients that stop a tool call after 60 seconds. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kit | Yes | ||
| tool | Yes | ||
| files | No | ||
| folder | No | Where the kit saved its files. | |
| job_id | Yes | ||
| passed | No | For checks: whether the check passed. | |
| status | Yes | ||
| exit_code | No | ||
| last_line | No | What the kit was doing last. | |
| expires_at | No | When the download links stop working. | |
| next_action | No | ||
| elapsed_seconds | Yes |