A custom HTDemucs (hybrid spectrogram + waveform transformer Demucs) model trained from scratch to separate synthetic engine/machine sounds into two stems. This is the high-capacity variant (110 M params, 2.6× the base model) with a widened/deepened cross-transformer, trained on the harder v2 engine dataset where the whine is never stationary.
| Stem | Content |
|---|---|
whine |
Tonal engine whines that are always dynamic: quick/slow/stepped acceleration and deceleration ramps, near-instantaneous pitch jumps, level surges and dips — no stable segment longer than ~2.5 s. Also steady mains/AC tones with mandatory slow drift (±2–8%), beating pairs, rich harmonic stacks with random ratios, inharmonicity, per-harmonic amplitude modulation, and "dirty" variants whose noise is very narrow-band and locked to the harmonic frequencies. Low-frequency mechanical thumps are embedded in this stem |
hiss |
Broadband noise floors (white/pink/brown) plus static bands, band sweeps, and progressively drifting hiss whose frequency and level track the whine's fundamental (higher RPM → louder + slight upward drift), level swells/dips, and short broadband crackle/arcing pops embedded in the stem. Every track contains a broadband floor carrying 20–50% of its power — no purely narrow-band hiss |
Trained on 2,048 synthetic training tracks per stem + 256 validation songs (44.1 kHz stereo WAVs, L/R duplicated mono content; generator seed 7331). Each mixture is exactly whine + hiss, so the model only ever has to decide "tonal vs. noise" — but on data where the tonal content is constantly moving.
models/demucs4ht.py from ZFTurbo/Music-Source-Separation-Training), 110.1 M parameterschannels=48, bottom_channels=768 (↑ from 512), t_layers=7 (↑ from 5), t_hidden_scale=4, nfft=4096, CaC (complex-as-channels), no Wiener iterations, sinusoidal time embeddingsdepth=4 and not 5 (audio.cpp compatibility): with nfft=4096 / stride=4 / kernel_size=8, a depth-5 model forces an "empty" final frequency block (the freq axis reaches freqs == kernel_size), which the stock audio.cpp runtime cannot load; dodging it with kernel_size=7 breaks the conv/conv-transpose shape symmetry and crashes the forward pass. Depth 4 with a widened transformer is the largest HTDemucs variant that converts to a working GGUF without modifying audio.cpp. (A depth-5 checkpoint of this project exists but only runs in PyTorch.)masked_loss, EMA momentum 0.999 (EMA weights are what's shipped), per-stem loudness augmentation ×[0.5, 1.5]Training-time validation (the repo's exact validation code path, plain non-scale-invariant SDR averaged over both stems): best epoch +20.17 dB (epoch 299). Progression: ep 50 → +16.7, ep 100 → +18.5, ep 160 → +19.4, ep 205 → +19.8, ep 299 → +20.2 dB.
On a real 78 s engine-start recording, the two stems together explain 97.9% of the input energy (vs 97.7% for the 42 M model on the same file), and the outputs correlate 0.988 (whine) / 0.992 (hiss) with the 42 M model's stems — the same interpretation, executed better.
| File | Description |
|---|---|
htdemucs-whine-hiss_v2_f16.gguf |
Self-contained audio.cpp GGUF (weights + config embedded), f16 (~210 MB) — recommended |
htdemucs-whine-hiss_v2_q8_0.gguf |
Same model, q8_0 quantized (~212 MB). At this size q8_0 offers no space saving (norms/biases stay float) and is waveform-equivalent to f16 (correlation 1.0000 on a real recording) — prefer f16 |
htdemucs-whine-hiss_v2_state_dict.pt |
Raw PyTorch state dict (native tensor names, fp32, ~440 MB) for use with the mss-training repo's inference.py |
Works with any stock audio.cpp build that supports the htdemucs family (the C++ pipeline reads the stem list, transformer depth and widths from the embedded config, so custom stems and non-standard transformer sizes work out of the box). Input must be stereo 44.1 kHz WAV (duplicate mono to L=R first if needed).
audiocpp_cli.exe --task sep --family htdemucs ^
--model htdemucs-whine-hiss_v2_f16.gguf --backend cpu ^
--audio input.wav --out-dir stems_out
Outputs: stems_out\whine.wav and hiss.wav (same length as the input). Runs comfortably on CPU. The SpectroCraft DAW plugin uses the same GGUF via its HTDemucs node.
pip install torch soundfile librosa # + mss-training requirements
git clone https://github.com/ZFTurbo/Music-Source-Separation-Training mss-training
cd mss-training
python inference.py --model_type htdemucs \
--start_check_point /path/to/htdemucs-whine-hiss_v2_state_dict.pt \
--config_path /path/to/htdemucs_gpu_train_2stem_v2.yaml \
--input_folder /path/to/folder_with_mixture.wav \
--store_dir /path/to/output
inference.py expects a raw state dict (not a Lightning checkpoint), and the model must be built with the v2 config (bottom_channels: 768, t_layers: 7) — the architecture differs from stock HTDemucs.
bottom_channels=768 / t_layers=7 means PyTorch use requires the matching config; GGUF use is unaffected (the config is embedded).models/demucs4ht.py in ZFTurbo/Music-Source-Separation-Training (training framework used here)MIT — use it however you like, no warranty. The synthetic training data was generated procedurally (no copyrighted material).