Skip to content

Commands

m4bwav edited this page Nov 7, 2026 · 9 revisions

mw.py 0.1.19 has 27 commands. Every one prints exactly one JSON object on standard output, indented by one space. A failure prints {"ok": false, "command": ..., "error": ...} and exits 1; an argument error is printed by Python's argparse instead, as usage text on standard error with exit code 2 (Errors). Paths in out, dir and sheet fields are absolute; paths in file fields are as you typed them.

In the outputs below, [exit N] is the exit code, added by the program that ran the examples; <work> is the scratch folder they ran in. Most examples use the stand-in files described on Workflows. Since 0.1.1 every command that writes a file creates the output's folder when it is missing (Errors).

Group Commands
Set up doctor, new
Generate gen
Measure and look measure, sheet, mixcheck, compare, analyze, pulse, curve, answer
Listen fairly preview
Finish master, edit, join, loop, seam, diff, duck, mix, monobass
Notation render, notate, transcribe
Remember verdict, ledger, note

The ten commands new in 0.1.1 are mix, pulse, answer, mixcheck, compare, preview, monobass, render, notate and transcribe. curve is new in 0.1.7.

Usage

python mw.py --help
The help text
usage: mw.py [-h] [--version]
             {doctor,new,gen,measure,sheet,master,edit,join,loop,seam,diff,duck,mix,analyze,pulse,curve,answer,mixcheck,compare,preview,monobass,render,notate,transcribe,verdict,ledger,note} ...

musicwright CLI: generate, measure, look at, finish and log music.

Standard-library Python 3.9+. Needs ffmpeg and ffprobe on PATH (or MUSICWRIGHT_FFMPEG
pointing at ffmpeg) for audio work; ComfyUI or the ACE-Step REST server only for `gen`.
Every command prints exactly one JSON object on stdout and fails soft with
{"ok": false, "error": ...}. Run `mw.py <command> -h` for options.

Commands
  doctor   what is installed and reachable (ffmpeg, ComfyUI hosts, music models, ACE-Step REST)
  new      scaffold a music project folder (brief.md, music.json, takes/, out/, sheets/)
  gen      render takes through ComfyUI (ACE-Step 1.5 XL, MiniMax Music 3) or the ACE-Step REST API,
           including parts added to an existing track (--task lego --src --track)
  measure  loudness (LUFS, LRA, true peak), duration, head and tail silence, clipping signs
  sheet    one PNG of spectrogram + waveform rows for several takes (the agent's way to look)
  master   two-pass loudness normalisation to a named preset
  edit     trim, fade and convert one file
  join     crossfade movements into one cue
  loop     make a seamless loop (tail crossfaded into head), optionally bar-aligned, and check the seam
  seam     score how audible a file's loop seam is
  diff     write what changed between two aligned versions as audio
  duck     duck music under dialogue or a video's own sound, optionally remux the video
  mix      layer stems (gain, offset, pan) into one file and write the aligned stems
  pulse    is there a beat: onsets, inter-onset spread, autocorrelation and grid fit (stdlib)
  answer   does a layered part answer the lead: its level in the lead's rests against under its notes
  mixcheck band balance, peak-to-loudness, loudness contour, stereo and low-end mono, with flags (stdlib)
  compare  mixcheck a take beside a reference the user owns, with the differences
  preview  loudness-matched copies for fair listening (optionally blind, phone-speaker or quiet)
  monobass fold the lows under a crossover to mono and leave the rest alone
  analyze  tempo, key, tuning drift, repetition and --sections (needs librosa; prints the uv one-liner when missing)
  render   notation to audio: ABC, ASCII tab, MusicXML or MIDI -> MIDI and audio (FluidSynth or a built-in synth)
  notate   convert between ABC, MusicXML, MIDI and ASCII tab
  transcribe audio to MIDI and notation (librosa pyin for one instrument, basic-pitch for several)
  verdict  record a listener's keep/reject/maybe with notes, copied to the studio
  ledger   list a project's takes with recipes and verdicts
  note     append a taste note, lesson or recipe to the studio

positional arguments:
  {doctor,new,gen,measure,sheet,master,edit,join,loop,seam,diff,duck,mix,analyze,pulse,curve,answer,mixcheck,compare,preview,monobass,render,notate,transcribe,verdict,ledger,note}
    doctor              what is installed and reachable
    new                 scaffold a music project folder
    gen                 render takes
    measure             loudness, peaks, silences
    sheet               spectrogram + waveform contact sheet
    master              two-pass loudness normalisation to a preset; --shared-
                        gain gives several files one gain
    edit                trim, fade, convert
    join                crossfade movements into one cue
    loop                make a seamless loop
    seam                score a loop seam
    diff                write the difference between two files
    duck                duck music under dialogue or a video's sound
    mix                 layer stems with gain, offset and pan into one file
    analyze             tempo, key, tuning, repetition and sections (librosa)
    pulse               is there a beat? onsets, IOI spread, autocorrelation,
                        grid fit (stdlib)
    curve               rank takes against a target loudness shape (film cues)
    answer              does a part answer the lead? its level in the lead's
                        rests vs under its notes
    mixcheck            band balance, peak-to-loudness, loudness contour,
                        stereo and low-end mono, with flags
    compare             mixcheck a take beside a reference, with the
                        differences
    preview             loudness-matched copies of takes for fair listening
    monobass            fold the lows under a crossover to mono, leave the
                        rest
    render              notation to audio: ABC, ASCII tab, MusicXML or MIDI ->
                        MIDI + WAV/FLAC
    notate              convert between notations: ABC, MusicXML, MIDI, ASCII
                        tab
    transcribe          audio to notation: one instrument (librosa pyin) or
                        polyphonic (basic-pitch) -> MIDI, ABC, MusicXML, tab
    verdict             record a listener's verdict on a take
    ledger              list takes, recipes and verdicts
    note                append to the studio notes

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
[exit 0]

Each command takes -h for its own options.

doctor

What is installed and reachable: ffmpeg and the five filters mw.py uses (ebur128, loudnorm, showspectrumpic, sidechaincompress, acrossfade), librosa, FluidSynth and a SoundFont (for render), basic-pitch (for transcribe), the studio folder, each ComfyUI host (version, GPU, VRAM, music models, queue), the ACE-Step REST server, and the recipes that can run. Option: --host (ComfyUI hosts, comma list; http:// may be left off). Output with nothing running and with a local ComfyUI: Getting started.

new

Scaffolds a project folder: brief.md, music.json, ledger.jsonl (empty), takes/, out/, sheets/. Options: --name (required), --use (required: game-loop, game-cue, film-cue, listening or song), --duration (seconds, default 120), --preset (default by use: game-music for game uses, web-video for film-cue, streaming for listening and song).

python mw.py new music/menu --name "Main menu" --use game-loop --duration 150
{
 "ok": true,
 "dir": "<work>/music/menu",
 "manifest": {
  "musicwright": "0.1.17",
  "name": "Main menu",
  "use": "game-loop",
  "duration_s": 150.0,
  "loudness_preset": "game-music",
  "created": "<now>",
  "ai_generated": true,
  "deliverables": [],
  "disclosure": null
 },
 "next": "fill brief.md, then mw.py gen ... --out music/menu/takes"
}
[exit 0]

The folder it made, and the brief it wrote:

ls music/menu
cat music/menu/brief.md
brief.md
ledger.jsonl
music.json
out/
sheets/
takes/
[exit 0]
# Main menu

- Use: game-loop (game-loop, game-cue, film-cue, listening, song)
- Length: 150.0 s
- Destination loudness preset: game-music
- Mood and story arc:
- Instruments (and ones to keep out):
- Tempo feel and key (or leave to the model):
- References described in words (never upload or name a living artist):
- Must hit (times in seconds, for film cues):

## Decisions
[exit 0]

new refuses a folder that already has music.json, and since 0.1.1 a --preset that is not in loudness.json (Errors). The fields of music.json are on The project contract and studio.

gen

Renders takes through ComfyUI (recipes acestep-xl-sft, acestep-xl-sft-classic, acestep-xl-sft-pack, acestep-xl-base, minimax-music3, stable-audio3-medium, yue2-3b-int8) or the ACE-Step REST server (recipes acestep-rest and acestep-rest-lego), downloads each take into --out as <name>_s<seed>.<ext>, measures it, and appends one take line per file to the ledger it finds at or above --out. Options:

Option Default Meaning
--recipe acestep-xl-sft a name from recipes.json
--caption, --caption-file what it sounds like (one is required, except for --task extract)
--lyrics, --lyrics-file [Instrumental] (ACE-Step), [instrumental] (MiniMax, REST) lyrics or section tags
--sections section tags joined by |, each becoming [tag] on its own paragraph
--duration 120, or the --src length for source tasks seconds
--bpm, --key 90 and C major on the ACE-Step graph tempo and key ("A minor")
--seeds from the clock comma list; one take per seed
--takes 3 how many seeds when --seeds is not given
--name, --out take, takes file names and folder
--host hosts from the environment, studio config or default ComfyUI hosts or the REST host; http:// may be left off
--cfg, --steps, --sampler, --scheduler, --shift the recipe's sampler overrides (--cfg, --steps and --shift also reach the REST server)
--planner the recipe's ACE-Step planner LM file (clip_name2)
--set a JSON object of recipe parameter overrides (merged into the payload on the REST route)
--task text2music cover, repaint, lego, complete or extract work from --src. On REST: all five. In ComfyUI: cover and repaint on the ACE-Step recipes, extract on acestep-xl-base
--src the source audio for --task, uploaded to the server
--track the part for lego and extract (woodwinds, brass, strings, drums and eight more), a comma list for complete
--start, --end, --strength, --model repaint or lego window, cover strength (0 to 1; in ComfyUI denoise is 1 - strength, and without it cover follows the semantic hints since 0.1.8), the server's DiT
--hints cover in ComfyUI: follow the source's semantic hints at denoise 1, the default since 0.1.8 when --strength is absent; refused with --strength or on REST
--timeout 3600 seconds to wait for the takes
--no-wait ComfyUI: queue, log each job as a queued ledger row and return
--collect DIR fetch, measure and log the finished --no-wait jobs in DIR's ledger
--dry-run print the graph or payload, submit nothing, create no folder

Without --seeds, the first seed is the current Unix time modulo 90,000 plus 1,000, and each further take adds 111. The ComfyUI route uses the first host in the list that answers and lists the recipe's diffusion model; --dry-run takes the first host without asking it.

The examples here are dry runs or use a stand-in server: no job was submitted to a model for this wiki. The default recipe for a 150-second menu theme at 96 bpm in D major, seed 4021:

python mw.py gen --caption "warm melodic electronica, soft synth pads, plucked bass, flute lead, hopeful, instrumental" --duration 150 --bpm 96 --key "D major" --seeds 4021 --name menu --out music/menu/takes --dry-run

The output is the ComfyUI API graph gen would queue: a UNET loader for the XL SFT model, the dual text encoder (0.6B and the 1.7B planner), ACE-Step's text encode node with the caption, [Instrumental], bpm, duration and key, an empty latent of 150 seconds, a KSampler at cfg 4.5, 50 steps, er_sde and linear_quadratic, the audio decoder and SaveAudio with the prefix musicwright/menu_s4021:

The dry-run output (about 150 lines)
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 4021,
   "graph": {
    "1": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "acestep_v1.5_xl_sft_bf16.safetensors",
      "weight_dtype": "default"
     }
    },
    "2": {
     "class_type": "DualCLIPLoader",
     "inputs": {
      "clip_name1": "qwen_0.6b_ace15.safetensors",
      "clip_name2": "qwen_1.7b_ace15.safetensors",
      "type": "ace",
      "device": "default"
     }
    },
    "3": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "4": {
     "class_type": "ModelSamplingAuraFlow",
     "inputs": {
      "shift": 3.0,
      "model": [
       "1",
       0
      ]
     }
    },
    "5": {
     "class_type": "TextEncodeAceStepAudio1.5",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "tags": "warm melodic electronica, soft synth pads, plucked bass, flute lead, hopeful, instrumental",
      "lyrics": "[Instrumental]",
      "seed": 4021,
      "bpm": 96,
      "duration": 150.0,
      "timesignature": "4",
      "language": "en",
      "keyscale": "D major",
      "generate_audio_codes": true,
      "cfg_scale": 2.0,
      "temperature": 0.85,
      "top_p": 0.9,
      "top_k": 0,
      "min_p": 0.0
     }
    },
    "6": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "5",
       0
      ]
     }
    },
    "7": {
     "class_type": "EmptyAceStep1.5LatentAudio",
     "inputs": {
      "seconds": 150.0,
      "batch_size": 1
     }
    },
    "8": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "positive": [
       "5",
       0
      ],
      "negative": [
       "6",
       0
      ],
      "latent_image": [
       "7",
       0
      ],
      "seed": 4021,
      "steps": 50,
      "cfg": 4.5,
      "sampler_name": "er_sde",
      "scheduler": "linear_quadratic",
      "denoise": 1.0
     }
    },
    "9": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "8",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "10": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "9",
       0
      ],
      "filename_prefix": "musicwright/menu_s4021"
     }
    }
   }
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_sft_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_1.7b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 4.5,
  "sampler": "er_sde",
  "scheduler": "linear_quadratic",
  "lm_cfg": 2.0,
  "temperature": 0.85,
  "top_p": 0.9,
  "timesignature": "4",
  "language": "en"
 }
}
[exit 0]

Section tags and overrides: two seeds of a flute solo, with --cfg 4 and the LM temperature raised through --set. The sections become the lyrics "[Intro - breathy flute]\n\n[Verse - melody]\n\n[Outro - fading flute]", the KSampler gets "cfg": 4.0, the text encoder "temperature": 1.0, and params at the end shows the merged recipe:

python mw.py gen --caption "solo flute, unaccompanied, breathy, intimate room" --sections "Intro - breathy flute|Verse - melody|Outro - fading flute" --duration 66 --bpm 66 --key "A minor" --seeds 63389,63500 --name flute --out music/flute/takes --cfg 4 --set '{"temperature":1.0}' --dry-run
The dry-run output (two graphs)
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 63389,
   "graph": {
    "1": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "acestep_v1.5_xl_sft_bf16.safetensors",
      "weight_dtype": "default"
     }
    },
    "2": {
     "class_type": "DualCLIPLoader",
     "inputs": {
      "clip_name1": "qwen_0.6b_ace15.safetensors",
      "clip_name2": "qwen_1.7b_ace15.safetensors",
      "type": "ace",
      "device": "default"
     }
    },
    "3": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "4": {
     "class_type": "ModelSamplingAuraFlow",
     "inputs": {
      "shift": 3.0,
      "model": [
       "1",
       0
      ]
     }
    },
    "5": {
     "class_type": "TextEncodeAceStepAudio1.5",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "tags": "solo flute, unaccompanied, breathy, intimate room",
      "lyrics": "[Intro - breathy flute]\n\n[Verse - melody]\n\n[Outro - fading flute]",
      "seed": 63389,
      "bpm": 66,
      "duration": 66.0,
      "timesignature": "4",
      "language": "en",
      "keyscale": "A minor",
      "generate_audio_codes": true,
      "cfg_scale": 2.0,
      "temperature": 1.0,
      "top_p": 0.9,
      "top_k": 0,
      "min_p": 0.0
     }
    },
    "6": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "5",
       0
      ]
     }
    },
    "7": {
     "class_type": "EmptyAceStep1.5LatentAudio",
     "inputs": {
      "seconds": 66.0,
      "batch_size": 1
     }
    },
    "8": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "positive": [
       "5",
       0
      ],
      "negative": [
       "6",
       0
      ],
      "latent_image": [
       "7",
       0
      ],
      "seed": 63389,
      "steps": 50,
      "cfg": 4.0,
      "sampler_name": "er_sde",
      "scheduler": "linear_quadratic",
      "denoise": 1.0
     }
    },
    "9": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "8",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "10": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "9",
       0
      ],
      "filename_prefix": "musicwright/flute_s63389"
     }
    }
   }
  },
  {
   "seed": 63500,
   "graph": {
    "1": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "acestep_v1.5_xl_sft_bf16.safetensors",
      "weight_dtype": "default"
     }
    },
    "2": {
     "class_type": "DualCLIPLoader",
     "inputs": {
      "clip_name1": "qwen_0.6b_ace15.safetensors",
      "clip_name2": "qwen_1.7b_ace15.safetensors",
      "type": "ace",
      "device": "default"
     }
    },
    "3": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "4": {
     "class_type": "ModelSamplingAuraFlow",
     "inputs": {
      "shift": 3.0,
      "model": [
       "1",
       0
      ]
     }
    },
    "5": {
     "class_type": "TextEncodeAceStepAudio1.5",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "tags": "solo flute, unaccompanied, breathy, intimate room",
      "lyrics": "[Intro - breathy flute]\n\n[Verse - melody]\n\n[Outro - fading flute]",
      "seed": 63500,
      "bpm": 66,
      "duration": 66.0,
      "timesignature": "4",
      "language": "en",
      "keyscale": "A minor",
      "generate_audio_codes": true,
      "cfg_scale": 2.0,
      "temperature": 1.0,
      "top_p": 0.9,
      "top_k": 0,
      "min_p": 0.0
     }
    },
    "6": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "5",
       0
      ]
     }
    },
    "7": {
     "class_type": "EmptyAceStep1.5LatentAudio",
     "inputs": {
      "seconds": 66.0,
      "batch_size": 1
     }
    },
    "8": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "positive": [
       "5",
       0
      ],
      "negative": [
       "6",
       0
      ],
      "latent_image": [
       "7",
       0
      ],
      "seed": 63500,
      "steps": 50,
      "cfg": 4.0,
      "sampler_name": "er_sde",
      "scheduler": "linear_quadratic",
      "denoise": 1.0
     }
    },
    "9": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "8",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "10": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "9",
       0
      ],
      "filename_prefix": "musicwright/flute_s63500"
     }
    }
   }
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_sft_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_1.7b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 4.0,
  "sampler": "er_sde",
  "scheduler": "linear_quadratic",
  "lm_cfg": 2.0,
  "temperature": 1.0,
  "top_p": 0.9,
  "timesignature": "4",
  "language": "en"
 }
}
[exit 0]

The acestep-xl-sft-classic recipe (the ComfyUI template's settings) with no --bpm or --key: the graph still says "bpm": 90 and "keyscale": "C major", and since 0.1.1 the result says so in filled_in and filled_note. Its params are cfg 7, euler, simple and the 4B planner:

python mw.py gen --recipe acestep-xl-sft-classic --caption "orchestral fanfare, brass, timpani, triumphant" --duration 20 --seeds 7 --name fanfare --out music/fanfare/takes --dry-run
The dry-run output
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 7,
   "graph": {
    "1": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "acestep_v1.5_xl_sft_bf16.safetensors",
      "weight_dtype": "default"
     }
    },
    "2": {
     "class_type": "DualCLIPLoader",
     "inputs": {
      "clip_name1": "qwen_0.6b_ace15.safetensors",
      "clip_name2": "qwen_4b_ace15.safetensors",
      "type": "ace",
      "device": "default"
     }
    },
    "3": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "4": {
     "class_type": "ModelSamplingAuraFlow",
     "inputs": {
      "shift": 3.0,
      "model": [
       "1",
       0
      ]
     }
    },
    "5": {
     "class_type": "TextEncodeAceStepAudio1.5",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "tags": "orchestral fanfare, brass, timpani, triumphant",
      "lyrics": "[Instrumental]",
      "seed": 7,
      "bpm": 90,
      "duration": 20.0,
      "timesignature": "4",
      "language": "en",
      "keyscale": "C major",
      "generate_audio_codes": true,
      "cfg_scale": 2.0,
      "temperature": 0.85,
      "top_p": 0.9,
      "top_k": 0,
      "min_p": 0.0
     }
    },
    "6": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "5",
       0
      ]
     }
    },
    "7": {
     "class_type": "EmptyAceStep1.5LatentAudio",
     "inputs": {
      "seconds": 20.0,
      "batch_size": 1
     }
    },
    "8": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "positive": [
       "5",
       0
      ],
      "negative": [
       "6",
       0
      ],
      "latent_image": [
       "7",
       0
      ],
      "seed": 7,
      "steps": 50,
      "cfg": 7.0,
      "sampler_name": "euler",
      "scheduler": "simple",
      "denoise": 1.0
     }
    },
    "9": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "8",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "10": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "9",
       0
      ],
      "filename_prefix": "musicwright/fanfare_s7"
     }
    }
   }
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_sft_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_4b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 7.0,
  "sampler": "euler",
  "scheduler": "simple",
  "lm_cfg": 2.0,
  "temperature": 0.85,
  "top_p": 0.9,
  "timesignature": "4",
  "language": "en"
 },
 "filled_in": [
  "bpm 90",
  "key C major"
 ],
 "filled_note": "the ACE-Step text encoder needs a tempo and a key, so the recipe's values were sent; pass --bpm and --key to choose them"
}
[exit 0]

MiniMax Music 3 with its three-heading caption in a file (caption.txt holds a Global Metadata, a Vocal Details and an Arrangement line). Its graph has no tempo or key input; max_duration is the duration times 1.2 (216 for 180 s), capped at 340:

python mw.py gen --recipe minimax-music3 --caption-file caption.txt --duration 180 --seeds 11 --name song --out music/song/takes --dry-run
The dry-run output
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 11,
   "graph": {
    "3": {
     "class_type": "CLIPLoader",
     "inputs": {
      "clip_name": "minimax_music3_text_encoder_pruned_int8_convrot.safetensors",
      "type": "minimax",
      "device": "default"
     }
    },
    "6": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "minimax_music3_dit_fp16.safetensors",
      "weight_dtype": "default"
     }
    },
    "7": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "minimax_music3_dav.safetensors"
     }
    },
    "13": {
     "class_type": "MiniMaxMusic3TextEncode",
     "inputs": {
      "clip": [
       "3",
       0
      ],
      "caption": "Global Metadata: indie folk, 2010s, warm and acoustic, 92 bpm\nVocal Details: none, instrumental\nArrangement: 0:00 fingerpicked guitar, 1:00 strings join, 2:30 guitar alone",
      "lyrics": "[instrumental]",
      "seed": 11,
      "max_duration": 216.0,
      "cfg_scale": 2.0,
      "top_k": 50
     }
    },
    "15": {
     "class_type": "EmptyMiniMaxMusic3LatentAudio",
     "inputs": {
      "seconds": [
       "13",
       1
      ],
      "batch_size": 1
     }
    },
    "10": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "13",
       0
      ]
     }
    },
    "9": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "6",
       0
      ],
      "seed": 11,
      "steps": 30,
      "cfg": 1.7,
      "sampler_name": "euler",
      "scheduler": "simple",
      "positive": [
       "13",
       0
      ],
      "negative": [
       "10",
       0
      ],
      "latent_image": [
       "15",
       0
      ],
      "denoise": 1.0
     }
    },
    "42": {
     "class_type": "VAEDecodeAudioTiled",
     "inputs": {
      "samples": [
       "9",
       0
      ],
      "vae": [
       "7",
       0
      ],
      "tile_size": 1536,
      "overlap": 64
     }
    },
    "35": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "42",
       0
      ],
      "filename_prefix": "musicwright/song_s11"
     }
    }
   }
  }
 ],
 "params": {
  "text_encoder": "minimax_music3_text_encoder_pruned_int8_convrot.safetensors",
  "unet": "minimax_music3_dit_fp16.safetensors",
  "vae": "minimax_music3_dav.safetensors",
  "steps": 30,
  "cfg": 1.7,
  "sampler": "euler",
  "scheduler": "simple",
  "lm_cfg": 2.0,
  "top_k": 50,
  "duration_pad": 1.2,
  "max_seconds": 340.0
 }
}
[exit 0]

Given --bpm and --key anyway, the same graph comes back unchanged and the result ends with "ignored": ["bpm", "key"] and a note to put them in the caption:

python mw.py gen --recipe minimax-music3 --caption-file caption.txt --duration 180 --bpm 92 --key "G major" --seeds 11 --name song --out music/song/takes --dry-run
The dry-run output
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 11,
   "graph": {
    "3": {
     "class_type": "CLIPLoader",
     "inputs": {
      "clip_name": "minimax_music3_text_encoder_pruned_int8_convrot.safetensors",
      "type": "minimax",
      "device": "default"
     }
    },
    "6": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "minimax_music3_dit_fp16.safetensors",
      "weight_dtype": "default"
     }
    },
    "7": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "minimax_music3_dav.safetensors"
     }
    },
    "13": {
     "class_type": "MiniMaxMusic3TextEncode",
     "inputs": {
      "clip": [
       "3",
       0
      ],
      "caption": "Global Metadata: indie folk, 2010s, warm and acoustic, 92 bpm\nVocal Details: none, instrumental\nArrangement: 0:00 fingerpicked guitar, 1:00 strings join, 2:30 guitar alone",
      "lyrics": "[instrumental]",
      "seed": 11,
      "max_duration": 216.0,
      "cfg_scale": 2.0,
      "top_k": 50
     }
    },
    "15": {
     "class_type": "EmptyMiniMaxMusic3LatentAudio",
     "inputs": {
      "seconds": [
       "13",
       1
      ],
      "batch_size": 1
     }
    },
    "10": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "13",
       0
      ]
     }
    },
    "9": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "6",
       0
      ],
      "seed": 11,
      "steps": 30,
      "cfg": 1.7,
      "sampler_name": "euler",
      "scheduler": "simple",
      "positive": [
       "13",
       0
      ],
      "negative": [
       "10",
       0
      ],
      "latent_image": [
       "15",
       0
      ],
      "denoise": 1.0
     }
    },
    "42": {
     "class_type": "VAEDecodeAudioTiled",
     "inputs": {
      "samples": [
       "9",
       0
      ],
      "vae": [
       "7",
       0
      ],
      "tile_size": 1536,
      "overlap": 64
     }
    },
    "35": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "42",
       0
      ],
      "filename_prefix": "musicwright/song_s11"
     }
    }
   }
  }
 ],
 "params": {
  "text_encoder": "minimax_music3_text_encoder_pruned_int8_convrot.safetensors",
  "unet": "minimax_music3_dit_fp16.safetensors",
  "vae": "minimax_music3_dav.safetensors",
  "steps": 30,
  "cfg": 1.7,
  "sampler": "euler",
  "scheduler": "simple",
  "lm_cfg": 2.0,
  "top_k": 50,
  "duration_pad": 1.2,
  "max_seconds": 340.0
 },
 "ignored": [
  "bpm",
  "key"
 ],
 "ignored_note": "this model has no tempo or key input; put them in the caption"
}
[exit 0]

The REST route prints one payload per seed, and since 0.1.1 the task. It takes --bpm and --key (as bpm and key_scale):

python mw.py gen --recipe acestep-rest --caption "lofi hip hop, dusty drums, mellow piano, instrumental" --duration 60 --bpm 80 --seeds 1,2 --name draft --out music/drafts --dry-run
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8001",
 "task": "text2music",
 "jobs": [
  {
   "seed": 1,
   "payload": {
    "audio_duration": 60.0,
    "audio_format": "wav",
    "batch_size": 1,
    "thinking": true,
    "prompt": "lofi hip hop, dusty drums, mellow piano, instrumental",
    "lyrics": "[instrumental]",
    "use_random_seed": false,
    "seed": 1,
    "bpm": 80
   }
  },
  {
   "seed": 2,
   "payload": {
    "audio_duration": 60.0,
    "audio_format": "wav",
    "batch_size": 1,
    "thinking": true,
    "prompt": "lofi hip hop, dusty drums, mellow piano, instrumental",
    "lyrics": "[instrumental]",
    "use_random_seed": false,
    "seed": 2,
    "bpm": 80
   }
  }
 ]
}
[exit 0]

A host given without http:// gets it added (in 0.1.0 it read as unreachable):

python mw.py gen --recipe acestep-rest --caption "ambient pads" --duration 30 --seeds 5 --host 127.0.0.1:8001 --dry-run
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8001",
 "task": "text2music",
 "jobs": [
  {
   "seed": 5,
   "payload": {
    "audio_duration": 30.0,
    "audio_format": "wav",
    "batch_size": 1,
    "thinking": true,
    "prompt": "ambient pads",
    "lyrics": "[instrumental]",
    "use_random_seed": false,
    "seed": 5
   }
  }
 ]
}
[exit 0]

Adding a part to a kept take

--task lego asks the REST server for one new part that plays along with --src. The recipe acestep-rest-lego (kept by a listener on 2026-10-18, per its source) needs the server started on the 2B base model. The payload turns the planner off (thinking, use_cot_caption and use_cot_language false) so the new part hears the source, turns DCW off and asks for 50 steps; the duration is the source's length (45 s here), and the source is uploaded as src_audio:

python mw.py gen --recipe acestep-rest-lego --task lego --src take.wav --track woodwinds --caption "jazzy flute answering the lead, warm room" --bpm 96 --key "A major" --seeds 8101 --name reply --out music/reply/takes --dry-run
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8001",
 "task": "lego",
 "jobs": [
  {
   "seed": 8101,
   "payload": {
    "audio_duration": 45.0,
    "audio_format": "wav",
    "batch_size": 1,
    "thinking": false,
    "prompt": "jazzy flute answering the lead, warm room",
    "lyrics": "[instrumental]",
    "use_random_seed": false,
    "seed": 8101,
    "bpm": 96,
    "key_scale": "A major",
    "task_type": "lego",
    "use_cot_caption": false,
    "use_cot_language": false,
    "dcw_enabled": false,
    "track_name": "woodwinds",
    "inference_steps": 50
   },
   "upload": {
    "src_audio": "take.wav"
   }
  }
 ]
}
[exit 0]

The task options are checked before anything is created or sent:

python mw.py gen --task lego --src take.wav --track woodwinds --caption "flute" --dry-run
python mw.py gen --recipe acestep-rest-lego --task lego --src take.wav --track flute --caption "flute" --dry-run
python mw.py gen --recipe acestep-rest-lego --task lego --src take.wav --caption "flute" --dry-run
python mw.py gen --recipe acestep-rest --track woodwinds --caption "flute" --dry-run
{
 "ok": false,
 "command": "gen",
 "error": "--task lego runs on the ACE-Step REST server; use --recipe acestep-rest (in ComfyUI the ACE-Step recipes do cover and repaint, acestep-xl-base does extract)"
}
[exit 1]
{
 "ok": false,
 "command": "gen",
 "error": "unknown track flute; ACE-Step knows woodwinds, brass, fx, synth, strings, percussion, keyboard, guitar, bass, drums, backing_vocals, vocals (a flute is woodwinds)"
}
[exit 1]
{
 "ok": false,
 "command": "gen",
 "error": "--task lego needs --track, one of: woodwinds, brass, fx, synth, strings, percussion, keyboard, guitar, bass, drums, backing_vocals, vocals"
}
[exit 1]
{
 "ok": false,
 "command": "gen",
 "error": "--src and --track need --task (cover, repaint, lego, complete or extract)"
}
[exit 1]

A real run returns the host, the queue before submitting, the jobs, the merged parameters, elapsed_s, each take's file and measure numbers (duration, loudness, true peak, tail silence, warnings) and the ledger path. That output is not shown here because no take was rendered for this wiki. gen's other errors are on Errors and edge cases.

Cover, repaint and extract inside ComfyUI

Since 0.1.6, --task cover and --task repaint run on the ACE-Step ComfyUI recipes, and since 0.1.7 --task extract runs on acestep-xl-base. gen uploads --src to ComfyUI's input/musicwright folder. With --strength, cover is a partial denoise of the encoded source at 1 - --strength; without it, since 0.1.8, cover follows the semantic hints, which won one listener's blind pair against a plain cover at denoise 0.7. Repaint uses the AudioLatentRepaintMask node.

The other custom nodes, MWAceStep15TaskTextEncode, MWAceStep15ExtractGuider and MWAceStep15CoverGuider, are vendored from ComfyUI_RyanOnTheInside at 52daf66 (MIT) with its import-time mask patch left out. All of them ship in skills/musicwright/comfy_nodes/musicwright_nodes: copy that folder into ComfyUI's custom_nodes and restart ComfyUI. A real run checks the host for the node first (Errors).

python mw.py gen --task cover --src take.wav --strength 0.7 --caption "warm felt piano, same tune" --duration 45 --bpm 96 --key "A minor" --seeds 21 --name cover --out music/cover/takes --dry-run
The dry run
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 21,
   "graph": {
    "1": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "acestep_v1.5_xl_sft_bf16.safetensors",
      "weight_dtype": "default"
     }
    },
    "2": {
     "class_type": "DualCLIPLoader",
     "inputs": {
      "clip_name1": "qwen_0.6b_ace15.safetensors",
      "clip_name2": "qwen_1.7b_ace15.safetensors",
      "type": "ace",
      "device": "default"
     }
    },
    "3": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "4": {
     "class_type": "ModelSamplingAuraFlow",
     "inputs": {
      "shift": 3.0,
      "model": [
       "1",
       0
      ]
     }
    },
    "5": {
     "class_type": "TextEncodeAceStepAudio1.5",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "tags": "warm felt piano, same tune",
      "lyrics": "[Instrumental]",
      "seed": 21,
      "bpm": 96,
      "duration": 45.0,
      "timesignature": "4",
      "language": "en",
      "keyscale": "A minor",
      "generate_audio_codes": false,
      "cfg_scale": 2.0,
      "temperature": 0.85,
      "top_p": 0.9,
      "top_k": 0,
      "min_p": 0.0
     }
    },
    "6": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "5",
       0
      ]
     }
    },
    "7": {
     "class_type": "VAEEncodeAudio",
     "inputs": {
      "audio": [
       "11",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "8": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "positive": [
       "5",
       0
      ],
      "negative": [
       "6",
       0
      ],
      "latent_image": [
       "7",
       0
      ],
      "seed": 21,
      "steps": 50,
      "cfg": 4.5,
      "sampler_name": "er_sde",
      "scheduler": "linear_quadratic",
      "denoise": 0.3
     }
    },
    "9": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "8",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "10": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "9",
       0
      ],
      "filename_prefix": "musicwright/cover_s21"
     }
    },
    "11": {
     "class_type": "LoadAudio",
     "inputs": {
      "audio": "musicwright/take.wav"
     }
    }
   }
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_sft_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_1.7b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 4.5,
  "sampler": "er_sde",
  "scheduler": "linear_quadratic",
  "lm_cfg": 2.0,
  "temperature": 0.85,
  "top_p": 0.9,
  "timesignature": "4",
  "language": "en"
 }
}
[exit 0]
python mw.py gen --task repaint --src take.wav --start 10 --end 20 --caption "warm felt piano" --duration 45 --bpm 96 --key "A minor" --seeds 22 --name fix --out music/fix/takes --dry-run
The dry run
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 22,
   "graph": {
    "1": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "acestep_v1.5_xl_sft_bf16.safetensors",
      "weight_dtype": "default"
     }
    },
    "2": {
     "class_type": "DualCLIPLoader",
     "inputs": {
      "clip_name1": "qwen_0.6b_ace15.safetensors",
      "clip_name2": "qwen_1.7b_ace15.safetensors",
      "type": "ace",
      "device": "default"
     }
    },
    "3": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "4": {
     "class_type": "ModelSamplingAuraFlow",
     "inputs": {
      "shift": 3.0,
      "model": [
       "1",
       0
      ]
     }
    },
    "5": {
     "class_type": "TextEncodeAceStepAudio1.5",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "tags": "warm felt piano",
      "lyrics": "[Instrumental]",
      "seed": 22,
      "bpm": 96,
      "duration": 45.0,
      "timesignature": "4",
      "language": "en",
      "keyscale": "A minor",
      "generate_audio_codes": false,
      "cfg_scale": 2.0,
      "temperature": 0.85,
      "top_p": 0.9,
      "top_k": 0,
      "min_p": 0.0
     }
    },
    "6": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "5",
       0
      ]
     }
    },
    "7": {
     "class_type": "AudioLatentRepaintMask",
     "inputs": {
      "samples": [
       "12",
       0
      ],
      "start_s": 10.0,
      "end_s": 20.0,
      "fade_s": 0.0,
      "frames_per_s": 25.0
     }
    },
    "8": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "positive": [
       "5",
       0
      ],
      "negative": [
       "6",
       0
      ],
      "latent_image": [
       "7",
       0
      ],
      "seed": 22,
      "steps": 50,
      "cfg": 4.5,
      "sampler_name": "er_sde",
      "scheduler": "linear_quadratic",
      "denoise": 1.0
     }
    },
    "9": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "8",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "10": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "9",
       0
      ],
      "filename_prefix": "musicwright/fix_s22"
     }
    },
    "11": {
     "class_type": "LoadAudio",
     "inputs": {
      "audio": "musicwright/take.wav"
     }
    },
    "12": {
     "class_type": "VAEEncodeAudio",
     "inputs": {
      "audio": [
       "11",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    }
   }
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_sft_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_1.7b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 4.5,
  "sampler": "er_sde",
  "scheduler": "linear_quadratic",
  "lm_cfg": 2.0,
  "temperature": 0.85,
  "top_p": 0.9,
  "timesignature": "4",
  "language": "en"
 }
}
[exit 0]

Extract takes no caption:

python mw.py gen --recipe acestep-xl-base --task extract --src take.wav --track drums --duration 45 --seeds 31 --name drums --out music/parts --dry-run
The dry run
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 31,
   "graph": {
    "1": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "acestep_v1.5_xl_base_bf16.safetensors",
      "weight_dtype": "default"
     }
    },
    "2": {
     "class_type": "DualCLIPLoader",
     "inputs": {
      "clip_name1": "qwen_0.6b_ace15.safetensors",
      "clip_name2": "qwen_1.7b_ace15.safetensors",
      "type": "ace",
      "device": "default"
     }
    },
    "3": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "4": {
     "class_type": "ModelSamplingAuraFlow",
     "inputs": {
      "shift": 3.0,
      "model": [
       "1",
       0
      ]
     }
    },
    "5": {
     "class_type": "MWAceStep15TaskTextEncode",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "text": "",
      "task_type": "extract",
      "track_name": "drums",
      "lyrics": "",
      "bpm": 90,
      "duration": 45.0,
      "keyscale": "C major",
      "timesignature": "4",
      "language": "en",
      "seed": 31
     }
    },
    "6": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "5",
       0
      ]
     }
    },
    "8": {
     "class_type": "SamplerCustomAdvanced",
     "inputs": {
      "noise": [
       "16",
       0
      ],
      "guider": [
       "13",
       0
      ],
      "sampler": [
       "14",
       0
      ],
      "sigmas": [
       "15",
       0
      ],
      "latent_image": [
       "12",
       0
      ]
     }
    },
    "9": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "8",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "10": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "9",
       0
      ],
      "filename_prefix": "musicwright/drums_s31"
     }
    },
    "11": {
     "class_type": "LoadAudio",
     "inputs": {
      "audio": "musicwright/take.wav"
     }
    },
    "12": {
     "class_type": "VAEEncodeAudio",
     "inputs": {
      "audio": [
       "11",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "13": {
     "class_type": "MWAceStep15ExtractGuider",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "positive": [
       "5",
       0
      ],
      "negative": [
       "6",
       0
      ],
      "cfg": 7.0,
      "source_latents": [
       "12",
       0
      ],
      "track_name": "drums"
     }
    },
    "14": {
     "class_type": "KSamplerSelect",
     "inputs": {
      "sampler_name": "er_sde"
     }
    },
    "15": {
     "class_type": "BasicScheduler",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "scheduler": "linear_quadratic",
      "steps": 50,
      "denoise": 1.0
     }
    },
    "16": {
     "class_type": "RandomNoise",
     "inputs": {
      "noise_seed": 31
     }
    }
   }
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_base_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_1.7b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 7.0,
  "sampler": "er_sde",
  "scheduler": "linear_quadratic",
  "lm_cfg": 2.0,
  "temperature": 0.85,
  "top_p": 0.9,
  "timesignature": "4",
  "language": "en"
 },
 "filled_in": [
  "bpm 90",
  "key C major"
 ],
 "filled_note": "the ACE-Step text encoder needs a tempo and a key, so the recipe's values were sent; pass --bpm and --key to choose them"
}
[exit 0]

--hints (implied since 0.1.8 when --strength is absent) replaces the partial denoise with MWAceStep15CoverGuider at denoise 1:

python mw.py gen --task cover --hints --src take.wav --caption "warm felt piano, same tune" --duration 45 --bpm 96 --key "A minor" --seeds 32 --name hints --out music/cover/takes --dry-run
The dry run
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 32,
   "graph": {
    "1": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "acestep_v1.5_xl_sft_bf16.safetensors",
      "weight_dtype": "default"
     }
    },
    "2": {
     "class_type": "DualCLIPLoader",
     "inputs": {
      "clip_name1": "qwen_0.6b_ace15.safetensors",
      "clip_name2": "qwen_1.7b_ace15.safetensors",
      "type": "ace",
      "device": "default"
     }
    },
    "3": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "4": {
     "class_type": "ModelSamplingAuraFlow",
     "inputs": {
      "shift": 3.0,
      "model": [
       "1",
       0
      ]
     }
    },
    "5": {
     "class_type": "MWAceStep15TaskTextEncode",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "text": "warm felt piano, same tune",
      "task_type": "cover",
      "track_name": "None",
      "lyrics": "[Instrumental]",
      "bpm": 96,
      "duration": 45.0,
      "keyscale": "A minor",
      "timesignature": "4",
      "language": "en",
      "seed": 32
     }
    },
    "6": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "5",
       0
      ]
     }
    },
    "8": {
     "class_type": "SamplerCustomAdvanced",
     "inputs": {
      "noise": [
       "16",
       0
      ],
      "guider": [
       "13",
       0
      ],
      "sampler": [
       "14",
       0
      ],
      "sigmas": [
       "15",
       0
      ],
      "latent_image": [
       "12",
       0
      ]
     }
    },
    "9": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "8",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "10": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "9",
       0
      ],
      "filename_prefix": "musicwright/hints_s32"
     }
    },
    "11": {
     "class_type": "LoadAudio",
     "inputs": {
      "audio": "musicwright/take.wav"
     }
    },
    "12": {
     "class_type": "VAEEncodeAudio",
     "inputs": {
      "audio": [
       "11",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "13": {
     "class_type": "MWAceStep15CoverGuider",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "positive": [
       "5",
       0
      ],
      "negative": [
       "6",
       0
      ],
      "cfg": 4.5,
      "source_latents": [
       "12",
       0
      ]
     }
    },
    "14": {
     "class_type": "KSamplerSelect",
     "inputs": {
      "sampler_name": "er_sde"
     }
    },
    "15": {
     "class_type": "BasicScheduler",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "scheduler": "linear_quadratic",
      "steps": 50,
      "denoise": 1.0
     }
    },
    "16": {
     "class_type": "RandomNoise",
     "inputs": {
      "noise_seed": 32
     }
    }
   }
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_sft_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_1.7b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 4.5,
  "sampler": "er_sde",
  "scheduler": "linear_quadratic",
  "lm_cfg": 2.0,
  "temperature": 0.85,
  "top_p": 0.9,
  "timesignature": "4",
  "language": "en"
 }
}
[exit 0]

The skill's references/acestep-rest.md and acestep.md hold what the project measured on one machine, none of it run for this wiki. Cover at strength 0.7 kept a 30-second source's structure with new timbre, and 0.85 was nearly a copy and clipped at 0 dBTP, so they advise 0.5 to 0.75. Repaint's kept audio comes back through a VAE round trip, with correlation 0.96 to 1.00. Extract's first run took 15 s warm for 30 s, but its drums and vocals takes of one source correlated 0.97, and the note calls isolation unproven until a listener checks it.

Stable Audio 3 and YuE2

New in 0.1.8. stable-audio3-medium takes its tempo and key from the caption. yue2-3b-int8 needs --lyrics, --lyrics-file or --sections, treats the caption as the style, and saves its ABC plan beside the take. The last two lines show the cover default (no --strength) and an extract:

python mw.py gen --recipe stable-audio3-medium --caption "calm ambient pads" --duration 20 --seeds 41 --name sa3 --out music/sa3 --dry-run
python mw.py gen --recipe yue2-3b-int8 --caption "folk rock" --lyrics "[verse] walking home" --duration 30 --seeds 42 --name yue --out music/yue --dry-run
python mw.py gen --recipe yue2-3b-int8 --caption "folk rock" --dry-run
python mw.py gen --task cover --src take.wav --caption "warm felt piano, same tune" --duration 45 --seeds 43 --name defcover --out music/cover/takes --dry-run
python mw.py gen --recipe acestep-xl-base --task extract --src take.wav --track vocals --seeds 44 --name vox --out music/parts --dry-run
The dry runs
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 41,
   "graph": {
    "1": {
     "class_type": "CheckpointLoaderSimple",
     "inputs": {
      "ckpt_name": "stable_audio_3_medium.safetensors"
     }
    },
    "2": {
     "class_type": "CLIPLoader",
     "inputs": {
      "clip_name": "t5gemma_b_b_ul2.safetensors",
      "type": "stable_audio",
      "device": "default"
     }
    },
    "3": {
     "class_type": "CLIPTextEncode",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "text": "calm ambient pads"
     }
    },
    "4": {
     "class_type": "CLIPTextEncode",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "text": ""
     }
    },
    "5": {
     "class_type": "EmptyLatentAudio",
     "inputs": {
      "seconds": 20.0,
      "batch_size": 1
     }
    },
    "6": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "1",
       0
      ],
      "seed": 41,
      "steps": 8,
      "cfg": 1.0,
      "sampler_name": "lcm",
      "scheduler": "simple",
      "positive": [
       "3",
       0
      ],
      "negative": [
       "4",
       0
      ],
      "latent_image": [
       "5",
       0
      ],
      "denoise": 1.0
     }
    },
    "7": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "6",
       0
      ],
      "vae": [
       "1",
       2
      ]
     }
    },
    "8": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "7",
       0
      ],
      "filename_prefix": "musicwright/sa3_s41"
     }
    }
   }
  }
 ],
 "params": {
  "checkpoint": "stable_audio_3_medium.safetensors",
  "clip": "t5gemma_b_b_ul2.safetensors",
  "steps": 8,
  "cfg": 1.0,
  "sampler": "lcm",
  "scheduler": "simple"
 }
}
[exit 0]
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 42,
   "graph": {
    "1": {
     "class_type": "CheckpointLoaderSimple",
     "inputs": {
      "ckpt_name": "yue2_3b_int8_convrot.safetensors"
     }
    },
    "2": {
     "class_type": "YuE2GenerateABC",
     "inputs": {
      "clip": [
       "1",
       1
      ],
      "style": "folk rock",
      "lyrics": "[verse] walking home",
      "seed": 42,
      "mode": "full",
      "max_abc_tokens": 8192,
      "temperature": 0.7,
      "top_p": 0.9,
      "top_k": 30,
      "repetition_penalty": 1.005,
      "penalty_window": 100
     }
    },
    "3": {
     "class_type": "YuE2GenerateMusic",
     "inputs": {
      "clip": [
       "1",
       1
      ],
      "style": "folk rock",
      "lyrics": "[verse] walking home",
      "abc": [
       "2",
       0
      ],
      "seed": 42,
      "mode": "full",
      "max_duration": 30.0,
      "temperature": 1.0,
      "top_p": 0.95,
      "top_k": 100,
      "repetition_penalty": 1.2
     }
    },
    "4": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "3",
       0
      ]
     }
    },
    "5": {
     "class_type": "EmptyYuE2LatentAudio",
     "inputs": {
      "seconds": [
       "3",
       1
      ],
      "batch_size": 1
     }
    },
    "6": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "1",
       0
      ],
      "seed": 42,
      "steps": 32,
      "cfg": 1.0,
      "sampler_name": "dpm_2",
      "scheduler": "sgm_uniform",
      "positive": [
       "3",
       0
      ],
      "negative": [
       "4",
       0
      ],
      "latent_image": [
       "5",
       0
      ],
      "denoise": 1.0
     }
    },
    "7": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "6",
       0
      ],
      "vae": [
       "1",
       2
      ]
     }
    },
    "8": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "7",
       0
      ],
      "filename_prefix": "musicwright/yue_s42"
     }
    },
    "9": {
     "class_type": "PreviewAny",
     "inputs": {
      "source": [
       "2",
       0
      ]
     }
    }
   }
  }
 ],
 "params": {
  "checkpoint": "yue2_3b_int8_convrot.safetensors",
  "melody_encoder": "sheetsage2_bf16.safetensors",
  "max_abc_tokens": 8192,
  "abc_temperature": 0.7,
  "abc_top_p": 0.9,
  "abc_top_k": 30,
  "abc_repetition_penalty": 1.005,
  "abc_penalty_window": 100,
  "music_temperature": 1.0,
  "music_top_p": 0.95,
  "music_top_k": 100,
  "music_repetition_penalty": 1.2,
  "steps": 32,
  "cfg": 1.0,
  "sampler": "dpm_2",
  "scheduler": "sgm_uniform"
 }
}
[exit 0]
{
 "ok": false,
 "command": "gen",
 "error": "YuE2 sings from lyrics: give --lyrics, --lyrics-file or --sections"
}
[exit 1]
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 43,
   "graph": {
    "1": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "acestep_v1.5_xl_sft_bf16.safetensors",
      "weight_dtype": "default"
     }
    },
    "2": {
     "class_type": "DualCLIPLoader",
     "inputs": {
      "clip_name1": "qwen_0.6b_ace15.safetensors",
      "clip_name2": "qwen_1.7b_ace15.safetensors",
      "type": "ace",
      "device": "default"
     }
    },
    "3": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "4": {
     "class_type": "ModelSamplingAuraFlow",
     "inputs": {
      "shift": 3.0,
      "model": [
       "1",
       0
      ]
     }
    },
    "5": {
     "class_type": "MWAceStep15TaskTextEncode",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "text": "warm felt piano, same tune",
      "task_type": "cover",
      "track_name": "None",
      "lyrics": "[Instrumental]",
      "bpm": 90,
      "duration": 45.0,
      "keyscale": "C major",
      "timesignature": "4",
      "language": "en",
      "seed": 43
     }
    },
    "6": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "5",
       0
      ]
     }
    },
    "8": {
     "class_type": "SamplerCustomAdvanced",
     "inputs": {
      "noise": [
       "16",
       0
      ],
      "guider": [
       "13",
       0
      ],
      "sampler": [
       "14",
       0
      ],
      "sigmas": [
       "15",
       0
      ],
      "latent_image": [
       "12",
       0
      ]
     }
    },
    "9": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "8",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "10": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "9",
       0
      ],
      "filename_prefix": "musicwright/defcover_s43"
     }
    },
    "11": {
     "class_type": "LoadAudio",
     "inputs": {
      "audio": "musicwright/take.wav"
     }
    },
    "12": {
     "class_type": "VAEEncodeAudio",
     "inputs": {
      "audio": [
       "11",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "13": {
     "class_type": "MWAceStep15CoverGuider",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "positive": [
       "5",
       0
      ],
      "negative": [
       "6",
       0
      ],
      "cfg": 4.5,
      "source_latents": [
       "12",
       0
      ]
     }
    },
    "14": {
     "class_type": "KSamplerSelect",
     "inputs": {
      "sampler_name": "er_sde"
     }
    },
    "15": {
     "class_type": "BasicScheduler",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "scheduler": "linear_quadratic",
      "steps": 50,
      "denoise": 1.0
     }
    },
    "16": {
     "class_type": "RandomNoise",
     "inputs": {
      "noise_seed": 43
     }
    }
   }
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_sft_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_1.7b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 4.5,
  "sampler": "er_sde",
  "scheduler": "linear_quadratic",
  "lm_cfg": 2.0,
  "temperature": 0.85,
  "top_p": 0.9,
  "timesignature": "4",
  "language": "en"
 },
 "filled_in": [
  "bpm 90",
  "key C major"
 ],
 "filled_note": "the ACE-Step text encoder needs a tempo and a key, so the recipe's values were sent; pass --bpm and --key to choose them"
}
[exit 0]
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 44,
   "graph": {
    "1": {
     "class_type": "UNETLoader",
     "inputs": {
      "unet_name": "acestep_v1.5_xl_base_bf16.safetensors",
      "weight_dtype": "default"
     }
    },
    "2": {
     "class_type": "DualCLIPLoader",
     "inputs": {
      "clip_name1": "qwen_0.6b_ace15.safetensors",
      "clip_name2": "qwen_1.7b_ace15.safetensors",
      "type": "ace",
      "device": "default"
     }
    },
    "3": {
     "class_type": "VAELoader",
     "inputs": {
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "4": {
     "class_type": "ModelSamplingAuraFlow",
     "inputs": {
      "shift": 3.0,
      "model": [
       "1",
       0
      ]
     }
    },
    "5": {
     "class_type": "MWAceStep15TaskTextEncode",
     "inputs": {
      "clip": [
       "2",
       0
      ],
      "text": "",
      "task_type": "extract",
      "track_name": "vocals",
      "lyrics": "",
      "bpm": 90,
      "duration": 45.0,
      "keyscale": "C major",
      "timesignature": "4",
      "language": "en",
      "seed": 44
     }
    },
    "6": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "5",
       0
      ]
     }
    },
    "8": {
     "class_type": "SamplerCustomAdvanced",
     "inputs": {
      "noise": [
       "16",
       0
      ],
      "guider": [
       "13",
       0
      ],
      "sampler": [
       "14",
       0
      ],
      "sigmas": [
       "15",
       0
      ],
      "latent_image": [
       "12",
       0
      ]
     }
    },
    "9": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "8",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "10": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "9",
       0
      ],
      "filename_prefix": "musicwright/vox_s44"
     }
    },
    "11": {
     "class_type": "LoadAudio",
     "inputs": {
      "audio": "musicwright/take.wav"
     }
    },
    "12": {
     "class_type": "VAEEncodeAudio",
     "inputs": {
      "audio": [
       "11",
       0
      ],
      "vae": [
       "3",
       0
      ]
     }
    },
    "13": {
     "class_type": "MWAceStep15ExtractGuider",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "positive": [
       "5",
       0
      ],
      "negative": [
       "6",
       0
      ],
      "cfg": 7.0,
      "source_latents": [
       "12",
       0
      ],
      "track_name": "vocals"
     }
    },
    "14": {
     "class_type": "KSamplerSelect",
     "inputs": {
      "sampler_name": "er_sde"
     }
    },
    "15": {
     "class_type": "BasicScheduler",
     "inputs": {
      "model": [
       "4",
       0
      ],
      "scheduler": "linear_quadratic",
      "steps": 50,
      "denoise": 1.0
     }
    },
    "16": {
     "class_type": "RandomNoise",
     "inputs": {
      "noise_seed": 44
     }
    }
   }
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_base_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_1.7b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 7.0,
  "sampler": "er_sde",
  "scheduler": "linear_quadratic",
  "lm_cfg": 2.0,
  "temperature": 0.85,
  "top_p": 0.9,
  "timesignature": "4",
  "language": "en"
 },
 "filled_in": [
  "bpm 90",
  "key C major"
 ],
 "filled_note": "the ACE-Step text encoder needs a tempo and a key, so the recipe's values were sent; pass --bpm and --key to choose them"
}
[exit 0]

The SFT pack and the YuE2 melody cover

New in 0.1.13. acestep-xl-sft-pack runs through the optional ComfyUI-AceStep_SFT custom nodes, which gen and doctor check for. It does text to music only, so a cover on it is refused, and since 0.1.18 the refusal says so and names the recipes that can. --task cover on yue2-3b-int8 sings new style and lyrics over a melody that SheetSage2 transcribes from the source (melody_encoder in the recipe):

python mw.py gen --recipe acestep-xl-sft-pack --caption "calm ambient pads" --duration 30 --seeds 45 --name pack --out music/pack --dry-run
python mw.py gen --recipe acestep-xl-sft-pack --task cover --src take.wav --caption "x" --dry-run
python mw.py gen --recipe yue2-3b-int8 --task cover --src take.wav --caption "folk rock" --lyrics "[verse] walking home" --duration 30 --seeds 46 --name yuecover --out music/yuecover --dry-run
The dry runs
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 45,
   "graph": {
    "1": {
     "class_type": "AceStepSFTModelLoader",
     "inputs": {
      "diffusion_model": "acestep_v1.5_xl_sft_bf16.safetensors",
      "text_encoder_1": "qwen_0.6b_ace15.safetensors",
      "text_encoder_2": "qwen_1.7b_ace15.safetensors",
      "vae_name": "ace_1.5_vae.safetensors"
     }
    },
    "2": {
     "class_type": "AceStepSFTTextEncode",
     "inputs": {
      "clip": [
       "1",
       1
      ],
      "caption": "calm ambient pads",
      "lyrics": "[Instrumental]",
      "instrumental": true,
      "seed": 45,
      "duration": 30.0,
      "bpm": 90,
      "timesignature": "4",
      "language": "en",
      "keyscale": "C major"
     }
    },
    "3": {
     "class_type": "AceStepSFTGenerate",
     "inputs": {
      "model": [
       "1",
       0
      ],
      "positive": [
       "2",
       0
      ],
      "negative": [
       "2",
       1
      ],
      "vae": [
       "1",
       2
      ],
      "seed": 45,
      "steps": 50,
      "cfg": 7.0,
      "sampler_name": "jkass_quality",
      "scheduler": "ace_step",
      "denoise": 1.0,
      "duration": 30.0,
      "infer_method": "ode",
      "guidance_mode": "apg",
      "shift": 3.0
     }
    },
    "4": {
     "class_type": "AceStepSFTSaveAudio",
     "inputs": {
      "audio": [
       "3",
       5
      ],
      "filename_prefix": "musicwright/pack_s45",
      "format": "flac"
     }
    }
   }
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_sft_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_1.7b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 7.0,
  "sampler": "jkass_quality",
  "scheduler": "ace_step",
  "infer_method": "ode",
  "guidance_mode": "apg",
  "timesignature": "4",
  "language": "en"
 },
 "filled_in": [
  "bpm 90",
  "key C major"
 ],
 "filled_note": "the ACE-Step text encoder needs a tempo and a key, so the recipe's values were sent; pass --bpm and --key to choose them"
}
[exit 0]
{
 "ok": false,
 "command": "gen",
 "error": "acestep-xl-sft-pack does text to music only; for --task cover use --recipe acestep-xl-sft in ComfyUI or acestep-rest"
}
[exit 1]
{
 "ok": true,
 "dry_run": true,
 "host": "http://127.0.0.1:8188",
 "jobs": [
  {
   "seed": 46,
   "graph": {
    "1": {
     "class_type": "CheckpointLoaderSimple",
     "inputs": {
      "ckpt_name": "yue2_3b_int8_convrot.safetensors"
     }
    },
    "2": {
     "class_type": "SheetSage2AudioToABC",
     "inputs": {
      "audio_encoder": [
       "10",
       0
      ],
      "audio": [
       "11",
       0
      ],
      "mode": "melody"
     }
    },
    "3": {
     "class_type": "YuE2GenerateMusic",
     "inputs": {
      "clip": [
       "1",
       1
      ],
      "style": "folk rock",
      "lyrics": "[verse] walking home",
      "abc": [
       "2",
       0
      ],
      "seed": 46,
      "mode": "melody",
      "max_duration": 30.0,
      "temperature": 1.0,
      "top_p": 0.95,
      "top_k": 100,
      "repetition_penalty": 1.2
     }
    },
    "4": {
     "class_type": "ConditioningZeroOut",
     "inputs": {
      "conditioning": [
       "3",
       0
      ]
     }
    },
    "5": {
     "class_type": "EmptyYuE2LatentAudio",
     "inputs": {
      "seconds": [
       "3",
       1
      ],
      "batch_size": 1
     }
    },
    "6": {
     "class_type": "KSampler",
     "inputs": {
      "model": [
       "1",
       0
      ],
      "seed": 46,
      "steps": 32,
      "cfg": 1.0,
      "sampler_name": "dpm_2",
      "scheduler": "sgm_uniform",
      "positive": [
       "3",
       0
      ],
      "negative": [
       "4",
       0
      ],
      "latent_image": [
       "5",
       0
      ],
      "denoise": 1.0
     }
    },
    "7": {
     "class_type": "VAEDecodeAudio",
     "inputs": {
      "samples": [
       "6",
       0
      ],
      "vae": [
       "1",
       2
      ]
     }
    },
    "8": {
     "class_type": "SaveAudio",
     "inputs": {
      "audio": [
       "7",
       0
      ],
      "filename_prefix": "musicwright/yuecover_s46"
     }
    },
    "9": {
     "class_type": "PreviewAny",
     "inputs": {
      "source": [
       "2",
       0
      ]
     }
    },
    "10": {
     "class_type": "AudioEncoderLoader",
     "inputs": {
      "audio_encoder_name": "sheetsage2_bf16.safetensors"
     }
    },
    "11": {
     "class_type": "LoadAudio",
     "inputs": {
      "audio": "musicwright/take.wav"
     }
    }
   }
  }
 ],
 "params": {
  "checkpoint": "yue2_3b_int8_convrot.safetensors",
  "melody_encoder": "sheetsage2_bf16.safetensors",
  "max_abc_tokens": 8192,
  "abc_temperature": 0.7,
  "abc_top_p": 0.9,
  "abc_top_k": 30,
  "abc_repetition_penalty": 1.005,
  "abc_penalty_window": 100,
  "music_temperature": 1.0,
  "music_top_p": 0.95,
  "music_top_k": 100,
  "music_repetition_penalty": 1.2,
  "steps": 32,
  "cfg": 1.0,
  "sampler": "dpm_2",
  "scheduler": "sgm_uniform"
 }
}
[exit 0]

Queue now, collect later

--no-wait queues the jobs on ComfyUI, logs each as a queued row and returns. --collect asks each row's host about its job, then downloads, measures and logs what has finished, reports what is pending and logs a failed job once. These runs use a stand-in server inside the verification program, on port 18199, which serves tone.wav as every take and runs no model, so the measurements describe that file.

python mw.py gen --caption "slow harp, warm room" --duration 30 --seeds 4,5 --name harp --host http://127.0.0.1:18199 --out music/queue/takes --no-wait
{
 "ok": true,
 "queued": true,
 "host": "http://127.0.0.1:18199",
 "queue_before": {
  "running": 0,
  "pending": 0
 },
 "jobs": [
  {
   "seed": 4,
   "prompt_id": "p1"
  },
  {
   "seed": 5,
   "prompt_id": "p2"
  }
 ],
 "params": {
  "unet": "acestep_v1.5_xl_sft_bf16.safetensors",
  "clip1": "qwen_0.6b_ace15.safetensors",
  "clip2": "qwen_1.7b_ace15.safetensors",
  "vae": "ace_1.5_vae.safetensors",
  "shift": 3.0,
  "steps": 50,
  "cfg": 4.5,
  "sampler": "er_sde",
  "scheduler": "linear_quadratic",
  "lm_cfg": 2.0,
  "temperature": 0.85,
  "top_p": 0.9,
  "timesignature": "4",
  "language": "en"
 },
 "filled_in": [
  "bpm 90",
  "key C major"
 ],
 "filled_note": "the ACE-Step text encoder needs a tempo and a key, so the recipe's values were sent; pass --bpm and --key to choose them",
 "next": "mw.py gen --collect <work>/music/queue/takes downloads, measures and logs the takes that have finished; run it again for the rest",
 "ledger": "<work>/music/queue/ledger.jsonl"
}
[exit 0]

With the second job still running:

python mw.py gen --collect music/queue
{
 "ok": true,
 "ledger": "<work>/music/queue/ledger.jsonl",
 "takes": [
  {
   "seed": 4,
   "file": "<work>/music/queue/takes/harp_s4.wav",
   "prompt_id": "p1",
   "measure": {
    "duration_s": 12.0,
    "lufs_i": -13.3,
    "true_peak_dbtp": -5.2,
    "tail_silence_s": 0.0,
    "warnings": []
   }
  }
 ],
 "pending": [
  {
   "prompt_id": "p2",
   "seed": 5
  }
 ],
 "failed": [],
 "next": "run mw.py gen --collect again later for the pending jobs"
}
[exit 0]

Once it has finished, the same command fetches the rest:

{
 "ok": true,
 "ledger": "<work>/music/queue/ledger.jsonl",
 "takes": [
  {
   "seed": 5,
   "file": "<work>/music/queue/takes/harp_s5.wav",
   "prompt_id": "p2",
   "measure": {
    "duration_s": 12.0,
    "lufs_i": -13.3,
    "true_peak_dbtp": -5.2,
    "tail_silence_s": 0.0,
    "warnings": []
   }
  }
 ],
 "pending": [],
 "failed": [],
 "next": "mw.py sheet <takes> --out sheets/<name>.png, look at it, then ask the listener and record mw.py verdict"
}
[exit 0]

A third run finds nothing left to do:

{
 "ok": true,
 "ledger": "<work>/music/queue/ledger.jsonl",
 "takes": [],
 "pending": [],
 "failed": [],
 "next": "mw.py sheet <takes> --out sheets/<name>.png, look at it, then ask the listener and record mw.py verdict"
}
[exit 0]

measure

Duration, sample rate, channels, codec, integrated loudness (lufs_i), loudness range (lra), true peak, head and tail silence, interior gaps (up to 20), sample peak, flat factor and warnings, for each file. Options: --silence-db (default -50) and --silence-min (seconds, default 0.3) set what counts as silence.

python mw.py measure tone.wav take.wav
{
 "ok": true,
 "files": [
  {
   "file": "tone.wav",
   "duration_s": 12.0,
   "sample_rate": 8000,
   "channels": 1,
   "codec": "pcm_s16le",
   "lufs_i": -13.3,
   "lra": 0.0,
   "true_peak_dbtp": -5.2,
   "head_silence_s": 0.0,
   "tail_silence_s": 0.0,
   "gaps": [],
   "sample_peak_db": -5.199689,
   "flat_factor": 0.0,
   "warnings": []
  },
  {
   "file": "take.wav",
   "duration_s": 45.0,
   "sample_rate": 44100,
   "channels": 2,
   "codec": "pcm_s16le",
   "lufs_i": -16.0,
   "lra": 1.9,
   "true_peak_dbtp": -4.3,
   "head_silence_s": 0.0,
   "tail_silence_s": 0.0,
   "gaps": [],
   "sample_peak_db": -4.343293,
   "flat_factor": 0.0,
   "warnings": []
  }
 ]
}
[exit 0]

The warnings, from the code: more than 3 s of silence at the end, more than 1 s at the start, a true peak above -1 dBTP, "clipping likely" when the sample peak is above -0.1 dBFS with a flat factor over 20, and "no measurable loudness" for a silent file. A take that went quiet for its last 6 seconds and a tone 12 dB too hot: see Home. Measuring a file that is not there:

python mw.py measure nothing.wav
{
 "ok": false,
 "command": "measure",
 "error": "no such file: nothing.wav"
}
[exit 1]

sheet

One PNG with, per file, a spectrogram row (log frequency, 0 to --max-hz, time left to right) and a waveform row, stacked top to bottom in the order given. Options: --out (required; its folder is created), --width (1200), --spec-height (240), --wave-height (70), --max-hz (8000), --measure (also measure each file).

python mw.py sheet take.wav take_s1.flac quiet_end.wav --out sheets/demo.png --measure
{
 "ok": true,
 "sheet": "<work>/sheets/demo.png",
 "rows": [
  "take.wav",
  "take_s1.flac",
  "quiet_end.wav"
 ],
 "layout": "per take, top to bottom: spectrogram 1200x240 (log frequency, 0-8000 Hz, time left to right) then waveform 1200x70",
 "read_it": "open the PNG and look: one bright line with harmonics = one melodic voice; broad vertical stripes = drums; a wide low band = pad, drone or bass; dark columns = silence; a dark block at the end = the render went quiet",
 "measure": [
  {
   "file": "take.wav",
   "duration_s": 45.0,
   "sample_rate": 44100,
   "channels": 2,
   "codec": "pcm_s16le",
   "lufs_i": -16.0,
   "lra": 1.9,
   "true_peak_dbtp": -4.3,
   "head_silence_s": 0.0,
   "tail_silence_s": 0.0,
   "gaps": [],
   "sample_peak_db": -4.343293,
   "flat_factor": 0.0,
   "warnings": []
  },
  {
   "file": "take_s1.flac",
   "duration_s": 8.0,
   "sample_rate": 8000,
   "channels": 1,
   "codec": "flac",
   "lufs_i": -17.8,
   "lra": 1.9,
   "true_peak_dbtp": -10.5,
   "head_silence_s": 0.0,
   "tail_silence_s": 0.0,
   "gaps": [],
   "sample_peak_db": -10.457928,
   "flat_factor": 0.0,
   "warnings": []
  },
  {
   "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]

The PNG is on the hub page. Each row spans its own file's length.

mixcheck

New in 0.1.1. One ffmpeg pass per file gives what a mix engineer listens for, and flags to listen for. It reads the mid signal in seven bands (sub 20-60 Hz, bass 60-250, lowmid 250-500, mid 500-2000, presence 2-5 kHz, sibilance 5-10 kHz, air 10-16 kHz) against the whole, the peak-to-loudness ratio (plr_db, true peak minus integrated loudness), a short-term loudness contour (10th, 50th and 90th percentile, the loudest 10 seconds, one value per tenth of the file), the stereo correlation, how much a mono speaker loses (mono_fold_db) and the correlation under 120 Hz. Option: --lowest NOTE, the lowest note the brief's instruments play.

Flag Fires when (from the code)
OVER-LIMITED plr_db under 8
FLAT longer than 90 s and the short-term loudness spread is under 2 LU
MUDDY 250-500 Hz more than 3 dB above the average of bass and mid, when the bass band is above -15 dB
BRIGHT 2-5 kHz above -10 dB against 200 Hz-2 kHz for half the playing time
MONO-LOSS stereo correlation under 0
LOW-WIDE correlation under 120 Hz below 0.7
BELOW-RANGE with --lowest: energy from a whole tone under that note down to 0 Hz above -15 dB

How often each fired on 78 real AI renders is in musicwright-produce's references/mixing.md. The flags say what to listen for, not whether a take is good; the 0.1.1 listening checks moved BRIGHT to a fatigue pointer (Versions). The stand-in take and the clipped tone:

python mw.py mixcheck take.wav hot.wav
The output (Windows run)
{
 "ok": true,
 "files": [
  {
   "file": "take.wav",
   "duration_s": 45.0,
   "lufs_i": -16.0,
   "true_peak_dbtp": -4.3,
   "plr_db": 11.7,
   "psr_db": 10.9,
   "contour": {
    "short_term_p10": -17.1,
    "short_term_median": -16.0,
    "short_term_p90": -15.2,
    "spread_lu": 1.9,
    "loudest_10s_at_s": 24,
    "by_tenth_lufs": [
     -15.6,
     -16.0,
     -16.0,
     -16.0,
     -16.2,
     -16.0,
     -16.2,
     -16.0,
     -15.9,
     -16.0
    ]
   },
   "bands_db": {
    "sub": -17.5,
    "bass": -5.6,
    "lowmid": -6.8,
    "mid": -20.1,
    "presence": -42.7,
    "sibilance": -47.5,
    "air": -50.9
   },
   "lowmid_excess_db": 6.1,
   "presence_db": -39.0,
   "stereo": {
    "correlation": 1.0,
    "low_correlation": 1.0,
    "mono_fold_db": -0.0
   },
   "flags": [
    {
     "code": "MUDDY",
     "says": "250-500 Hz sits 6.1 dB above the bass and mid bands' average",
     "try": "with stems, cut 250-500 Hz on the pad or keys (not the bass); in a prompt, ask for fewer sustained low-mid parts"
    }
   ]
  },
  {
   "file": "hot.wav",
   "duration_s": 6.0,
   "lufs_i": -2.2,
   "true_peak_dbtp": 0.0,
   "plr_db": 2.2,
   "psr_db": 2.2,
   "contour": {
    "short_term_p10": -2.2,
    "short_term_median": -2.2,
    "short_term_p90": -2.2,
    "spread_lu": 0.0,
    "loudest_10s_at_s": 0,
    "by_tenth_lufs": []
   },
   "bands_db": {
    "sub": -56.1,
    "bass": -20.6,
    "lowmid": -5.0,
    "mid": -8.2,
    "presence": -30.0,
    "sibilance": -43.2,
    "air": -53.1
   },
   "lowmid_excess_db": 9.4,
   "presence_db": -29.6,
   "stereo": {
    "correlation": 1.0,
    "low_correlation": null,
    "mono_fold_db": -0.0
   },
   "flags": [
    {
     "code": "OVER-LIMITED",
     "says": "peak-to-loudness ratio 2.2 dB (under 8): squashed; after streaming normalisation it plays duller, not louder",
     "try": "master to the destination preset without extra limiting, or re-roll; never add compression to AI output"
    }
   ]
  }
 ],
 "reading": "pointers for what to listen to, not verdicts: analysers miss timing and character. bands_db are each band's level against the whole mid signal; plr_db is true peak minus integrated loudness; mono_fold_db is the level lost when both channels are summed"
}
[exit 0]

The take's 220 Hz tone sits in the lowmid band, so it reads MUDDY (6.1 dB); the clipped tone has a peak-to-loudness ratio of 2.2 dB. Any pure tone reads OVER-LIMITED, because a sine's peak is only 3 dB above its level. A brief for a solo flute, against take_s1.flac, a G3 tone under the flute's range:

python mw.py mixcheck take_s1.flac --lowest C4
The output (Windows run)
{
 "ok": true,
 "files": [
  {
   "file": "take_s1.flac",
   "duration_s": 8.0,
   "lufs_i": -18.0,
   "true_peak_dbtp": -10.5,
   "plr_db": 7.5,
   "psr_db": 6.6,
   "contour": {
    "short_term_p10": -19.1,
    "short_term_median": -19.1,
    "short_term_p90": -17.1,
    "spread_lu": 2.0,
    "loudest_10s_at_s": 0,
    "by_tenth_lufs": []
   },
   "bands_db": {
    "sub": -40.9,
    "bass": -2.9,
    "lowmid": -11.5,
    "mid": -32.9,
    "presence": -70.5,
    "sibilance": -81.7,
    "air": -100.0
   },
   "lowmid_excess_db": 6.4,
   "presence_db": -88.4,
   "stereo": {
    "correlation": 1.0,
    "low_correlation": 1.0,
    "mono_fold_db": -0.0
   },
   "below_lowest": {
    "note": "C4",
    "under_hz": 233.1,
    "level_db": -3.5
   },
   "flags": [
    {
     "code": "OVER-LIMITED",
     "says": "peak-to-loudness ratio 7.5 dB (under 8): squashed; after streaming normalisation it plays duller, not louder",
     "try": "master to the destination preset without extra limiting, or re-roll; never add compression to AI output"
    },
    {
     "code": "MUDDY",
     "says": "250-500 Hz sits 6.4 dB above the bass and mid bands' average",
     "try": "with stems, cut 250-500 Hz on the pad or keys (not the bass); in a prompt, ask for fewer sustained low-mid parts"
    },
    {
     "code": "BELOW-RANGE",
     "says": "energy under C4 at -3.5 dB against the whole: a part lower than the named instrument can play",
     "try": "for a solo brief, re-roll the seed; a drone or bass under a solo is the usual intruder"
    }
   ]
  }
 ],
 "reading": "pointers for what to listen to, not verdicts: analysers miss timing and character. bands_db are each band's level against the whole mid signal; plr_db is true peak minus integrated loudness; mono_fold_db is the level lost when both channels are summed"
}
[exit 0]

below_lowest reads -3.5 dB under 233.1 Hz (a whole tone under C4), so BELOW-RANGE fires. A stereo stand-in whose 55 Hz bass is in opposite phase in the two channels:

python mw.py mixcheck wide.wav
{
 "ok": true,
 "files": [
  {
   "file": "wide.wav",
   "duration_s": 20.0,
   "lufs_i": -11.6,
   "true_peak_dbtp": -6.1,
   "plr_db": 5.5,
   "psr_db": 5.5,
   "contour": {
    "short_term_p10": -11.6,
    "short_term_median": -11.6,
    "short_term_p90": -11.6,
    "spread_lu": 0.0,
    "loudest_10s_at_s": 3,
    "by_tenth_lufs": [
     -120.0,
     -11.6,
     -11.6,
     -11.6,
     -11.6,
     -11.6,
     -11.6,
     -11.6,
     -11.6,
     -11.6
    ]
   },
   "bands_db": {
    "sub": -61.2,
    "bass": -20.5,
    "lowmid": -4.9,
    "mid": -8.6,
    "presence": -53.9,
    "sibilance": -74.9,
    "air": -83.8
   },
   "lowmid_excess_db": 9.7,
   "presence_db": -53.6,
   "stereo": {
    "correlation": -0.38,
    "low_correlation": -1.0,
    "mono_fold_db": -5.1
   },
   "flags": [
    {
     "code": "OVER-LIMITED",
     "says": "peak-to-loudness ratio 5.5 dB (under 8): squashed; after streaming normalisation it plays duller, not louder",
     "try": "master to the destination preset without extra limiting, or re-roll; never add compression to AI output"
    },
    {
     "code": "MONO-LOSS",
     "says": "more side than mid (correlation -0.38): a mono speaker plays it 5.1 dB quieter and thinner",
     "try": "check on a phone speaker; if it must work in mono, re-roll or rebuild from stems"
    },
    {
     "code": "LOW-WIDE",
     "says": "below 120 Hz the channels disagree (correlation -1.0)",
     "try": "mw.py monobass IN --out OUT folds the lows to mono and leaves the rest as it is"
    }
   ]
  }
 ],
 "reading": "pointers for what to listen to, not verdicts: analysers miss timing and character. bands_db are each band's level against the whole mid signal; plr_db is true peak minus integrated loudness; mono_fold_db is the level lost when both channels are summed"
}
[exit 0]

On Linux with the static ffmpeg 7.0.2 build, 0.1.1's mixcheck stopped with an ffmpeg assertion on the 44.1 kHz and 8 kHz files above. Since 0.1.2 it pads a copy to whole seconds and measures again; on that build take.wav and hot.wav print the same numbers as the Windows run. Since 0.1.3 duration_s is the file's real length (3.5, not 4, for a 3.5-second file). Since 0.1.6 loudness and true peak are read from the file as it is on every path, like measure, so a mono file no longer reads 3 dB low (hot.wav printed -3.0 dBTP in 0.1.3, 0.0 now; Errors).

compare

New in 0.1.1. mixcheck on a take and a reference the user owns, then the take minus the reference: loudness, PLR, contour spread, each band and the correlation. Option: --lowest. The bands are relative to each file's own level, so a loudness gap does not move them.

python mw.py compare take.wav out/score.wav
The output (Windows run)
{
 "ok": true,
 "take": {
  "file": "take.wav",
  "duration_s": 45.0,
  "lufs_i": -16.0,
  "true_peak_dbtp": -4.3,
  "plr_db": 11.7,
  "psr_db": 10.9,
  "contour": {
   "short_term_p10": -17.1,
   "short_term_median": -16.0,
   "short_term_p90": -15.2,
   "spread_lu": 1.9,
   "loudest_10s_at_s": 24,
   "by_tenth_lufs": [
    -15.6,
    -16.0,
    -16.0,
    -16.0,
    -16.2,
    -16.0,
    -16.2,
    -16.0,
    -15.9,
    -16.0
   ]
  },
  "bands_db": {
   "sub": -17.5,
   "bass": -5.6,
   "lowmid": -6.8,
   "mid": -20.1,
   "presence": -42.7,
   "sibilance": -47.5,
   "air": -50.9
  },
  "lowmid_excess_db": 6.1,
  "presence_db": -39.0,
  "stereo": {
   "correlation": 1.0,
   "low_correlation": 1.0,
   "mono_fold_db": -0.0
  },
  "flags": [
   {
    "code": "MUDDY",
    "says": "250-500 Hz sits 6.1 dB above the bass and mid bands' average",
    "try": "with stems, cut 250-500 Hz on the pad or keys (not the bass); in a prompt, ask for fewer sustained low-mid parts"
   }
  ]
 },
 "ref": {
  "file": "out/score.wav",
  "duration_s": 46.0,
  "lufs_i": -17.4,
  "true_peak_dbtp": -10.6,
  "plr_db": 6.8,
  "psr_db": 4.3,
  "contour": {
   "short_term_p10": -23.7,
   "short_term_median": -17.8,
   "short_term_p90": -15.5,
   "spread_lu": 8.2,
   "loudest_10s_at_s": 21,
   "by_tenth_lufs": [
    -15.2,
    -18.9,
    -18.1,
    -17.3,
    -18.9,
    -16.1,
    -18.0,
    -17.5,
    -17.8,
    -18.3
   ]
  },
  "bands_db": {
   "sub": -43.3,
   "bass": -4.5,
   "lowmid": -7.4,
   "mid": -21.7,
   "presence": -68.7,
   "sibilance": -90.3,
   "air": -90.4
  },
  "lowmid_excess_db": 5.7,
  "presence_db": -70.4,
  "stereo": {
   "correlation": 1.0,
   "low_correlation": 1.0,
   "mono_fold_db": -0.0
  },
  "flags": [
   {
    "code": "OVER-LIMITED",
    "says": "peak-to-loudness ratio 6.8 dB (under 8): squashed; after streaming normalisation it plays duller, not louder",
    "try": "master to the destination preset without extra limiting, or re-roll; never add compression to AI output"
   },
   {
    "code": "MUDDY",
    "says": "250-500 Hz sits 5.7 dB above the bass and mid bands' average",
    "try": "with stems, cut 250-500 Hz on the pad or keys (not the bass); in a prompt, ask for fewer sustained low-mid parts"
   }
  ]
 },
 "take_minus_ref": {
  "lufs_i": 1.4,
  "plr_db": 4.9,
  "spread_lu": -6.3,
  "bands_db": {
   "sub": 25.8,
   "bass": -1.1,
   "lowmid": 0.6,
   "mid": 1.6,
   "presence": 26.0,
   "sibilance": 42.8,
   "air": 39.5
  },
  "correlation": 0.0
 },
 "reading": "bands are relative, so the loudness gap does not move them; a louder take sounds better to every listener: rank only on matched copies (mw.py preview). Use the reference for the concept, not to copy its spectrum. pointers for what to listen to, not verdicts: analysers miss timing and character. bands_db are each band's level against the whole mid signal; plr_db is true peak minus integrated loudness; mono_fold_db is the level lost when both channels are summed"
}
[exit 0]

The reading repeats the skill's rule: rank takes only on loudness-matched copies (preview), and use a reference for the idea, not to copy its spectrum.

preview

New in 0.1.1. Copies of several files at one loudness, for listening: a listener hears the louder of two copies as better, so raw takes are never compared. The level is --lufs (default -16), lowered when a copy would need more than plain gain to stay under -1 dBTP. Options: --out (required: the folder), --lufs, --as normal|phone|quiet (phone: mono, 300 Hz-6 kHz; quiet: 20 dB down, the low-level check), --blind (names the copies take_A, take_B ... in a shuffled order), --seed (the shuffle). Copies are 48 kHz WAV.

python mw.py preview take.wav m1.wav quiet_end.wav --out previews
{
 "ok": true,
 "as": "normal",
 "matched_lufs": -16.0,
 "previews": [
  {
   "preview": "<work>/previews/take_normal.wav",
   "gain_db": 0.0,
   "source_lufs": -16.0
  },
  {
   "preview": "<work>/previews/m1_normal.wav",
   "gain_db": 1.4,
   "source_lufs": -17.4
  },
  {
   "preview": "<work>/previews/quiet_end_normal.wav",
   "gain_db": 5.8,
   "source_lufs": -21.8
  }
 ],
 "reading": "every copy plays at one loudness, so the louder take no longer wins by being louder; rank on these, never on the raw takes"
}
[exit 0]

Blind, with seed 7. The key goes to <folder>_blind_key.json beside the folder, not in it, so the listener can open the folder without seeing it:

python mw.py preview take.wav m1.wav quiet_end.wav --out blind --blind --seed 7
ls blind
cat blind_blind_key.json
{
 "ok": true,
 "as": "normal",
 "matched_lufs": -16.0,
 "previews": [
  {
   "preview": "<work>/blind/take_A.wav",
   "gain_db": 5.8
  },
  {
   "preview": "<work>/blind/take_B.wav",
   "gain_db": 0.0
  },
  {
   "preview": "<work>/blind/take_C.wav",
   "gain_db": 1.4
  }
 ],
 "reading": "every copy plays at one loudness, so the louder take no longer wins by being louder; rank on these, never on the raw takes; the key file (beside the folder, not in it) maps letters to takes: do not open it until the listener has ranked them",
 "key_file": "<work>/blind_blind_key.json"
}
[exit 0]
take_A.wav
take_B.wav
take_C.wav
[exit 0]
{
 "take_A": "quiet_end.wav",
 "take_B": "take.wav",
 "take_C": "m1.wav"
}
[exit 0]

The phone check filters before matching, so the 196 Hz movement (m1.wav) needed 17.6 dB of gain to reach -16 LUFS through a 300 Hz high-pass:

python mw.py preview take.wav m1.wav --out phone --as phone
{
 "ok": true,
 "as": "phone",
 "matched_lufs": -16.0,
 "previews": [
  {
   "preview": "<work>/phone/take_phone.wav",
   "gain_db": 7.9,
   "source_lufs": -23.9
  },
  {
   "preview": "<work>/phone/m1_phone.wav",
   "gain_db": 17.6,
   "source_lufs": -33.6
  }
 ],
 "reading": "every copy plays at one loudness, so the louder take no longer wins by being louder; rank on these, never on the raw takes"
}
[exit 0]

master

Two-pass loudness normalisation with ffmpeg's loudnorm to a preset from loudness.json, resampled to 48 kHz, with before and after numbers. Options: --preset (default streaming), --lufs and --tp (override the targets), --lra (default 11), --peak (gain only instead, below), --rate (default 48000), --out (default <input name>_<preset>.wav beside the input). WAV output is 24-bit. Since 0.1.1 the result carries the preset's lra_hint, advice on how much loudness range suits the destination.

python mw.py master take.wav --preset streaming --out out/take_streaming.wav
{
 "ok": true,
 "out": "<work>/out/take_streaming.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": -16.0,
  "true_peak_dbtp": -4.3,
  "lra": 1.9
 },
 "after": {
  "lufs_i": -13.9,
  "true_peak_dbtp": -2.2,
  "lra": 1.9,
  "duration_s": 45.0,
  "sample_rate": 48000
 },
 "warnings": []
}
[exit 0]

"normalization": "linear" means one gain for the whole file, so the dynamics are unchanged. The same take to game-music:

python mw.py master take.wav --preset game-music --out out/take_game.wav
{
 "ok": true,
 "out": "<work>/out/take_game.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": -16.0,
  "true_peak_dbtp": -4.3,
  "lra": 1.9
 },
 "after": {
  "lufs_i": -17.9,
  "true_peak_dbtp": -6.2,
  "lra": 1.9,
  "duration_s": 45.0,
  "sample_rate": 48000
 },
 "warnings": []
}
[exit 0]

With --lufs or --tp and no --preset, the result is named custom, with no preset note or hint (0.1.0 called it streaming). The default file name is then <input name>_custom.wav:

python mw.py master take.wav --lufs -20 --tp -2 --out out/take_minus20.wav
{
 "ok": true,
 "out": "<work>/out/take_minus20.wav",
 "preset": "custom",
 "target": {
  "lufs": -20.0,
  "true_peak": -2.0
 },
 "preset_note": null,
 "lra_hint": null,
 "normalization": "linear",
 "before": {
  "lufs_i": -16.0,
  "true_peak_dbtp": -4.3,
  "lra": 1.9
 },
 "after": {
  "lufs_i": -19.9,
  "true_peak_dbtp": -8.2,
  "lra": 1.9,
  "duration_s": 45.0,
  "sample_rate": 48000
 },
 "warnings": []
}
[exit 0]

Without --out, the file is written beside the input. This one is a steady test tone, which loudnorm will not treat linearly; the warning now says that peaks were not the cause (Errors):

python mw.py master tone.wav --preset broadcast
{
 "ok": true,
 "out": "<work>/tone_broadcast.wav",
 "preset": "broadcast",
 "target": {
  "lufs": -23,
  "true_peak": -1.0
 },
 "preset_note": "EBU R128 v5.0 (Nov 2023): -23 LUFS +-0.5 LU.",
 "lra_hint": "moderate: narrower than cinema, wider than phones",
 "normalization": "dynamic",
 "before": {
  "lufs_i": -13.3,
  "true_peak_dbtp": -5.2,
  "lra": 0.0
 },
 "after": {
  "lufs_i": -23.0,
  "true_peak_dbtp": -14.6,
  "lra": 0.0,
  "duration_s": 12.0,
  "sample_rate": 48000
 },
 "warnings": [
  "loudnorm used dynamic mode on a source with almost no loudness range (LRA 0.0), as it does on steady tones and drones; peaks were not the cause. Check the result's level; the sound is usually unchanged."
 ]
}
[exit 0]

An unknown preset lists the eight names:

python mw.py master take.wav --preset spotify
{
 "ok": false,
 "command": "master",
 "error": "unknown preset spotify; choose from apple, broadcast, broadcast-us, game-console-mix, game-mobile-mix, game-music, streaming, web-video"
}
[exit 1]

A pre-master for a mastering engineer

--peak -6 applies one gain so the sample peak sits at -6 dBFS: no loudnorm, no limiter, and the source's sample rate (44.1 kHz here). The default name is <input name>_premaster.wav.

python mw.py master take.wav --peak -6 --out out/take_premaster.wav
{
 "ok": true,
 "out": "<work>/out/take_premaster.wav",
 "mode": "peak",
 "gain_db": -1.66,
 "before": {
  "lufs_i": -16.0,
  "sample_peak_db": -4.343293,
  "true_peak_dbtp": -4.3
 },
 "after": {
  "lufs_i": -17.7,
  "sample_peak_db": -6.003292,
  "true_peak_dbtp": -6.0,
  "sample_rate": 44100
 },
 "warnings": [],
 "next": "hand this to the mastering engineer with the reference and the destination; do not master it again here"
}
[exit 0]
python mw.py master take.wav --peak 3 --out out/x.wav
{
 "ok": false,
 "command": "master",
 "error": "--peak is a level in dBFS at or below 0, such as -6"
}
[exit 1]

One gain for several files

New in 0.1.17. --shared-gain takes two or more files, applies one gain with no limiter so their level differences stay, and lands the loudest on the target. --out is a folder. Use it for a set of cues the engine or film mix balances later:

python mw.py master take.wav quiet_end.wav --shared-gain --preset game-music --out out/shared
{
 "ok": true,
 "mode": "shared-gain",
 "preset": "game-music",
 "target": {
  "lufs": -18,
  "true_peak": -1.0
 },
 "gain_db": -2.0,
 "files": [
  {
   "out": "<work>/out/shared/take_shared.wav",
   "before_lufs": -16.0,
   "after": {
    "lufs_i": -18.0,
    "true_peak_dbtp": -6.3,
    "lra": 1.8,
    "duration_s": 45.0,
    "sample_rate": 48000
   }
  },
  {
   "out": "<work>/out/shared/quiet_end_shared.wav",
   "before_lufs": -21.8,
   "after": {
    "lufs_i": -23.8,
    "true_peak_dbtp": -20.1,
    "lra": 1.8,
    "duration_s": 26.0,
    "sample_rate": 48000
   }
  }
 ],
 "reading": "one gain for all, so the level differences between these files are kept; the engine or film mix still balances them against everything else",
 "warnings": []
}
[exit 0]

The two files stay 5.8 LU apart, before and after. Several files without the option, one file with it, and the option with --peak are refused:

python mw.py master take.wav quiet_end.wav --out out/x
python mw.py master take.wav --shared-gain --out out/x
python mw.py master take.wav quiet_end.wav --shared-gain --peak -6 --out out/x
{
 "ok": false,
 "command": "master",
 "error": "master takes one file; for several, add --shared-gain"
}
[exit 1]
{
 "ok": false,
 "command": "master",
 "error": "--shared-gain needs two or more files"
}
[exit 1]
{
 "ok": false,
 "command": "master",
 "error": "--shared-gain sets its gain from loudness; it cannot be combined with --peak"
}
[exit 1]

edit

Trim, fade and convert one file. The fades use a quarter-sine curve; the codec comes from the extension (.wav 24-bit PCM, .flac, .ogg Vorbis (libvorbis at quality 6, or ffmpeg's built-in encoder when the build has no libvorbis), .mp3 LAME V0, .opus 160 kb/s, .m4a AAC 256 kb/s). Options: --out (required), --start, --end, --fade-in, --fade-out (seconds), --rate.

python mw.py edit quiet_end.wav --end 20 --fade-out 3 --out out/trimmed.wav
python mw.py edit take.wav --start 5 --end 35 --fade-in 0.5 --fade-out 2 --rate 48000 --out out/take_30s.ogg
{
 "ok": true,
 "out": "<work>/out/trimmed.wav",
 "length_s": 20.0,
 "duration_s": 20.0,
 "sample_rate": 48000,
 "channels": 1,
 "codec": "pcm_s24le"
}
[exit 0]
{
 "ok": true,
 "out": "<work>/out/take_30s.ogg",
 "length_s": 30.0,
 "duration_s": 30.0,
 "sample_rate": 48000,
 "channels": 2,
 "codec": "vorbis"
}
[exit 0]
python mw.py edit take.wav --start 30 --end 10 --out out/bad.wav
{
 "ok": false,
 "command": "edit",
 "error": "end must be after start"
}
[exit 1]

join

Joins two or more files with equal-power (quarter-sine) crossfades, resampled to 48 kHz. With --lengths, each part holds that many seconds, then crossfades into the next for --xfade seconds; the crossfades start on the hit points listed in crossfade_centres_s (despite the name, the times are where each crossfade starts, as note says). Options: --out (required), --xfade (default 2), --lengths (one value per file), --fade-out.

Three movements of 27, 13 and 15 seconds, held for 24, 10 and 12:

python mw.py join m1.wav m2.wav m3.wav --lengths 24,10,12 --xfade 2 --fade-out 1.5 --out out/score.wav
{
 "ok": true,
 "out": "<work>/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]

Without --lengths, whole files are chained; two 8-second fixtures with a 3-second crossfade make 13 seconds:

python mw.py join a.wav b.wav --xfade 3 --out out/ab.flac
{
 "ok": true,
 "out": "<work>/out/ab.flac",
 "duration_s": 13.0,
 "crossfade_centres_s": [],
 "note": "each crossfade starts at the hit point and lasts --xfade seconds"
}
[exit 0]
python mw.py join a.wav --out out/x.wav
python mw.py join a.wav b.wav --lengths 5 --out out/x.wav
{
 "ok": false,
 "command": "join",
 "error": "join needs two or more files"
}
[exit 1]
{
 "ok": false,
 "command": "join",
 "error": "--lengths needs one value per file"
}
[exit 1]

loop

Makes a seamless loop: the audio after the loop's end is crossfaded into its head, so a reverb tail carries over instead of cutting off, and the result is checked with seam. With --bars N --bpm B the loop is exactly N bars (N x --beats-per-bar x 60 / B seconds). Options: --out (required), --start, --end, --bars, --bpm, --beats-per-bar (default 4), --xfade (default 1.5), --rate (default 48000), --ogg (also write an OGG with LOOPSTART and LOOPLENGTH tags, in samples). A .wav loop is 16-bit.

Twelve bars at 96 bpm (30 seconds) from 5 seconds into the 45-second stand-in take; the window read is 31.5 seconds, the loop plus the crossfade:

python mw.py loop take.wav --start 5 --bars 12 --bpm 96 --xfade 1.5 --out out/take_loop.wav --ogg
{
 "ok": true,
 "out": "<work>/out/take_loop.wav",
 "loop_length_s": 30.0,
 "source_window_s": [
  5.0,
  36.5
 ],
 "xfade_s": 1.5,
 "seam": {
  "file": "out/take_loop.wav",
  "seam_jump": 262,
  "p99_step": 308,
  "ratio": 0.85,
  "level_jump_db": 1.29,
  "verdict": "clean"
 },
 "ogg": "<work>/out/take_loop.ogg",
 "ogg_note": "LOOPSTART/LOOPLENGTH (in samples) are read by RPG Maker and some players; Unity ignores them, so set Loop on the AudioSource and import the WAV or this OGG",
 "bars": 12,
 "bpm": 96.0
}
[exit 0]

The seam ratio (0.85) is well under 2 and the level jump 1.29 dB, so the verdict is "clean", although the loop starts on the take's kick. 0.1.1 read 3.5 dB and "check by ear" for the same loop (Errors). The same loop from 5.3 seconds:

python mw.py loop take.wav --start 5.3 --bars 12 --bpm 96 --out out/take_loop_b.wav
{
 "ok": true,
 "out": "<work>/out/take_loop_b.wav",
 "loop_length_s": 30.0,
 "source_window_s": [
  5.3,
  36.8
 ],
 "xfade_s": 1.5,
 "seam": {
  "file": "out/take_loop_b.wav",
  "seam_jump": 273,
  "p99_step": 308,
  "ratio": 0.89,
  "level_jump_db": 0.3,
  "verdict": "clean"
 },
 "bars": 12,
 "bpm": 96.0
}
[exit 0]

Without --bars, the loop is the window from --start to --end (default the file's end) minus the crossfade:

python mw.py loop take.wav --start 2.5 --end 40 --out out/take_window_loop.flac
{
 "ok": true,
 "out": "<work>/out/take_window_loop.flac",
 "loop_length_s": 36.0,
 "source_window_s": [
  2.5,
  40.0
 ],
 "xfade_s": 1.5,
 "seam": {
  "file": "out/take_window_loop.flac",
  "seam_jump": 71,
  "p99_step": 296,
  "ratio": 0.24,
  "level_jump_db": 0.27,
  "verdict": "clean"
 }
}
[exit 0]
python mw.py loop take.wav --bars 32 --bpm 96 --out out/x.wav
python mw.py loop take.wav --bars 8 --out out/x.wav
python mw.py loop take.wav --start 10 --end 12 --out out/x.wav
{
 "ok": false,
 "command": "loop",
 "error": "loop needs 81.50 s of source but the file is 45.0 s; lower --bars or --start"
}
[exit 1]
{
 "ok": false,
 "command": "loop",
 "error": "--bars needs --bpm"
}
[exit 1]
{
 "ok": false,
 "command": "loop",
 "error": "loop body must be longer than the crossfade"
}
[exit 1]

16-bit dither and --bits

New in 0.1.18. The 16-bit WAV is dithered (triangular). --bits 24 writes 24-bit with no dither:

python mw.py loop a.wav --bits 24 --out l24.wav
{
 "ok": true,
 "out": ".\\l24.wav",
 "loop_length_s": 6.5,
 "source_window_s": [
  0.0,
  8.0
 ],
 "xfade_s": 1.5,
 "seam": {
  "file": "l24.wav",
  "seam_jump": 41,
  "p99_step": 204,
  "ratio": 0.2,
  "level_jump_db": -0.0,
  "verdict": "clean"
 }
}

seam

Scores how audible a file's loop point is: seam_jump is the difference between the last and the first sample (16-bit, left channel), p99_step the file's own 99th-percentile sample-to-sample step, ratio the first over the second, and level_jump_db the level at the start against the level at the end. Since 0.1.2 each end's level is read from a robust line (Theil-Sen) through the 50 ms window levels over that half second, taken at the seam, so one drum hit on the first beat, or a swell running through the seam, does not count as a jump. 0.1.1 took the median of those windows; 0.1.0 compared the first and last 50 ms alone. Verdicts: "clean" (ratio 2 or less, level jump under 3 dB), "check by ear" (ratio 5 or less, under 6 dB), otherwise "audible seam likely". Files that are not 16-bit WAV are converted first.

A tone cut mid-cycle, the loop above, and its OGG:

python mw.py seam hardcut.wav out/take_loop.wav out/take_loop.ogg
{
 "ok": true,
 "files": [
  {
   "file": "hardcut.wav",
   "seam_jump": 4084,
   "p99_step": 236,
   "ratio": 17.31,
   "level_jump_db": 0.0,
   "verdict": "audible seam likely"
  },
  {
   "file": "out/take_loop.wav",
   "seam_jump": 262,
   "p99_step": 308,
   "ratio": 0.85,
   "level_jump_db": 1.29,
   "verdict": "clean"
  },
  {
   "file": "out/take_loop.ogg",
   "seam_jump": 173,
   "p99_step": 311,
   "ratio": 0.56,
   "level_jump_db": 1.27,
   "verdict": "clean"
  }
 ]
}
[exit 0]

A real level step still reads as a seam: a tone at full level for five seconds and half level for five more, so the loop point jumps back up 6 dB:

ffmpeg -v error -f lavfi -i "aevalsrc='0.4*sin(2*PI*440*t)*if(lt(t,5),1,0.5)':s=48000:d=10" step.wav
python mw.py seam step.wav
[exit 0]
{
 "ok": true,
 "files": [
  {
   "file": "step.wav",
   "seam_jump": 377,
   "p99_step": 754,
   "ratio": 0.5,
   "level_jump_db": 6.02,
   "verdict": "audible seam likely"
  }
 ]
}
[exit 0]

The samples meet smoothly (ratio 0.5), but the level jump of 6.02 dB makes it "audible seam likely".

--chords

New in 0.1.18. Compares the notes in the file's last and first second. It is reported only: nothing is calibrated, so there is no flag or threshold.

python mw.py seam a.wav --chords
{
 "ok": true,
 "files": [
  {
   "file": "a.wav",
   "seam_jump": 215,
   "p99_step": 205,
   "ratio": 1.05,
   "level_jump_db": -0.0,
   "verdict": "clean",
   "chords": {
    "similarity": 1.0,
    "tail_pitches": [
     "A",
     "E",
     "G#"
    ],
    "head_pitches": [
     "A",
     "E",
     "G#"
    ],
    "window_s": 1.0,
    "note": "uncalibrated: a low value means the ends use different notes, which can still be a good chord change; judge by ear"
   }
  }
 ]
}

diff

New in 0.1.18. Writes what changed between two aligned versions as audio, level-matched unless --raw, and reports the residual in dB. The files must start together. Options: --out (required), --raw, --rate.

python mw.py diff a.wav b.wav --out delta.wav
{
 "ok": true,
 "out": ".\\delta.wav",
 "residual_db": -10.9,
 "gain_applied_db": 3.42,
 "length_gap_s": 0.0,
 "reading": "residual_db is the difference's energy against the first file; null means identical. The files must start together: an offset makes this read loud whatever changed."
}

duck

Ducks music under dialogue or a video's own sound with a sidechain compressor keyed by the --under input, and mixes the two. When --under has a video stream and --out ends in .mp4, .mov or .mkv, the video is copied and the new mix becomes its sound (AAC 256 kb/s). Options: --under and --out (required), --music-gain (dB before ducking, default 0), --threshold (0.03), --ratio (4), --attack (40 ms), --release (500 ms), --stem (write the ducked music alone instead of the mix). Since 0.1.1 the result says what it returns and its duration_s.

The joined score under a 20-second dialogue stand-in (bursts of a 900 Hz tone, two seconds in every six):

python mw.py duck out/score.wav --under dialogue.wav --out out/score_ducked.wav
{
 "ok": true,
 "out": "<work>/out/score_ducked.wav",
 "returns": "the ducked music mixed with the key",
 "duration_s": 46.0,
 "remuxed_video": false,
 "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]

Under a video, 3 dB quieter and with a harder ratio. A video output still ends with the video (20 seconds here):

python mw.py duck out/score.wav --under cut.mp4 --music-gain -3 --ratio 6 --out out/cut_scored.mp4
{
 "ok": true,
 "out": "<work>/out/cut_scored.mp4",
 "returns": "the video with the ducked mix",
 "duration_s": 20.0,
 "remuxed_video": true,
 "settings": {
  "music_gain_db": -3.0,
  "threshold": 0.03,
  "ratio": 6.0,
  "attack_ms": 40,
  "release_ms": 500
 },
 "next": "run measure on the result and master it to the destination preset"
}
[exit 0]

Measuring the score and the ducked mix: since 0.1.1 the audio mix keeps the music's 46 seconds when the dialogue file is shorter (0.1.0 cut it to 20):

python mw.py measure out/score.wav out/score_ducked.wav
{
 "ok": true,
 "files": [
  {
   "file": "out/score.wav",
   "duration_s": 46.0,
   "sample_rate": 48000,
   "channels": 2,
   "codec": "pcm_s24le",
   "lufs_i": -17.4,
   "lra": 8.3,
   "true_peak_dbtp": -10.6,
   "head_silence_s": 0.0,
   "tail_silence_s": 0.0,
   "gaps": [],
   "sample_peak_db": -10.626413,
   "flat_factor": 0.0,
   "warnings": []
  },
  {
   "file": "out/score_ducked.wav",
   "duration_s": 46.0,
   "sample_rate": 48000,
   "channels": 2,
   "codec": "pcm_s24le",
   "lufs_i": -17.0,
   "lra": 6.4,
   "true_peak_dbtp": -9.6,
   "head_silence_s": 0.0,
   "tail_silence_s": 0.0,
   "gaps": [],
   "sample_peak_db": -9.645288,
   "flat_factor": 0.0,
   "warnings": []
  }
 ]
}
[exit 0]

--stem writes the ducked music without the dialogue, at the music's length. It is the part to hand to a film mix, or a layer ducked under a lead so it answers it (answer):

python mw.py duck out/score.wav --under dialogue.wav --stem --out out/score_stem.wav
{
 "ok": true,
 "out": "<work>/out/score_stem.wav",
 "returns": "the ducked music alone, at the music's length",
 "duration_s": 46.0,
 "remuxed_video": false,
 "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]

mix

Layers files into one, summed in Python at 48 kHz: per-file gain in dB, offset in seconds (negative trims the head), pan from -1 to 1 (equal power), a high shelf per file, and gain envelopes. When the sum peaks above -1 dBFS, the mix and its stems are scaled down to peak there (with a warning), unless --no-limit; a quieter sum is left alone (scaled_db 0.0 below). Options: --out (required), --gains, --offsets, --pans, --shelves (high-shelf dB per file; negative darkens a background part), --shelf-hz (default 3000), --automate N:T=DB,T=DB (file N, 1-based, gets a gain envelope on the mix timeline, linear in dB; repeat per file), --length longest|first|<seconds> (default longest), --stems DIR (also write each processed layer, aligned to the mix), --rate, --no-limit.

Two movements, the second 6 dB down, starting 4 seconds in, panned apart, with the aligned stems:

python mw.py mix m1.wav m2.wav --gains 0,-6 --offsets 0,4 --pans -0.3,0.3 --stems out/stems --out out/mix.wav
ls out/stems
{
 "ok": true,
 "out": "<work>/out/mix.wav",
 "duration_s": 27.0,
 "layers": [
  {
   "file": "m1.wav",
   "gain_db": 0.0,
   "offset_s": 0.0,
   "pan": -0.3,
   "high_shelf_db": 0.0,
   "automation": null
  },
  {
   "file": "m2.wav",
   "gain_db": -6.0,
   "offset_s": 4.0,
   "pan": 0.3,
   "high_shelf_db": 0.0,
   "automation": null
  }
 ],
 "scaled_db": 0.0,
 "stems": [
  "<work>/out/stems/01_m1.wav",
  "<work>/out/stems/02_m2.wav"
 ],
 "measure": {
  "lufs_i": -17.0,
  "true_peak_dbtp": -9.9,
  "lra": 7.5
 },
 "warnings": [],
 "next": "sheet the mix beside its stems, then master it to the destination preset"
}
[exit 0]
01_m1.wav
02_m2.wav
[exit 0]

The second file darkened by 6 dB above 3 kHz and faded from 0 to -12 dB over its first 6 seconds, the mix cut to the first file's length:

python mw.py mix m1.wav m2.wav --shelves 0,-6 --automate 2:0=0,6=-12,10=-12 --length first --out out/mix_auto.wav
{
 "ok": true,
 "out": "<work>/out/mix_auto.wav",
 "duration_s": 27.0,
 "layers": [
  {
   "file": "m1.wav",
   "gain_db": 0.0,
   "offset_s": 0.0,
   "pan": 0.0,
   "high_shelf_db": 0.0,
   "automation": null
  },
  {
   "file": "m2.wav",
   "gain_db": 0.0,
   "offset_s": 0.0,
   "pan": 0.0,
   "high_shelf_db": -6.0,
   "automation": [
    [
     0.0,
     0.0
    ],
    [
     6.0,
     -12.0
    ],
    [
     10.0,
     -12.0
    ]
   ]
  }
 ],
 "scaled_db": 0.0,
 "stems": [],
 "measure": {
  "lufs_i": -17.0,
  "true_peak_dbtp": -9.3,
  "lra": 9.9
 },
 "warnings": [],
 "next": "sheet the mix beside its stems, then master it to the destination preset"
}
[exit 0]
python mw.py mix m1.wav m2.wav --gains 0,-6,3 --out out/x.wav
python mw.py mix m1.wav m2.wav --automate 3:0=0 --out out/x.wav
{
 "ok": false,
 "command": "mix",
 "error": "--gains needs one value per file (2), got 3"
}
[exit 1]
{
 "ok": false,
 "command": "mix",
 "error": "--automate 3:0=0: file number must be 1 to 2, with at least one breakpoint"
}
[exit 1]

monobass

New in 0.1.1. A Linkwitz-Riley crossover (--hz, default 160): above it both channels are kept as they are; below it the mid signal goes to both channels. It prints mixcheck's stereo numbers before and after. Options: --out (required), --hz.

python mw.py monobass wide.wav --out out/wide_monobass.wav
{
 "ok": true,
 "out": "<work>/out/wide_monobass.wav",
 "hz": 160.0,
 "before": {
  "correlation": -0.38,
  "low_correlation": -1.0,
  "mono_fold_db": -5.1
 },
 "after": {
  "correlation": 1.0,
  "low_correlation": null,
  "mono_fold_db": -0.0
 },
 "next": "listen: the low end should sit centred and firmer; nothing above the crossover changes"
}
[exit 0]

The correlation went from -0.38 to 1.0, and low_correlation became null: no low end was left to measure. The stand-in's bass was in exactly opposite phase, so its mid is silence, and the fold removed it. Measuring the result shows the loudness falling from -11.6 to -14.7 LUFS:

python mw.py mixcheck out/wide_monobass.wav
{
 "ok": true,
 "files": [
  {
   "file": "out/wide_monobass.wav",
   "duration_s": 20.0,
   "lufs_i": -14.7,
   "true_peak_dbtp": -11.5,
   "plr_db": 3.2,
   "psr_db": 3.2,
   "contour": {
    "short_term_p10": -14.7,
    "short_term_median": -14.7,
    "short_term_p90": -14.7,
    "spread_lu": 0.0,
    "loudest_10s_at_s": 0,
    "by_tenth_lufs": [
     -120.0,
     -14.7,
     -14.7,
     -14.7,
     -14.7,
     -14.7,
     -14.7,
     -14.7,
     -14.7,
     -14.7
    ]
   },
   "bands_db": {
    "sub": -61.2,
    "bass": -20.5,
    "lowmid": -4.9,
    "mid": -8.5,
    "presence": -52.8,
    "sibilance": -82.3,
    "air": -87.8
   },
   "lowmid_excess_db": 9.6,
   "presence_db": -52.4,
   "stereo": {
    "correlation": 1.0,
    "low_correlation": null,
    "mono_fold_db": -0.0
   },
   "flags": [
    {
     "code": "OVER-LIMITED",
     "says": "peak-to-loudness ratio 3.2 dB (under 8): squashed; after streaming normalisation it plays duller, not louder",
     "try": "master to the destination preset without extra limiting, or re-roll; never add compression to AI output"
    }
   ]
  }
 ],
 "reading": "pointers for what to listen to, not verdicts: analysers miss timing and character. bands_db are each band's level against the whole mid signal; plr_db is true peak minus integrated loudness; mono_fold_db is the level lost when both channels are summed"
}
[exit 0]

On real renders the lows are rarely in full opposite phase; listen to the result either way.

analyze

Tempo, beat count and a key estimate (Krumhansl profiles on a chroma average) per file, with librosa, and since 0.1.1 tuning, repetition and sections. librosa stays optional. When it is not importable, analyze exits 1 with the command that runs it through uv, with nothing installed (Linux run):

python mw.py analyze take.wav
{
 "ok": false,
 "error": "librosa is not installed in this Python",
 "fix": "uv run --no-project --python 3.12 --with librosa --with soundfile python \"<plugin>/skills/musicwright/scripts/mw.py\" analyze \"take.wav\""
}
[exit 1]

With librosa 1.0.0 installed (Windows run), the same command gives:

{
 "ok": true,
 "librosa": "1.0.0",
 "files": [
  {
   "file": "take.wav",
   "tempo_bpm": 47.85,
   "beats": 35,
   "key": "A major",
   "key_confidence": 0.88,
   "runner_up": "A minor",
   "key_margin": 0.168,
   "runner_up_relation": "parallel",
   "onset_strength_mean": 0.46,
   "note": "tempo can come back doubled or halved; key estimates on modal or pentatonic music often name the relative major/minor",
   "tuning": {
    "cents": -3.0,
    "spread_cents": 0.0,
    "trend_cents": null,
    "windows": 4
   },
   "harmony": {
    "changes_per_min": 0.0,
    "longest_span_s": 45.0,
    "top2_share": 1.0
   },
   "repetition": {
    "share": 0.75,
    "block_period_s": 20.0
   },
   "flags": []
  }
 ],
 "reading": "pointers for what to listen to, not verdicts. tuning cents are against A440, one value per 10 s window; spread_cents is the 10th-90th percentile range (bends, vibrato and pitch effects raise it), trend_cents the last third against the first; repetition.share is the part of the track that repeats an 8 s block heard earlier (reported, not flagged: a listener heard a bed at 0.98 as less stuck than one at 0.13); harmony says how often the chords move (changes_per_min, longest_span_s, top2_share), uncalibrated and not flagged: a low rate names a one-chord take but suits an ambient bed, and it does not say which chords; sections come from timbre and harmony changes (4/4 assumed for bars); tempo can be doubled or halved, may be wrong on one file in ten or more even past that, and means little on rubato"
}
[exit 0]

The tempo came back near half of 96, as note warns. The new fields, from the code and the reading text:

Field Meaning
tuning.cents offset from A440, one estimate per 10-second window averaged on the circle (+49 and -49 are 2 cents apart)
tuning.spread_cents 10th to 90th percentile range of the windows; bends and vibrato raise it
tuning.trend_cents the last third against the first; null under nine windows
harmony new in 0.1.13: changes_per_min, longest_span_s (longest one-chord span) and top2_share; not flagged and uncalibrated
repetition.share the part of the track that repeats an 8-second block heard earlier; reported, not flagged
cents_from_first on every file after the first: its tuning gap from the first file
sections with --sections: start and end in seconds and bars (4/4 assumed), named from the tags

Flags: OFF-A440 (cents 15 or more either way), DRIFT (trend_cents 15 or more) and TUNING-GAP (a gap over 30 cents). A REPEATS flag, added while 0.1.1 was in development, was removed by the listening checks before the release (Versions).

Two 30-second A-major chords, the second 40 cents sharp, the lead first (Windows run):

python mw.py analyze in_tune.wav sharp.wav
The output (Windows run)
{
 "ok": true,
 "librosa": "1.0.0",
 "files": [
  {
   "file": "in_tune.wav",
   "tempo_bpm": 0.0,
   "beats": 0,
   "key": "A major",
   "key_confidence": 0.87,
   "runner_up": "C# minor",
   "key_margin": 0.228,
   "runner_up_relation": null,
   "onset_strength_mean": 0.08,
   "note": "tempo can come back doubled or halved; key estimates on modal or pentatonic music often name the relative major/minor",
   "tuning": {
    "cents": -3.0,
    "spread_cents": 0.0,
    "trend_cents": null,
    "windows": 3
   },
   "harmony": {
    "changes_per_min": 0.0,
    "longest_span_s": 30.0,
    "top2_share": 1.0
   },
   "repetition": {
    "share": 0.0,
    "block_period_s": null
   },
   "flags": []
  },
  {
   "file": "sharp.wav",
   "tempo_bpm": 0.0,
   "beats": 0,
   "key": "A major",
   "key_confidence": 0.83,
   "runner_up": "C# minor",
   "key_margin": 0.309,
   "runner_up_relation": null,
   "onset_strength_mean": 0.083,
   "note": "tempo can come back doubled or halved; key estimates on modal or pentatonic music often name the relative major/minor",
   "tuning": {
    "cents": 41.0,
    "spread_cents": 0.0,
    "trend_cents": null,
    "windows": 3
   },
   "harmony": {
    "changes_per_min": 0.0,
    "longest_span_s": 30.0,
    "top2_share": 1.0
   },
   "repetition": {
    "share": 0.66,
    "block_period_s": 8.3
   },
   "flags": [
    {
     "code": "OFF-A440",
     "says": "tuned +41.0 cents from A440: a part rendered or played at A440 will beat against it",
     "try": "fine on its own; before layering, pick a take that agrees or pitch-shift the layer by the same cents"
    },
    {
     "code": "TUNING-GAP",
     "says": "+44.0 cents from in_tune.wav: held notes together will beat",
     "try": "pick takes that agree, or pitch-shift one by the gap before mixing"
    }
   ],
   "cents_from_first": 44.0
  }
 ],
 "reading": "pointers for what to listen to, not verdicts. tuning cents are against A440, one value per 10 s window; spread_cents is the 10th-90th percentile range (bends, vibrato and pitch effects raise it), trend_cents the last third against the first; repetition.share is the part of the track that repeats an 8 s block heard earlier (reported, not flagged: a listener heard a bed at 0.98 as less stuck than one at 0.13); harmony says how often the chords move (changes_per_min, longest_span_s, top2_share), uncalibrated and not flagged: a low rate names a one-chord take but suits an ambient bed, and it does not say which chords; sections come from timbre and harmony changes (4/4 assumed for bars); tempo can be doubled or halved, may be wrong on one file in ten or more even past that, and means little on rubato"
}
[exit 0]

The sharp chord reads +41.0 cents (OFF-A440) and +44.0 from the first file (TUNING-GAP). The pure-A440 chord reads -3.0. The two steady chords also got different repetition shares (0.0 and 0.66): treat share as a pointer, as its reading says.

--sections alone picks the number of sections, a number fixes it, and tags joined by \| fix it and name them. The three-movement score, whose crossfades start at 24 and 34 seconds:

python mw.py analyze out/score.wav --sections "Dread|Turn|Dawn"
The output (Windows run)
{
 "ok": true,
 "librosa": "1.0.0",
 "files": [
  {
   "file": "out/score.wav",
   "tempo_bpm": 0.0,
   "beats": 0,
   "key": "C major",
   "key_confidence": 0.72,
   "runner_up": "E minor",
   "key_margin": 0.028,
   "runner_up_relation": null,
   "onset_strength_mean": 0.023,
   "note": "tempo can come back doubled or halved; key estimates on modal or pentatonic music often name the relative major/minor",
   "tuning": {
    "cents": -3.4,
    "spread_cents": 4.6,
    "trend_cents": null,
    "windows": 5
   },
   "harmony": {
    "changes_per_min": 0.0,
    "longest_span_s": 46.0,
    "top2_share": 1.0
   },
   "repetition": {
    "share": 0.37,
    "block_period_s": 8.8
   },
   "sections": [
    {
     "name": "Dread",
     "start_s": 0.0,
     "end_s": 25.4,
     "start_bar": null,
     "bars": null
    },
    {
     "name": "Turn",
     "start_s": 25.4,
     "end_s": 35.1,
     "start_bar": null,
     "bars": null
    },
    {
     "name": "Dawn",
     "start_s": 35.1,
     "end_s": 46.0,
     "start_bar": null,
     "bars": null
    }
   ],
   "sections_found": 3,
   "flags": [
    {
     "code": "KEY-AMBIGUOUS",
     "says": "C major only just beats E minor (unrelated)",
     "try": "name both keys in the caption or brief, or check the bass note of the first and last chord by ear"
    }
   ]
  }
 ],
 "reading": "pointers for what to listen to, not verdicts. tuning cents are against A440, one value per 10 s window; spread_cents is the 10th-90th percentile range (bends, vibrato and pitch effects raise it), trend_cents the last third against the first; repetition.share is the part of the track that repeats an 8 s block heard earlier (reported, not flagged: a listener heard a bed at 0.98 as less stuck than one at 0.13); harmony says how often the chords move (changes_per_min, longest_span_s, top2_share), uncalibrated and not flagged: a low rate names a one-chord take but suits an ambient bed, and it does not say which chords; sections come from timbre and harmony changes (4/4 assumed for bars); tempo can be doubled or halved, may be wrong on one file in ten or more even past that, and means little on rubato"
}
[exit 0]

The boundaries came back at 25.4 and 35.1 seconds, inside the two crossfades. The score has no beat, so tempo_bpm is 0.0 and the bar fields are null.

Since 0.1.6 each file also reports key_margin (the top key's profile score minus the runner-up's) and runner_up_relation (relative, parallel, fifth or null), and a margin under 0.05 flags KEY-AMBIGUOUS, as on out/score.wav above (Windows run).

--bpm and key_ends

New in 0.1.18. --bpm N passes an expected tempo to librosa as start_bpm, and the file's result reports it as tempo_prior_bpm. analyze also reports key_ends, the key of the head and the tail. The tail and head need a file of at least 9 seconds. On a 40-second test tone, analyze long.wav --bpm 120 gave:

{
 "tempo_prior_bpm": 120.0,
 "key": "A minor",
 "key_ends": {
  "head": "A minor",
  "tail": "A minor",
  "agree_with_whole": [
   "head",
   "tail"
  ]
 }
}

pulse

New in 0.1.1, standard library only. Is there a beat a percussion part can lock to: onsets from a 10 ms envelope, their spread (ioi_cv, the inter-onset intervals' coefficient of variation), the onset autocorrelation's peak against its median, the best tempo, how far the onsets sit from the best grid (beat, halves or thirds) against random onsets (grid_chance), and since 0.1.2 the median level rise over an onset (onset_rise_db). pulse is steady, weak or none; an onset_rise_db under 1 dB is a swell or a level ripple, not hits, so it is none with a why, and since 0.1.3 with no tempo or grid fields (null). No options.

python mw.py pulse take.wav m1.wav
{
 "ok": true,
 "files": [
  {
   "file": "take.wav",
   "duration_s": 44.99,
   "threshold": "global",
   "onsets": 71,
   "onsets_per_min": 94.7,
   "onset_rise_db": 6.46,
   "ioi_cv": 0.01,
   "autocorr_peak": 0.92,
   "autocorr_median": -0.05,
   "autocorr_contrast": 0.97,
   "tempo_bpm": 96.0,
   "grid_deviation": 0.016,
   "grid_chance": 0.217,
   "pulse": "steady"
  },
  {
   "file": "m1.wav",
   "duration_s": 26.99,
   "threshold": "global",
   "onsets": 77,
   "onsets_per_min": 171.2,
   "onset_rise_db": 0.41,
   "ioi_cv": 3.39,
   "autocorr_peak": 0.98,
   "autocorr_median": 0.27,
   "autocorr_contrast": 0.7,
   "tempo_bpm": null,
   "grid_deviation": null,
   "grid_chance": null,
   "pulse": "none",
   "why": "onsets rise under 1 dB: a swell or level ripple, not hits"
  }
 ],
 "reading": "steady: a beat a percussion part can lock to (tempo_bpm may be doubled or halved); weak or none: free time, so place accents on phrases or re-render on a fixed tempo rather than adding a beat. a track that builds from a quiet intro: rerun with --threshold adaptive, the global one misses the quiet hits. grid_deviation near grid_chance means the onsets ignore the grid; ioi_cv above about 0.8 is rubato or phrase-led; onset_rise_db under 1 means no hits at all; vibrato and tremolo can make false onsets"
}
[exit 0]

The take's kick reads steady at 96.0 bpm with ioi_cv 0.01, its onsets rising 6.46 dB. The slowly swelling tone m1.wav, which has no beat, reads none: its onsets rise 0.41 dB. 0.1.1 called it "steady" at 120 bpm (Errors). Since 0.1.3 tempo_bpm, grid_deviation and grid_chance are null beside none (0.1.2 still printed 120.0, 0.02 and 0.219 there).

Adaptive threshold

New in 0.1.6. The default global onset threshold can miss a quiet intro's hits once a loud section raises it. --threshold adaptive uses a moving median (median plus spread over a 3-second window). The stand-in has 3 dB hits for 12 seconds, then 30 dB hits. The global threshold found 24 onsets, and the adaptive one 47. Each row says which threshold ran.

ffmpeg -v error -f lavfi -i "aevalsrc='0.01*if(lt(mod(t,0.5),0.05),if(lt(t,12),1.41,31),1)*sin(2*PI*200*t)':s=48000:d=24" build.wav
python mw.py pulse build.wav
python mw.py pulse build.wav --threshold adaptive
The output
[exit 0]
{
 "ok": true,
 "files": [
  {
   "file": "build.wav",
   "duration_s": 23.99,
   "threshold": "global",
   "onsets": 24,
   "onsets_per_min": 60.0,
   "onset_rise_db": 29.82,
   "ioi_cv": 0.0,
   "autocorr_peak": 0.96,
   "autocorr_median": -0.04,
   "autocorr_contrast": 1.0,
   "tempo_bpm": 120.0,
   "grid_deviation": 0.005,
   "grid_chance": 0.2,
   "pulse": "steady"
  }
 ],
 "reading": "steady: a beat a percussion part can lock to (tempo_bpm may be doubled or halved); weak or none: free time, so place accents on phrases or re-render on a fixed tempo rather than adding a beat. a track that builds from a quiet intro: rerun with --threshold adaptive, the global one misses the quiet hits. grid_deviation near grid_chance means the onsets ignore the grid; ioi_cv above about 0.8 is rubato or phrase-led; onset_rise_db under 1 means no hits at all; vibrato and tremolo can make false onsets"
}
[exit 0]
{
 "ok": true,
 "files": [
  {
   "file": "build.wav",
   "duration_s": 23.99,
   "threshold": "adaptive",
   "onsets": 47,
   "onsets_per_min": 117.5,
   "onset_rise_db": 29.82,
   "ioi_cv": 0.0,
   "autocorr_peak": 0.96,
   "autocorr_median": -0.04,
   "autocorr_contrast": 1.0,
   "tempo_bpm": 120.0,
   "grid_deviation": 0.005,
   "grid_chance": 0.213,
   "pulse": "steady"
  }
 ],
 "reading": "steady: a beat a percussion part can lock to (tempo_bpm may be doubled or halved); weak or none: free time, so place accents on phrases or re-render on a fixed tempo rather than adding a beat. a track that builds from a quiet intro: rerun with --threshold adaptive, the global one misses the quiet hits. grid_deviation near grid_chance means the onsets ignore the grid; ioi_cv above about 0.8 is rubato or phrase-led; onset_rise_db under 1 means no hits at all; vibrato and tremolo can make false onsets"
}
[exit 0]

curve

New in 0.1.7, for film cues. Ranks takes against a target loudness shape: per-second short-term loudness against the interpolated --shape, rms error after removing the level offset, correlation, the worst second and the mean error per span. Shape points are time:lufs, with time in seconds, a percent of the take, or end. --absolute scores the level too. The first 3 seconds are skipped, since short-term loudness needs a full window.

The stand-ins are 40-second 220 Hz tones, arc.wav rising and falling and level.wav steady:

ffmpeg -v error -f lavfi -i "aevalsrc='0.3*sin(2*PI*220*t)*(0.08+0.92*sin(PI*t/40))':s=48000:d=40" -ac 2 arc.wav
ffmpeg -v error -f lavfi -i "aevalsrc='0.15*sin(2*PI*220*t)':s=48000:d=40" -ac 2 level.wav
python mw.py curve level.wav arc.wav --shape 0:-30,10:-18,50%:-14,end:-24
[exit 0]
[exit 0]
{
 "ok": true,
 "shape": "0:-30,10:-18,50%:-14,end:-24",
 "absolute": false,
 "takes": [
  {
   "file": "arc.wav",
   "duration_s": 40.0,
   "offset_lu": 0.6,
   "rms_error_lu": 1.48,
   "correlation": 0.94,
   "worst_s": 40,
   "worst_error_lu": -5.0,
   "spans": [
    {
     "from_s": 0.0,
     "to_s": 10.0,
     "target_lufs": [
      -30.0,
      -18.0
     ],
     "mean_error_lu": -0.7
    },
    {
     "from_s": 10.0,
     "to_s": 20.0,
     "target_lufs": [
      -18.0,
      -14.0
     ],
     "mean_error_lu": -0.4
    },
    {
     "from_s": 20.0,
     "to_s": 40.0,
     "target_lufs": [
      -14.0,
      -24.0
     ],
     "mean_error_lu": 0.4
    }
   ],
   "rank": 1
  },
  {
   "file": "level.wav",
   "duration_s": 40.0,
   "offset_lu": -1.4,
   "rms_error_lu": 3.35,
   "correlation": null,
   "worst_s": 3,
   "worst_error_lu": 7.4,
   "spans": [
    {
     "from_s": 0.0,
     "to_s": 10.0,
     "target_lufs": [
      -30.0,
      -18.0
     ],
     "mean_error_lu": 3.2
    },
    {
     "from_s": 10.0,
     "to_s": 20.0,
     "target_lufs": [
      -18.0,
      -14.0
     ],
     "mean_error_lu": -3.0
    },
    {
     "from_s": 20.0,
     "to_s": 40.0,
     "target_lufs": [
      -14.0,
      -24.0
     ],
     "mean_error_lu": 0.0
    }
   ],
   "rank": 2
  }
 ],
 "reading": "rank 1 follows the shape best. rms_error_lu is the miss after removing the level offset (--absolute keeps it): under about 2 LU follows the curve, over 4 does not. mean_error_lu per span says where: plus is too loud there, minus too quiet. correlation near 1 means it rises and falls with the target even when the depth differs. Short-term loudness lags up to 3 s, so a hit in the shape reads late; the first 3 s are skipped"
}
[exit 0]

arc.wav ranks first, at 1.48 LU rms and correlation 0.94; the steady tone misses by 3.35 LU, and its correlation is null because its loudness never moves. The output's reading calls under about 2 LU a follow and over 4 a miss; the project's research notes say those lines have not been judged on real cues. With --absolute, the offset stays in the score:

python mw.py curve arc.wav --shape 0:-30,10:-18,50%:-14,end:-24 --absolute
The output
{
 "ok": true,
 "shape": "0:-30,10:-18,50%:-14,end:-24",
 "absolute": true,
 "takes": [
  {
   "file": "arc.wav",
   "duration_s": 40.0,
   "offset_lu": 0.0,
   "rms_error_lu": 1.61,
   "correlation": 0.94,
   "worst_s": 40,
   "worst_error_lu": -4.4,
   "spans": [
    {
     "from_s": 0.0,
     "to_s": 10.0,
     "target_lufs": [
      -30.0,
      -18.0
     ],
     "mean_error_lu": -0.1
    },
    {
     "from_s": 10.0,
     "to_s": 20.0,
     "target_lufs": [
      -18.0,
      -14.0
     ],
     "mean_error_lu": 0.2
    },
    {
     "from_s": 20.0,
     "to_s": 40.0,
     "target_lufs": [
      -14.0,
      -24.0
     ],
     "mean_error_lu": 1.0
    }
   ],
   "rank": 1
  }
 ],
 "reading": "rank 1 follows the shape best. rms_error_lu is the miss after removing the level offset (--absolute keeps it): under about 2 LU follows the curve, over 4 does not. mean_error_lu per span says where: plus is too loud there, minus too quiet. correlation near 1 means it rises and falls with the target even when the depth differs. Short-term loudness lags up to 3 s, so a hit in the shape reads late; the first 3 s are skipped"
}
[exit 0]

The errors are on Errors.

answer

New in 0.1.1. Does a layered part answer the lead or double it: the part's level under the lead's notes, in the lead's rests and in its tail, from 10 ms frames. rests_minus_under_db of 3 or more "answers"; -3 or less "doubles". Options: --lead (required), --below (dB under the lead's loud frames that still count as playing, default 30).

Two stand-ins against lead.wav (a 440 Hz tone for two seconds in every four): reply.wav plays in the gaps, double.wav with the lead:

python mw.py answer reply.wav --lead lead.wav
python mw.py answer double.wav --lead lead.wav
{
 "ok": true,
 "part": "reply.wav",
 "lead": "lead.wav",
 "lead_threshold_db": -40.9,
 "lead_active_share": 0.5,
 "part_under_lead_db": -37.1,
 "part_in_rests_db": -13.5,
 "part_in_tail_db": -13.5,
 "rests_minus_under_db": 23.6,
 "part_active_in_rests": 1.0,
 "shape": "answers (louder in the lead's rests)",
 "next": "to make a part answer, duck it under the lead: mw.py duck PART --under LEAD --stem --out answer.wav, then measure again"
}
[exit 0]
{
 "ok": true,
 "part": "double.wav",
 "lead": "lead.wav",
 "lead_threshold_db": -40.9,
 "lead_active_share": 0.5,
 "part_under_lead_db": -13.5,
 "part_in_rests_db": -80.6,
 "part_in_tail_db": -80.7,
 "rests_minus_under_db": -67.1,
 "part_active_in_rests": 0.0,
 "shape": "doubles (quieter in the rests)",
 "next": "to make a part answer, duck it under the lead: mw.py duck PART --under LEAD --stem --out answer.wav, then measure again"
}
[exit 0]

render

New in 0.1.1. Notation to audio: ABC, ASCII guitar and bass tab, MusicXML or MIDI to a MIDI file plus audio, through FluidSynth and a SoundFont when both are found, otherwise a built-in sketch synth. The readers and writers are standard-library Python in scripts/notation.py. Options: --out (audio: .wav, .flac, .mp3, .ogg), --midi (default beside --out), --synth auto|fluidsynth|builtin, --sf2 (or MUSICWRIGHT_SOUNDFONT, or soundfont in the studio config.json), --gain (FluidSynth), --tail (seconds of silence after a FluidSynth render), --check, --bpm, --program (General MIDI number or name), --transpose, --chords (play ABC chord symbols), --tuning (tab: guitar, dropd, dadgad, openg, bass, bass5, guitar7, ukulele, or pitches), --tab-step (beats per tab column), --tune (which X: of a multi-tune ABC file).

--check reads the score without rendering, lists bars that do not add up, and gives melody hints per line. The repository's fixture tune (4 bars in G with a repeat, first and second endings, a triplet and chord symbols):

python mw.py render tune.abc --check
{
 "ok": true,
 "score": "<work>/tune.abc",
 "read_as": "abc",
 "title": "Fixture tune",
 "tracks": [
  {
   "name": "1",
   "program": 0,
   "drums": false,
   "notes": 25,
   "range": [
    "E4",
    "E5"
   ]
  }
 ],
 "notes": 25,
 "beats": 24.0,
 "duration_s": 12.0,
 "bpm": 120.0,
 "tempo_changes": 0,
 "meter": "4/4",
 "key": "G major",
 "warnings": [
  "9 chord symbols were not played (add --chords to play them)"
 ],
 "melody": [
  {
   "track": "1",
   "notes": 25,
   "leap_share": 0.0,
   "unrecovered_leaps": 0,
   "longest_step_run": 5,
   "top_note_visits": 2,
   "motif_share": 0.64,
   "hints": [
    "only 64% of the notes sit in a rhythm that comes back: build the line from one or two short motifs, repeated and varied"
   ]
  }
 ],
 "key_fit": {
  "key": "G major",
  "declared": true,
  "histogram": {
   "C": 0.083,
   "C#": 0.083,
   "D": 0.167,
   "E": 0.167,
   "F#": 0.042,
   "G": 0.208,
   "A": 0.038,
   "B": 0.212
  },
  "outside_share": 0.083,
  "strong_beat_outside": [],
  "flag": false,
  "reading": "a hint, not an error: chromatic notes on strong beats can be meant; when the key was not declared it was estimated, so declare K: or a key signature"
 },
 "next": "fix the warnings (a bar that is too long or short usually means a wrong note length); melody hints are rules of thumb for lines you wrote, not errors; then render with --out"
}
[exit 0]

Rendered with the built-in synth (this machine had no FluidSynth). The result is 13.5 seconds: 12 seconds of notes and the synth's decay:

python mw.py render tune.abc --out out/tune.wav --synth builtin
{
 "ok": true,
 "score": "<work>/tune.abc",
 "read_as": "abc",
 "title": "Fixture tune",
 "tracks": [
  {
   "name": "1",
   "program": 0,
   "drums": false,
   "notes": 25,
   "range": [
    "E4",
    "E5"
   ]
  }
 ],
 "notes": 25,
 "beats": 24.0,
 "duration_s": 12.0,
 "bpm": 120.0,
 "tempo_changes": 0,
 "meter": "4/4",
 "key": "G major",
 "warnings": [
  "9 chord symbols were not played (add --chords to play them)"
 ],
 "out": "<work>/out/tune.wav",
 "midi": "<work>/out/tune.mid",
 "synth": "builtin",
 "measure": {
  "duration_s": 13.5,
  "lufs_i": -13.5,
  "true_peak_dbtp": -5.9
 },
 "next": "listen, or make it sound performed with an AI cover of this render: mw.py gen --recipe acestep-rest --task cover --src OUT --strength 0.6 --caption \"<instruments, style>\" --seeds 1,2,3 (try 0.5-0.9)"
}
[exit 0]

A two-bar drop D riff from the fixtures. Tab carries no rhythm, so render took each column as 0.125 beats, which makes the usual four-column gap between notes an eighth note, and played it at 100 bpm; the warning says so:

python mw.py render riff.txt --tuning dropd --out out/riff.wav --synth builtin
{
 "ok": true,
 "score": "<work>/riff.txt",
 "read_as": "tab",
 "title": "tab",
 "tracks": [
  {
   "name": "tab",
   "program": 25,
   "drums": false,
   "notes": 11,
   "range": [
    "D2",
    "C4"
   ]
  }
 ],
 "notes": 11,
 "beats": 4.0,
 "duration_s": 2.4,
 "bpm": 100.0,
 "tempo_changes": 0,
 "meter": "4/4",
 "key": null,
 "warnings": [
  "tab has no rhythm: each column taken as 0.125 beats (the usual gap between notes = an eighth note); set --tab-step to change"
 ],
 "out": "<work>/out/riff.wav",
 "midi": "<work>/out/riff.mid",
 "synth": "builtin",
 "measure": {
  "duration_s": 3.9,
  "lufs_i": -19.5,
  "true_peak_dbtp": -5.4
 },
 "next": "listen, or make it sound performed with an AI cover of this render: mw.py gen --recipe acestep-rest --task cover --src OUT --strength 0.6 --caption \"<instruments, style>\" --seeds 1,2,3 (try 0.5-0.9)"
}
[exit 0]

The melody hints, on the fixture written to trip them (a random walk of leaps whose rhythm never repeats). They are rules of thumb from musicwright-compose's references/theory.md, calibrated on public-domain tunes against random walks:

python mw.py render wander.abc --check
{
 "ok": true,
 "score": "<work>/wander.abc",
 "read_as": "abc",
 "title": "Wandering line",
 "tracks": [
  {
   "name": "1",
   "program": 0,
   "drums": false,
   "notes": 20,
   "range": [
    "C3",
    "B6"
   ]
  }
 ],
 "notes": 20,
 "beats": 18.25,
 "duration_s": 9.125,
 "bpm": 120.0,
 "tempo_changes": 0,
 "meter": "4/4",
 "key": "C major",
 "warnings": [
  "no Q: tempo; rendered at 120 quarter notes a minute (set Q:1/4=N or --bpm)"
 ],
 "melody": [
  {
   "track": "1",
   "notes": 20,
   "leap_share": 1.0,
   "unrecovered_leaps": 1,
   "longest_step_run": 0,
   "top_note_visits": 1,
   "motif_share": 0.0,
   "hints": [
    "100% of the moves leap a fourth or more: the line sounds random; step back after a leap, and save leaps for after a run of steps",
    "only 0% of the notes sit in a rhythm that comes back: build the line from one or two short motifs, repeated and varied"
   ]
  }
 ],
 "key_fit": {
  "key": "C major",
  "declared": true,
  "histogram": {
   "C": 0.082,
   "D": 0.123,
   "E": 0.137,
   "F": 0.096,
   "G": 0.137,
   "A": 0.178,
   "B": 0.247
  },
  "outside_share": 0.0,
  "strong_beat_outside": [],
  "flag": false,
  "reading": "a hint, not an error: chromatic notes on strong beats can be meant; when the key was not declared it was estimated, so declare K: or a key signature"
 },
 "next": "fix the warnings (a bar that is too long or short usually means a wrong note length); melody hints are rules of thumb for lines you wrote, not errors; then render with --out"
}
[exit 0]
python mw.py render tune.abc
python mw.py render tune.abc --out out/tune.mid
{
 "ok": false,
 "command": "render",
 "error": "give --out (an audio file), or --check to only read the score"
}
[exit 1]
{
 "ok": false,
 "command": "render",
 "error": "--out is the MIDI file; give an audio file (.wav, .flac, .mp3, .ogg) and --midi for the MIDI"
}
[exit 1]

Since 0.1.4 render --check adds key_fit: the pitch-class histogram against the declared or estimated key, the share of notes outside it, and out-of-key notes on strong beats. It is a hint, not an error.

notate

New in 0.1.1. Converts between ABC, MusicXML, MIDI and ASCII tab, chosen by --to or the --out extension (.abc, .musicxml, .mid, .txt). MIDI and tab are snapped to a grid (--grid 4, sixteenths, by default). Options: --out (required), --to, --grid 2|4, --max-fret, and render's score options.

The fixture tune to MusicXML, then the MIDI that render wrote to guitar tab:

python mw.py notate tune.abc --out out/tune.musicxml
python mw.py notate out/tune.mid --out out/tune_tab.txt --to tab
cat out/tune_tab.txt
{
 "ok": true,
 "from": "abc",
 "to": "musicxml",
 "out": "<work>/out/tune.musicxml",
 "title": "Fixture tune",
 "tracks": [
  {
   "name": "1",
   "program": 0,
   "drums": false,
   "notes": 25,
   "range": [
    "E4",
    "E5"
   ]
  }
 ],
 "notes": 25,
 "beats": 24.0,
 "duration_s": 12.0,
 "bpm": 120.0,
 "tempo_changes": 0,
 "meter": "4/4",
 "key": "G major",
 "warnings": [
  "9 chord symbols were not played (add --chords to play them)"
 ],
 "next": "open .musicxml in MuseScore (free) for a printable score; mw.py render plays any of these back"
}
[exit 0]
{
 "ok": true,
 "from": "midi",
 "to": "tab",
 "out": "<work>/out/tune_tab.txt",
 "title": "Fixture tune",
 "tracks": [
  {
   "name": "1",
   "program": 0,
   "drums": false,
   "notes": 25,
   "range": [
    "E4",
    "E5"
   ]
  }
 ],
 "notes": 25,
 "beats": 24.0,
 "duration_s": 12.0,
 "bpm": 120.0,
 "tempo_changes": 0,
 "meter": "4/4",
 "key": "G major",
 "warnings": [
  "notes were snapped to a grid of 4 steps a beat; triplets and free rhythm come out approximate"
 ],
 "next": "open .musicxml in MuseScore (free) for a printable score; mw.py render plays any of these back"
}
[exit 0]
Fixture tune  (tuning E2 A2 D3 G3 B3 E4; 2 columns = one 1/16 note)
e|3-------7-------10------7-------|8-------12------10------9-------|7-----5-3-------0---------------|3-------7-------10------7-------|
B|--------------------------------|--------------------------------|--------------------------------|--------------------------------|
G|--------------------------------|--------------------------------|--------------------------------|--------------------------------|
D|--------------------------------|--------------------------------|--------------------------------|--------------------------------|
A|--------------------------------|--------------------------------|--------------------------------|--------------------------------|
E|--------------------------------|--------------------------------|--------------------------------|--------------------------------|

e|8-------12------10------9-------|--7---5-2-------3---------------|
B|--------------------------------|10------------------------------|
G|--------------------------------|--------------------------------|
D|--------------------------------|--------------------------------|
A|--------------------------------|--------------------------------|
E|--------------------------------|--------------------------------|
[exit 0]

The riff from tab to ABC:

python mw.py notate riff.txt --tuning dropd --out out/riff.abc
cat out/riff.abc
{
 "ok": true,
 "from": "tab",
 "to": "abc",
 "out": "<work>/out/riff.abc",
 "title": "tab",
 "tracks": [
  {
   "name": "tab",
   "program": 25,
   "drums": false,
   "notes": 11,
   "range": [
    "D2",
    "C4"
   ]
  }
 ],
 "notes": 11,
 "beats": 4.0,
 "duration_s": 2.4,
 "bpm": 100.0,
 "tempo_changes": 0,
 "meter": "4/4",
 "key": null,
 "warnings": [
  "tab has no rhythm: each column taken as 0.125 beats (the usual gap between notes = an eighth note); set --tab-step to change",
  "notes were snapped to a grid of 4 steps a beat; triplets and free rhythm come out approximate"
 ],
 "next": "open .musicxml in MuseScore (free) for a printable score; mw.py render plays any of these back"
}
[exit 0]
X:1
T:tab
M:4/4
L:1/16
Q:1/4=100
K:Dm
[D,,D,]2 [D,,D,]2 G,2 A,3 [D,,D,]2 F, A,2 C2 |]
[exit 0]

transcribe

New in 0.1.1. A recording to MIDI, and with --to ABC, MusicXML or tab beside it: librosa's pyin for one line (the default), or basic-pitch for several notes at once, which you install yourself (doctor reports it). Notes more than --gate dB under the recording's loud passages, or outside --lowest and --highest, are dropped. Options: --out (required: the MIDI file), --to, --engine pyin|basic-pitch, --bpm, --meter, --lowest, --highest, --gate, --program, --tuning, --grid.

The rendered fixture tune, written down again (Windows run, librosa 1.0.0):

python mw.py transcribe out/tune.wav --out out/tune_heard.mid --to abc --bpm 120 --lowest C3 --highest C6
cat out/tune_heard.abc
{
 "ok": true,
 "audio": "<work>\\out\\tune.wav",
 "engine": "pyin",
 "gate": {
  "threshold_db": -47.2,
  "dropped_quiet": 0,
  "dropped_out_of_range": 0
 },
 "files": {
  "midi": "<work>\\out\\tune_heard.mid",
  "abc": "<work>\\out\\tune_heard.abc"
 },
 "title": "tune",
 "tracks": [
  {
   "name": "tune",
   "program": 73,
   "drums": false,
   "notes": 47,
   "range": [
    "E4",
    "E5"
   ]
  }
 ],
 "notes": 47,
 "beats": 24.427,
 "duration_s": 12.214,
 "bpm": 120.0,
 "tempo_changes": 0,
 "meter": "4/4",
 "key": "G major",
 "warnings": [
  "pyin follows one line: chords come back as one note, and a free-time take is notated against 120 bpm, so the rhythm is approximate (check mw.py pulse; pass --bpm when you know it)"
 ],
 "next": "mw.py render the MIDI and compare it with the recording by ear; open the .musicxml in MuseScore to read or fix it"
}
[exit 0]
X:1
T:tune
M:4/4
L:1/16
Q:1/4=120
K:G
G4 B B3 d d3 B B3 | c c3 e e3 ^d =d3 ^c c3 | B B2 A G G3 E E6- E | G G3 B B3 d d3 B B3 |
c c3 e e3 d d3 ^c c3 | A B2 A F F3 G G6- G | G2 z12 z2 |]
[exit 0]

The pitches, range and key came back as written. The rhythm did not: pyin split most notes in two (47 notes for the 25 written; B B3 where the score has B2), and the repeat came back written out. A transcription is a draft; render it and compare by ear. Without librosa (Linux run):

python mw.py transcribe out/tune.wav --out out/tune_heard.mid
{
 "ok": false,
 "error": "librosa is not installed in this Python (transcribe uses its pyin pitch tracker)",
 "fix": "uv run --no-project --python 3.12 --with librosa --with soundfile python \"<plugin>/skills/musicwright/scripts/mw.py\" transcribe \"out/tune.wav\" \"--out\" \"out/tune_heard.mid\""
}
[exit 1]

verdict

Records a listener's keep, reject or maybe with their words, in the project ledger (found at or above the take) and in the studio's verdicts.jsonl, with the take's recipe when the ledger has the take. Options: --note, --by (default listener). Since 0.1.1 the take must exist as a file or as a logged take:

python mw.py verdict music/flute/takes/flute_s99999.flac reject
{
 "ok": false,
 "command": "verdict",
 "error": "no such file and no logged take named music/flute/takes/flute_s99999.flac"
}
[exit 1]

A file gen never logged (here a copy of a fixture made with edit) is recorded by its stem:

python mw.py new music/flute --name "Flute solo" --use listening --duration 60
python mw.py edit take_s1.flac --out music/flute/takes/flute_s63389.flac
python mw.py verdict music/flute/takes/flute_s63389.flac keep --note "clean, breathy, good ending"
{
 "ok": true,
 "dir": "<work>/music/flute",
 "manifest": {
  "musicwright": "0.1.17",
  "name": "Flute solo",
  "use": "listening",
  "duration_s": 60.0,
  "loudness_preset": "streaming",
  "created": "<now>",
  "ai_generated": true,
  "deliverables": [],
  "disclosure": null
 },
 "next": "fill brief.md, then mw.py gen ... --out music/flute/takes"
}
[exit 0]
{
 "ok": true,
 "out": "<work>/music/flute/takes/flute_s63389.flac",
 "length_s": 8.0,
 "duration_s": 8.0,
 "sample_rate": 8000,
 "channels": 1,
 "codec": "flac"
}
[exit 0]
{
 "ok": true,
 "ledger": "<work>/music/flute/ledger.jsonl",
 "studio": "<work>/studio/verdicts.jsonl",
 "recorded": {
  "type": "verdict",
  "date": "<now>",
  "take": "flute_s63389",
  "file": "music/flute/takes/flute_s63389.flac",
  "verdict": "keep",
  "note": "clean, breathy, good ending",
  "by": "listener"
 },
 "matched_take": false
}
[exit 0]

"matched_take": false because the ledger has no take line for it; the verdict is recorded without a recipe, under the name flute_s63389 (0.1.0 used flute_s63389.flac, which no take line could match).

ledger

Lists the ledger's takes with their verdicts, and the takes nobody has judged. The argument is a folder at or below the project (default the current folder).

python mw.py ledger music/flute
{
 "ok": true,
 "ledger": "<work>/music/flute/ledger.jsonl",
 "takes": [],
 "unjudged": []
}
[exit 0]

takes lists only lines gen wrote, so the verdict above does not show here. With no ledger at or above the folder:

python mw.py ledger music/nowhere
{
 "ok": false,
 "command": "ledger",
 "error": "no ledger.jsonl at or above music/nowhere"
}
[exit 1]

note

Appends a dated line to one of the studio's notes files: taste (taste.md), lesson (lessons.md), recipe (recipes.md) or idea (ideas.md), creating the studio folder and the file with a heading on first use. Option: --source.

python mw.py note taste "flute leads, never a drone under a solo" --source "flute solo, October"
python mw.py note lesson "cfg 7 on ACE-Step XL sounded harsh; 4.5 did not"
cat studio/taste.md
{
 "ok": true,
 "file": "<work>/studio/taste.md",
 "kind": "taste"
}
[exit 0]
{
 "ok": true,
 "file": "<work>/studio/lessons.md",
 "kind": "lesson"
}
[exit 0]
# Taste notes

Appended by mw.py note; curate with musicwright-curate.

- 2026-11-06: flute leads, never a drone under a solo (source: flute solo, October)
[exit 0]

The studio after the verdict and the two notes:

ls studio
cat studio/verdicts.jsonl
lessons.md
taste.md
verdicts.jsonl
[exit 0]
{"type": "verdict", "date": "<now>", "take": "flute_s63389", "file": "music/flute/takes/flute_s63389.flac", "verdict": "keep", "note": "clean, breathy, good ending", "by": "listener"}
[exit 0]

Clone this wiki locally