bandit developer on retainer: 48000 Hz Pro Tools export fed to 44100 Hz BANDIT model — band boundaries misaligned 8.8% — vocal SDR 2.8 dB vs 9.3 dB — $195,000 — 6 months — bandit developer on monthly retainer

bandit 0.1.0 (kwatcharasupat/bandit) • PyTorch 2.1.0 • librosa 0.10.1 • Python 3.10; input audio at 48000 Hz (Pro Tools native export); BANDIT model trained at 44100 Hz; no resampling applied; model.separate(audio) receives 48 kHz samples; n_fft=2048 → 23.44 Hz/bin at inference vs 21.53 Hz/bin at training (8.8% shift); all band-split Transformer boundaries misaligned; vocal SDR 2.8 dB vs 9.3 dB; fix: librosa.resample(audio, orig_sr=48000, target_sr=44100) • Southfield Bandit Audio Ltd. (4-person audio production platform; 6 months; 2.0h)

Southfield Bandit Audio Ltd. is a 4-person startup building a podcast and DJ remix production platform. Their use case requires high-quality audio source separation: isolate guest voices from music beds for podcast editing, and isolate vocals for DJ mashups. The team selected BANDIT (Band-split Audio Network with Dual-domain Independent Transformer, kwatcharasupat/bandit) for its strong benchmark SDR scores on the MUSDB18 test set. Their production audio comes from Pro Tools projects — the industry-standard DAW for professional audio production. Pro Tools defaults to 48000 Hz as its session sample rate, following the broadcast and professional video standard. The team exported their audio at 48000 Hz and fed it directly to the BANDIT model using model.separate(audio), assuming the model would auto-detect the sample rate. It did not. BANDIT has no sample rate detection mechanism; it processes whatever array it receives, assuming the samples correspond to 44100 Hz audio.

# separate.py — Southfield Bandit Audio Ltd. production pipeline
# bandit 0.1.0; PyTorch 2.1.0; librosa 0.10.1; Python 3.10

import torch, librosa, soundfile as sf
from bandit.core.model import MultiMaskBandSplitRNNTask

model = MultiMaskBandSplitRNNTask.from_pretrained("kwatcharasupat/bandit-all-stems")
model.eval()

def separate_stems(input_path: str, output_dir: str) -> None:
    # Pro Tools exports at 48000 Hz — the project native sample rate
    audio, sr = librosa.load(input_path, sr=None, mono=False)
    # sr = 48000  ← loaded at native rate
    # audio.shape = (2, num_samples)  ← stereo

    # PROBLEM: no resampling applied before inference
    # model was trained at 44100 Hz; assumes 44100 Hz input
    # model.separate() receives 48000 Hz samples but processes as 44100 Hz
    with torch.no_grad():
        stems = model.separate(
            audio,              # ← 48000 Hz samples fed to 44100 Hz model
                                #   model has no sr parameter — no auto-detection
                                #   STFT bin boundaries all computed at 44100 Hz assumption
        )

    for stem_name, stem_audio in stems.items():
        sf.write(f"{output_dir}/{stem_name}.wav", stem_audio.T, sr)

# Results on 500 test separations (podcast + DJ remix use cases):
# Vocal SDR:  2.8 dB  ← expected: 9.3 dB (MUSDB18 benchmark)
# Drums SDR:  3.1 dB  ← expected: 10.1 dB
# Bass SDR:   5.2 dB  ← expected: 7.4 dB
# Other SDR:  2.9 dB  ← expected: 8.1 dB
# User complaint: "Vocal isolation is unusable — drums and guitar bleed into the voice track"
# User complaint: "DJ vocal extract sounds muddy — separation is worse than a simple EQ cut"

BANDIT’s architecture is built around the band-split paradigm: the STFT of the input audio is divided into frequency bands by bin index ranges, and each band is routed to a dedicated Transformer trained to process that specific frequency content. The bin index ranges are fixed constants in the model — they were set during training at 44100 Hz. The critical invariant is that each bin index must map to the same Hz value at inference as it did at training. With n_fft=2048, bin k corresponds to frequency k × sample_rate / n_fft. At training (44100 Hz), this is k × 21.53 Hz/bin. At inference with 48000 Hz audio, the actual frequency is k × 23.44 Hz/bin — a uniform upward shift of 8.8% across all bins. Every band boundary is now pointing to the wrong frequency range.

How an 8.8% bin frequency shift misroutes vocals across all four band Transformers

# BANDIT band boundary analysis — 44100 Hz training vs 48000 Hz inference
#
# STFT parameters: n_fft=2048
# Hz per bin at 44100 Hz training:  44100 / 2048 = 21.53 Hz/bin
# Hz per bin at 48000 Hz inference: 48000 / 2048 = 23.44 Hz/bin
# Frequency ratio:                  23.44 / 21.53 = 1.089  (8.8% higher)
#
# Band boundaries (bin indices are fixed in model weights):
#
#   Sub-bass Transformer  — bins 0–42
#     Training  (44100 Hz): 0 × 21.53 to 42 × 21.53  =    0–905 Hz
#     Inference (48000 Hz): 0 × 23.44 to 42 × 23.44  =    0–985 Hz  (+80 Hz shift)
#     Impact: sub-bass transformer receives 80 Hz more signal than trained for;
#             lower vocal chest-voice content (100–985 Hz) partially processed here
#
#   Bass Transformer  — bins 43–171
#     Training  (44100 Hz): 43 × 21.53 to 171 × 21.53 =  926–3682 Hz
#     Inference (48000 Hz): 43 × 23.44 to 171 × 23.44 = 1008–4008 Hz
#     Impact: bass transformer trained on 926–3682 Hz content now handles 1008–4008 Hz;
#             vocal fundamental (100–926 Hz) MISSING from bass transformer at inference;
#             vocal formants 3682–4008 Hz bleed into this band instead of midrange
#
#   Midrange Transformer  — bins 172–684
#     Training  (44100 Hz): 172 × 21.53 to 684 × 21.53 = 3703–14730 Hz
#     Inference (48000 Hz): 172 × 23.44 to 684 × 23.44 = 4032–16023 Hz
#     Impact: midrange transformer trained on 3703–14730 Hz now handles 4032–16023 Hz;
#             vocal formants F2/F3 (1000–3703 Hz) distributed between bass and midrange
#             transformers — neither receives the full formant structure it was trained for
#
#   High Transformer  — bins 685–1023
#     Training  (44100 Hz): 685 × 21.53 to 1023 × 21.53 = 14751–22039 Hz
#     Inference (48000 Hz): 685 × 23.44 to 1023 × 23.44 = 16055–23977 Hz
#     Impact: high transformer handles 1304 Hz more content than trained; Nyquist at
#             48kHz is 24000 Hz vs 22050 Hz at 44100 Hz — extra 1950 Hz at top end
#
# Consequence for vocal separation:
#   Vocal fundamental (100–1000 Hz): spans 3 transformers at 48kHz vs 2 at 44100 Hz
#   Vocal formants (1000–4000 Hz):   split differently across bass/midrange boundaries
#   Each transformer receives frequency content that doesn't match its training distribution
#   Result: masks learned for specific frequency bands are applied to the wrong content
#
# SDR degradation:
#   Vocals: 2.8 dB vs 9.3 dB  (−6.5 dB)
#   Drums:  3.1 dB vs 10.1 dB (−7.0 dB)
#   Bass:   5.2 dB vs 7.4 dB  (−2.2 dB — bass most self-contained in sub-bass band)
#   Other:  2.9 dB vs 8.1 dB  (−5.2 dB)

Why six months of fine-tuning, EQ, and checkpoint switching could not fix a sample rate mismatch

The team received user complaints about poor vocal isolation and attributed the problem to insufficient training data for their specific audio domain (podcast speech over music beds; DJ mixdowns). Each intervention stayed within the model’s output or model weights — none touched the fundamental input preprocessing step that was the root cause.

# Month 1: Fine-tune on 100-track 48kHz domain dataset
#   SDR vocals: 3.1 dB (marginal +0.3 dB)
#   Reason: fine-tuning adjusts model weights but cannot restructure the fixed band-split
#   bin index boundaries; the learned band decomposition is baked into the architecture;
#   fine-tuning on 48kHz data trains the transformers to partially compensate for
#   receiving misaligned frequency content, but the structural mismatch remains
#
# Month 2: Post-process output — EQ boost 1–4 kHz on vocal stem
#   SDR vocals: 3.4 dB (+0.3 dB)
#   Reason: EQ amplifies content in the vocal formant range after separation;
#   this treats the symptom (too little vocal energy in output) not the cause
#   (incorrect band content fed to each transformer during mask computation)
#
# Month 3: Lower STFT masking confidence threshold from 0.5 to 0.3
#   SDR vocals: 3.0 dB (−0.1 dB — slight regression)
#   Reason: more permissive masking accepts lower-confidence mask predictions;
#   this does not change which frequency bins are routed to which transformer;
#   lower threshold passes more noise into the output, slightly worsening SDR
#
# Month 4: Switch from bandit-all-stems checkpoint to bandit-vocals-only checkpoint
#   SDR vocals: 2.9 dB (−0.2 dB)
#   Reason: different checkpoint, same 44100 Hz model expectation; vocals-only
#   checkpoint was also trained at 44100 Hz with the same n_fft=2048 band boundaries
#   The 48kHz input still misaligns every band — checkpoint selection is irrelevant
#
# Month 5: Add loudness normalization to −23 LUFS before inference
#   SDR vocals: 3.1 dB (+0.2 dB)
#   Reason: loudness normalization scales amplitude; it does not change sample rate
#   or the Hz-per-bin mapping; band boundaries still misaligned 8.8%
#
# Month 6: Request retainer engagement
#   All 500 test separations remain below 3.5 dB vocal SDR (benchmark: 9.3 dB)
#
# Retainer triage (2.0h):
#   Step 1 (0.5h): Check input sample rate → librosa.load(sr=None) → confirms 48000 Hz
#                  Check model training config → 44100 Hz confirmed in model card
#   Step 2 (0.5h): Add resampling before inference and test on 10 inputs
#                  → vocal SDR 9.1 dB immediately — confirms sample rate mismatch is root cause
#   Step 3 (0.5h): Run full 500-track re-separation with fix
#                  → vocals 9.1 dB; drums 10.0 dB; bass 7.3 dB; other 7.9 dB
#   Step 4 (0.5h): Document: explain that fine-tune Month 1 improved +0.3 dB because the
#                  model partially learned to compensate, but structural band-split architecture
#                  prevents full recovery without correct input sample rate

The retainer consultant identified the sample rate mismatch in 2.0 hours: 0.5h to load one test file with librosa.load(sr=None) to read the native sample rate (48000 Hz confirmed) and cross-reference against the BANDIT model card (44100 Hz confirmed); 0.5h to add one line — audio = librosa.resample(audio, orig_sr=48000, target_sr=44100) — and run 10 test separations, measuring vocal SDR at 9.1 dB (vs 2.8 dB before); 0.5h to process the full 500-track test set and confirm drums 10.0 dB, bass 7.3 dB, other 7.9 dB — all within 0.1 dB to 0.2 dB of the published MUSDB18 benchmark; 0.5h to document why the month-1 fine-tuning on 48 kHz data had produced only a marginal +0.3 dB improvement: the BANDIT architecture’s band-split bin boundaries are fixed structural constants, not learned parameters — fine-tuning adjusts the Transformer weights within each band but cannot move the boundary between bands. Hours logged to HourTab with per-session breakdown.

# Fixed separate.py

import torch, librosa, soundfile as sf
from bandit.core.model import MultiMaskBandSplitRNNTask

BANDIT_SAMPLE_RATE = 44100  # model training sample rate

model = MultiMaskBandSplitRNNTask.from_pretrained("kwatcharasupat/bandit-all-stems")
model.eval()

def separate_stems(input_path: str, output_dir: str) -> None:
    # Load at native sample rate — do not let librosa resample automatically
    audio, sr = librosa.load(input_path, sr=None, mono=False)

    # FIX: resample to model's training sample rate before inference
    if sr != BANDIT_SAMPLE_RATE:
        audio = librosa.resample(
            audio,
            orig_sr=sr,
            target_sr=BANDIT_SAMPLE_RATE
        )
        sr = BANDIT_SAMPLE_RATE
        # At 44100 Hz: Hz/bin = 44100/2048 = 21.53  ← matches training band boundaries

    with torch.no_grad():
        stems = model.separate(audio)  # receives 44100 Hz samples — band boundaries correct

    for stem_name, stem_audio in stems.items():
        sf.write(f"{output_dir}/{stem_name}.wav", stem_audio.T, sr)

# After fix (500 test separations — podcast and DJ remix use cases):
# Vocal SDR:  9.1 dB  vs 2.8 dB pre-fix   (benchmark: 9.3 dB — within 0.2 dB)
# Drums SDR: 10.0 dB  vs 3.1 dB pre-fix   (benchmark: 10.1 dB — within 0.1 dB)
# Bass SDR:   7.3 dB  vs 5.2 dB pre-fix   (benchmark: 7.4 dB — within 0.1 dB)
# Other SDR:  7.9 dB  vs 2.9 dB pre-fix   (benchmark: 8.1 dB — within 0.2 dB)
#
# Pro Tools workflow note:
#   Pro Tools projects default to 48000 Hz (broadcast standard)
#   Always check: audio, sr = librosa.load(path, sr=None)
#   Then: if sr != 44100: audio = librosa.resample(audio, orig_sr=sr, target_sr=44100)

Related retainer posts


Track retainer hours without a client portal

HourTab turns your time-tracker CSV into a public URL your client bookmarks. No login. No portal. CSV in, URL out.

See pricing →