Repository navigation
Workflows
Four jobs end to end, as the skills run them, with every command's real output. A real session starts with gen and a listener's verdicts; here a stand-in take made with ffmpeg takes the place of the rendered take, so the steps after generation run on any machine with Python and ffmpeg. The skill pages say what the agent does around each command: game, score, produce.
A 45-second stereo file at 44.1 kHz: an A3 tone with a slow swell, an E4 above it, and a decaying 70 Hz kick every 0.625 seconds (96 bpm). It has no melody; it exists so that loudness, loops and seams have something with a beat to work on.
ffmpeg -v error -f lavfi -i "aevalsrc='0.25*sin(2*PI*220*t)*(0.7+0.3*sin(2*PI*0.2*t))+0.15*sin(2*PI*329.63*t)+0.5*exp(-25*mod(t,0.625))*sin(2*PI*70*t)':s=44100:d=45" -ac 2 take.wavThe other stand-ins used on these pages
quiet_end.wav (a tone that stops 6 s before the file ends), hot.wav (a tone 12 dB too hot, clipped), hardcut.wav (a tone cut mid-cycle), m1.wav to m3.wav (three movements in G, C and E with slow swells), dialogue.wav (two-second bursts of a 900 Hz tone every six seconds) and cut.mp4 (a 20-second test pattern with that sound):
ffmpeg -v error -f lavfi -i "sine=frequency=440:sample_rate=48000:duration=20" -af apad=pad_dur=6 quiet_end.wav
ffmpeg -v error -f lavfi -i "sine=frequency=440:sample_rate=48000:duration=6" -af volume=12 hot.wav
ffmpeg -v error -f lavfi -i "sine=frequency=440:sample_rate=48000:duration=3" -af atrim=end_sample=96027 hardcut.wav
ffmpeg -v error -f lavfi -i "aevalsrc='0.3*sin(2*PI*196*t)*(0.6+0.4*sin(2*PI*0.1*t))':s=48000:d=27" -ac 2 m1.wav
ffmpeg -v error -f lavfi -i "aevalsrc='0.3*sin(2*PI*261.63*t)*(0.6+0.4*sin(2*PI*0.3*t))':s=48000:d=13" -ac 2 m2.wav
ffmpeg -v error -f lavfi -i "aevalsrc='0.3*sin(2*PI*329.63*t)*(0.6+0.4*sin(2*PI*0.2*t))':s=48000:d=15" -ac 2 m3.wav
ffmpeg -v error -f lavfi -i "aevalsrc='if(between(mod(t,6),2,4),0.4*sin(2*PI*900*t)*(0.5+0.5*sin(2*PI*5*t)),0)':s=48000:d=20" dialogue.wav
ffmpeg -v error -f lavfi -i testsrc=size=320x180:rate=24:duration=20 -i dialogue.wav -c:v libx264 -pix_fmt yuv420p -c:a aac -shortest cut.mp4tone.wav, a.wav, b.wav and take_s1.flac are the repository's own fixtures in tests/fixtures/ (8 kHz mono tones; take_s1.flac is a.wav as FLAC), and so are tune.abc, riff.txt and wander.abc, the notation examples on Commands.
For the 0.1.1 commands: wide.wav (a 55 Hz bass in opposite phase in the two channels under a centred 440 Hz tone), lead.wav (a 440 Hz tone for two seconds in every four), reply.wav (a 660 Hz tone in the lead's gaps), double.wav (the same tone with the lead), and two 30-second A-major chords, in_tune.wav at A440 and sharp.wav 40 cents sharp:
ffmpeg -v error -f lavfi -i "aevalsrc='0.3*sin(2*PI*55*t)+0.2*sin(2*PI*440*t)|-0.3*sin(2*PI*55*t)+0.2*sin(2*PI*440*t)':s=48000:d=20" wide.wav
ffmpeg -v error -f lavfi -i "aevalsrc='if(lt(mod(t,4),2),0.4*sin(2*PI*440*t),0)':s=48000:d=16" lead.wav
ffmpeg -v error -f lavfi -i "aevalsrc='if(gte(mod(t,4),2),0.3*sin(2*PI*660*t),0)':s=48000:d=16" reply.wav
ffmpeg -v error -f lavfi -i "aevalsrc='if(lt(mod(t,4),2),0.3*sin(2*PI*660*t),0)':s=48000:d=16" double.wav
ffmpeg -v error -f lavfi -i "aevalsrc='0.2*sin(2*PI*220*t)+0.15*sin(2*PI*277.18*t)+0.15*sin(2*PI*329.63*t)':s=22050:d=30" in_tune.wav
ffmpeg -v error -f lavfi -i "aevalsrc='0.2*sin(2*PI*225.15*t)+0.15*sin(2*PI*283.66*t)+0.15*sin(2*PI*337.33*t)':s=22050:d=30" sharp.wavA battle theme at 96 bpm needs a 12-bar loop (30 seconds) mastered to the game's level. In a real session the take comes from gen with a steady caption ("steady loop, no intro, no ending") rendered 10 to 20 seconds longer than the loop, and the sheet shows where the intro swell ends.
python mw.py new music/battle --name "Battle loop" --use game-loop --duration 40
python mw.py loop take.wav --start 5 --bars 12 --bpm 96 --out music/battle/out/battle_loop.wav
python mw.py master music/battle/out/battle_loop.wav --preset game-music --out music/battle/out/battle_loop_master.wav
python mw.py seam music/battle/out/battle_loop_master.wav{
"ok": true,
"dir": "<work>/music/battle",
"manifest": {
"musicwright": "0.1.17",
"name": "Battle loop",
"use": "game-loop",
"duration_s": 40.0,
"loudness_preset": "game-music",
"created": "<now>",
"ai_generated": true,
"deliverables": [],
"disclosure": null
},
"next": "fill brief.md, then mw.py gen ... --out music/battle/takes"
}
[exit 0]
{
"ok": true,
"out": "<work>/music/battle/out/battle_loop.wav",
"loop_length_s": 30.0,
"source_window_s": [
5.0,
36.5
],
"xfade_s": 1.5,
"seam": {
"file": "music/battle/out/battle_loop.wav",
"seam_jump": 262,
"p99_step": 308,
"ratio": 0.85,
"level_jump_db": 1.29,
"verdict": "clean"
},
"bars": 12,
"bpm": 96.0
}
[exit 0]
{
"ok": true,
"out": "<work>/music/battle/out/battle_loop_master.wav",
"preset": "game-music",
"target": {
"lufs": -18,
"true_peak": -1.0
},
"preset_note": "music assets for a game, mastered consistently below the full mix; balance in the engine mixer.",
"lra_hint": "narrow for beds heard for minutes under sound effects; let one-shot cues swell",
"normalization": "linear",
"before": {
"lufs_i": -15.8,
"true_peak_dbtp": -3.5,
"lra": 1.9
},
"after": {
"lufs_i": -17.9,
"true_peak_dbtp": -5.6,
"lra": 1.9,
"duration_s": 30.0,
"sample_rate": 48000
},
"warnings": []
}
[exit 0]
{
"ok": true,
"files": [
{
"file": "music/battle/out/battle_loop_master.wav",
"seam_jump": 208,
"p99_step": 244,
"ratio": 0.85,
"level_jump_db": 1.29,
"verdict": "clean"
}
]
}
[exit 0]
What to read in it: the loop is exactly 30.0 s; master applied one gain (linear) from -15.8 to -17.9 LUFS; the seam ratio stayed 0.85 after mastering. The loop starts on the kick and the level jump reads 1.29 dB, "clean" (0.1.1 read 3.5 dB and "check by ear": why); a listener plays the loop three times through before it ships. For Unity, import the WAV and set Loop on the AudioSource (FAQ).
A 46-second cut with hits at 24 and 34 seconds: three movements, each rendered a few seconds longer than its slot, joined on the hits, mastered for the web, then ducked under the cut's dialogue and put back into the video.
python mw.py join m1.wav m2.wav m3.wav --lengths 24,10,12 --xfade 2 --fade-out 1.5 --out music/short/out/score.wav
python mw.py master music/short/out/score.wav --preset web-video --out music/short/out/score_web.wav
python mw.py duck music/short/out/score_web.wav --under cut.mp4 --out music/short/out/cut_scored.mp4{
"ok": true,
"out": "<work>/music/short/out/score.wav",
"duration_s": 46.0,
"crossfade_centres_s": [
24.0,
34.0
],
"note": "each crossfade starts at the hit point and lasts --xfade seconds"
}
[exit 0]
{
"ok": true,
"out": "<work>/music/short/out/score_web.wav",
"preset": "web-video",
"target": {
"lufs": -16,
"true_peak": -1.5
},
"preset_note": "music bed or score under web video; one level for every cue in a film.",
"lra_hint": "narrow: phones and laptops under speech; keep sections within a few LU of each other",
"normalization": "linear",
"before": {
"lufs_i": -17.4,
"true_peak_dbtp": -10.6,
"lra": 8.3
},
"after": {
"lufs_i": -15.9,
"true_peak_dbtp": -9.2,
"lra": 8.3,
"duration_s": 46.0,
"sample_rate": 48000
},
"warnings": []
}
[exit 0]
{
"ok": true,
"out": "<work>/music/short/out/cut_scored.mp4",
"returns": "the video with the ducked mix",
"duration_s": 20.0,
"remuxed_video": true,
"settings": {
"music_gain_db": 0.0,
"threshold": 0.03,
"ratio": 4,
"attack_ms": 40,
"release_ms": 500
},
"next": "run measure on the result and master it to the destination preset"
}
[exit 0]
The crossfades start on the hits (24.0 and 34.0). The score was mastered before ducking, so score_web.wav stays the music stem at -15.9 LUFS for the film's own mix; cut_scored.mp4 is the review copy with the video stream copied unchanged. Here the stand-in cut is 20 seconds, shorter than the score, so the review copy is 20 seconds long (duck's length).
A track from a web generator that went quiet for its last 6 seconds, finished for streaming: measure, trim with a fade, master. edit creates out/ when it is missing. Keep the plan and date it was made on in the ledger (FAQ).
python mw.py measure quiet_end.wav
python mw.py edit quiet_end.wav --end 20 --fade-out 3 --out out/song.wav
python mw.py master out/song.wav --preset streaming --out out/song_master.wav{
"ok": true,
"files": [
{
"file": "quiet_end.wav",
"duration_s": 26.0,
"sample_rate": 48000,
"channels": 1,
"codec": "pcm_s16le",
"lufs_i": -21.8,
"lra": 1.8,
"true_peak_dbtp": -18.1,
"head_silence_s": 0.0,
"tail_silence_s": 6.0,
"gaps": [],
"sample_peak_db": -18.063921,
"flat_factor": 0.0,
"warnings": [
"6.0 s of silence at the end (render went quiet early: trim or re-roll)"
]
}
]
}
[exit 0]
{
"ok": true,
"out": "<work>/out/song.wav",
"length_s": 20.0,
"duration_s": 20.0,
"sample_rate": 48000,
"channels": 1,
"codec": "pcm_s24le"
}
[exit 0]
{
"ok": true,
"out": "<work>/out/song_master.wav",
"preset": "streaming",
"target": {
"lufs": -14,
"true_peak": -1.0
},
"preset_note": "Spotify normalises to -14 LUFS; keep TP below -1 dBTP (-2 if the master is louder than -14). YouTube turns loud tracks down to about -14.",
"lra_hint": "wide is fine: normalisation turns loud masters down, so dynamics cost nothing here",
"normalization": "linear",
"before": {
"lufs_i": -22.0,
"true_peak_dbtp": -18.1,
"lra": 0.3
},
"after": {
"lufs_i": -13.8,
"true_peak_dbtp": -9.9,
"lra": 0.3,
"duration_s": 20.0,
"sample_rate": 48000
},
"warnings": []
}
[exit 0]
The trimmed file is 20 seconds of 24-bit WAV; master raised it 8.2 LU (from -22.0 to -13.8 LUFS) with one gain, and the true peak stayed far below the -1 dBTP ceiling.
The agent cannot hear the takes, and a listener hears the louder of two copies as better, so the hub and produce skills hand over matched copies, not the raw takes. The steps, each with its output on Commands:
- Look and measure:
sheet --measureon every take, thenmixcheck(with--lowestwhen the brief names a solo instrument). The flags say what to listen for: BELOW-RANGE on a flute solo usually means a drone or bass under it (mixcheck). - Write matched copies:
preview <takes> --out <folder> --blind --seed <n>. The listener opens the folder and rankstake_A,take_Band so on; the key stays beside the folder until the ranking is in (preview).--as phoneand--as quietgive the small-speaker and low-level checks. - Record the words:
verdict <take> keep|reject|maybe --note "<their words>"for each take, by its real name from the key (verdict). - Change one knob on the kept seed and compare again on matched copies. The generate skill stops after three or four changes that no longer help.
For a layer over a kept take, pulse says whether the lead has a beat to lock to, gen --task lego renders the part, duck --stem makes it answer, and answer checks that it sits in the lead's rests (Commands).
This wiki describes musicwright 0.1.19 (tag v0.1.19, commit 3211a94) and was last updated on 2026-11-07. The plugin is MIT licensed. Report problems in the issues.
Using it
- Getting started
- Commands
- Recipes and loudness presets
- The project contract and studio
- Workflows
- Errors and edge cases
- FAQ
- Works with
The skills
- musicwright (hub)
- musicwright-generate
- musicwright-compose
- musicwright-produce
- musicwright-game
- musicwright-score
- musicwright-curate
The releases
Contributing
Elsewhere