Skip to content

Musicwright Produce

Mark Rogers edited this page Oct 23, 2026 · 2 revisions

musicwright-produce finishes and checks audio that exists: loudness to a destination with a true-peak ceiling, two-pass mastering, trimming and fades, formats and sample rates, clipping and silence checks, stems with Demucs or RoFormer, mixing fixes for AI output, and since 0.1.1 a mix check and loudness-matched comparisons. Everything is measured before and after. It runs mw.py measure, mixcheck, compare, preview, master, monobass, mix, edit and analyze.

When it starts

"master this", "how loud should it be", "is this clipping", "is it muddy", "why does mine sound smaller than", "check it in mono", "convert to ogg", "split the stems", "refresh musicwright-produce". Loops for games are game; fitting a video is score.

The steps

  1. Measure with mw.py measure (duration, rate, integrated loudness, loudness range, true peak, head and tail silence, interior gaps, clipping signs, warnings), mixcheck for what a mix engineer listens for (flags OVER-LIMITED, FLAT, MUDDY, BRIGHT, MONO-LOSS, LOW-WIDE, BELOW-RANGE; their rates on 78 real AI renders are in references/mixing.md), optionally analyze for tempo, key, tuning and repetition, and sheet to look. compare take ref sets a take beside a reference the user owns.

    Compare at one loudness (Step 1b): before a listener ranks takes or judges a fix, preview writes matched copies; --blind hides which is which, --as phone and --as quiet are the small-speaker and low-level checks.

  2. Pick the destination preset from loudness.json (the eight presets). Game targets apply to the whole game mix: master every music file of one game to one level and balance against sound effects in the engine.

  3. Fix, then master last: trim and fade (edit), repair, then loudness (master). Too much tail silence: edit --end <t> --fade-out 2-4. Clipping in the source: a lower target or a gentle limiter in a DAW, never more compression on dense AI output. LOW-WIDE: monobass folds the lows to mono under a 160 Hz crossover. FLAT on a piece that should build, or everything equally bright: with stems, mix --automate gives sections 1 to 3 dB of contrast and --shelves darkens the background parts. Muddy, harsh or dull without stems: it describes the problem and suggests EQ moves from references/mixing.md, because the agent cannot judge by ear. Fades go before master when it reports linear, after it when it reports dynamic. For a human mastering engineer, master --peak -6 hands over a gain-only pre-master.

  4. Formats: work in WAV or FLAC at the source rate, 48 kHz for games and video, OGG Vorbis for engines, MP3 only for distribution and never for loops (its padding adds silence: +1,728 samples measured when the gapless tag is missing). edit --out name.ext converts by extension.

  5. Report and record: every deliverable with its path and after-numbers, added to music.json.

What the numbers looked like

master on the 45-second stand-in take (Commands) went from -16.0 LUFS to -13.9 LUFS for streaming and to -17.9 for game-music, with one linear gain each. On a steady test tone it reported "dynamic" instead, which is a property of ffmpeg's loudnorm, explained on Errors and edge cases. mixcheck flagged the stand-in take MUDDY (its 220 Hz tone sits in the lowmid band), a clipped tone OVER-LIMITED, and a G3 tone under a flute brief BELOW-RANGE; preview brought three stand-ins to one level with gains of 0.0, 1.4 and 5.8 dB (Commands).

Rules

  • Measure before and after every change; never claim an improvement without the numbers.
  • Never let a listener compare copies at different loudness: preview them matched first.
  • Master last, once: re-mastering a mastered file stacks artefacts.
  • Keep the original take untouched in takes/; write results to out/.
  • GPL or AGPL tools (Matchering, Essentia) are called as separate programs, never vendored.

Files: skills/musicwright-produce/references/loudness.md (targets with sources), mixing.md (the mix flags, their rates and fixes for AI renders), ffmpeg.md (tested recipes, including some mw.py does not wrap), stems.md. Maintenance: tier moderate (next check due 2026-11-16); 11 eval cases, three runs recorded in TESTS.md (the latest 3/3 on 2026-10-23).

Clone this wiki locally