Repository navigation
AutoMix: detect singing voice, keep one voice at a time in blends - #238
Merged
Merged
Conversation
Records gain head_vocals / tail_vocals: a voice probability (sung or rapped) every 100 ms over the first and last 35.9 s. The detector is musicnn's MagnaTagATune model (ISC, code and checkpoint), converted to ONNX by scripts/musicnn-to-onnx.py and run by the same rten as Beat This!; its librosa front end is ported and checked against the reference. Non-overlapping 3 s patches over the planner's longest overlap keep it to ~1.4 s a track on one core. ANALYSIS_VERSION 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With voice curves on both records, a blend keeps its usual length when A's last voice ends before B's first (handover moved between them, onto B's downbeat), else shortens to 4 or 2 bars to fit the instrumental gap, else takes the shortest blend of at least 4 s with the bass swapped from B's entry and a 2 kHz presence cut on A. Beat-aligned fades drop bars to keep voices apart. Without voice data nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`vocals` times the detector and prints its curves; `--no-vocals` plans without voice curves so `pair` renders the before; `stats` counts plans whose voices overlap with and without them. Corpus records regenerated with ANALYSIS_VERSION 2 and three vocal pairs added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AutoMix analysis now finds where someone sings or raps at each end of a track, and the planner keeps one voice at a time in a blend.
Detector: musicnn (MTT_musicnn)
Caveat, the same kind as Beat This!'s: MagnaTagATune audio is Magnatune's CC BY-NC-SA. The weights are ISC, and the data isn't redistributed.
analysis/NOTICEhas the provenance and hashes;scripts/musicnn-to-onnx.pyreproduces the ONNX file. The Rust front end matches librosa/TF to 1e-3 (parity_with_reference, ignored, needs the script's output).Cost: +1.3–1.5 s per track on one core, measured old against new analyser alternately on five tracks: +15–17 % on 3-minute tracks, +8 % on a 5-minute one. That's fixed per track: 24 non-overlapping 3 s patches over the first and last 35.9 s, which is the planner's longest overlap. The network is ~45 ms a patch (onnxruntime is no faster), so covering the full 60 s loudness minute would have cost ~2.3 s.
Record
head_vocals/tail_vocals: aVocalCurvewith a probability every 100 ms, held over each 3 s patch.ANALYSIS_VERSION2, so the worker re-analyses everything.Planner
This applies only when both records have voice curves; otherwise behaviour is unchanged. "Apart" means A's last voice ends no more than 0.5 s after B's first.
Blends
Beat-aligned fades drop bars (down to 4 s) to keep the voices apart.
Smart and rescue fades are not voice-aware. They are 3–12 s and have no beat grid.
Corpus (100 tracks, 500 random pairs)
Reference set: three vocal pairs added; six existing plans changed (all vocal pairs).
Before/after renders (
hocket-mixlab --no-vocals pair …vspair …), worth a listen:Not done
🤖 Generated with Claude Code