AI-powered audio-to-chart pipeline for Clone Hero & YARG
STRUM converts any song into a fully playable Clone Hero / YARG chart package β complete with pro drums, guitar, bass, vocals with lyrics, and keys β all generated from audio alone.
The system uses a two-stage neural drum transcription pipeline, neural onset detection with rule-based fret mapping for guitar/bass, Whisper-powered vocal transcription with pitch tracking, and spectral analysis for keyboard detection. Charts are exported as standard MIDI with four difficulty levels (Expert, Hard, Medium, Easy) and packaged with metadata, album art, and song.ini files ready for play.
βββββββββββββββ
β Audio File β
β (WAV/MP3) β
ββββββββ¬ββββββββ
β
ββββββββΌββββββββ
β Demucs v4 β
β Separation β
ββββββββ¬ββββββββ
β
ββββββββββββ¬ββββββββββββΌββββββββββββ¬βββββββββββ
βΌ βΌ βΌ βΌ βΌ
ββββββββββ ββββββββββ βββββββββββ ββββββββββ ββββββββββ
β Drums β β Guitar β β Bass β β Vocals β β Keys β
β Stem β β Stem β β Stem β β Stem β β Other β
βββββ¬βββββ βββββ¬βββββ ββββββ¬βββββ βββββ¬βββββ βββββ¬βββββ
β β β β β
βΌ βΌ βΌ βΌ βΌ
βββββββββββ βββββββββββ βββββββββββ βββββββββββ βββββββββββ
βTwo-Stageβ β Neural β β Neural β β Whisper β βSpectral β
β CRNN β β Onset + β β Onset + β β + pYIN β βKeyboard β
βEnsemble β βRule Fretβ βRule Fretβ β + Align β βDetector β
βββββ¬ββββββ βββββ¬ββββββ βββββ¬ββββββ βββββ¬ββββββ βββββ¬ββββββ
β β β β β
ββββββββββββ΄ββββββββββββΌββββββββββββ΄βββββββββββ
βΌ
ββββββββββββββββββββ
β Chart Export β
β .mid + song.ini β
β + album art β
β (4 difficulties)β
ββββββββββββββββββββ
The drums pipeline is the flagship component, using a two-stage detection-then-classification approach:
- Onset Detection β V14
TwoStageDrumsCRNNprocesses mel spectrograms (128 bins, 22050 Hz) to detect drum hit positions with 93.9% F1 score - Ensemble Classification β 6 independently trained
OnsetClassifiermodels (V2, V4, V6, V12c, V15, V16) vote on each detected onset to classify across 8 lanes (Kick, Snare, Hi-Hat, Crash, Ride, High Tom, Mid Tom, Floor Tom) achieving 85.2% F1 score - Spectral Disambiguation β Spectral centroid analysis resolves tom/cymbal confusion in ambiguous frequency ranges
- Post-Processing β Bidirectional iterative streak smoothing, kick-suppresses-floor-tom logic, rhythmic quantization, and lane conflict resolution
Pro drums are fully supported with separate tom and cymbal markers per the Clone Hero MIDI specification.
Guitar and bass share the same hybrid architecture (src/inference/guitar_hybrid_v2.py):
- Onset Detection β
OnsetCRNN(V2) detects note attacks on the Demucs-separated stem so vocals/drums don't trigger false positives. - Polyphonic Pitch β Spotify Basic Pitch transcribes simultaneous notes (chords + single notes), with bass-specific MIDI range overrides (24β67) when running on the bass stem.
- Pitch β Fret Mapping β Rule-based register allocation by default, with an optional learned
PitchToFretMapper(V4) gated behindSTRUM_FRET_MAPPER=1. - Section-Aware Density β An optional
SectionRoutermodulates onset peak thresholds per section (verse/chorus/solo) to prevent over- or under-charting.
- Lyric Transcription β OpenAI Whisper extracts word-level timestamps from the vocal stem
- Pitch Detection β
librosa.pyintracks vocal pitch contours at high time resolution - Dynamic Alignment β Whisper word boundaries are aligned with pitch onsets for accurate note placement
- Lyrics Fetching β Optional synced lyrics from LRCLIB and Lyrics.ovh APIs
- Harmony Detection β Configurable threshold (default 30%) for harmony/backing vocal phrases
- Keyboard Detection β Spectral flatness and harmonic ratio analysis identifies keyboard-active regions in the "other" stem
- Note Extraction β
librosa.onset_detect+librosa.piptrackextract individual key hits - Dual Output β Both 5-lane simplified and Pro Keys (full piano range) tracks
STRUM uses a grid-alignment BPM refinement algorithm that searches Β±5 BPM around an initial librosa estimate at 0.1 BPM resolution, then snaps the beat-zero phase to the first detected onset. Phase coherence is measured with circular statistics on beat positions vs. onset times. After all transcribers run, every event from every instrument is shifted by the same phase_offset_ms and snapped to the 32nd-note grid β with per-lane roll detection to preserve fast double-strokes and tom rolls.
This reduces post-snap grid error to <5 ms on the verified test set across drums, guitar, bass, vocals, and keys.
| Component | Metric | Score |
|---|---|---|
| Drums β Onset Detection (V14) | Frame F1 | 93.9% |
| Drums β Lane Classification (6-model ensemble) | Per-onset F1 | 85.2% |
| Drums β Best Single Classifier (V12c) | Per-onset F1 | 83.8% |
Evaluated on a held-out test set from 3,299 human-authored Clone Hero/YARG pro drum charts.
Aggregate per-instrument onset F1 against ground-truth Clone Hero/YARG charts. Songs were sampled from a held-out pool of 3,299 candidates and pre-screened by a single audio-feature operating envelope: median Demucs htdemucs_6s drum-stem RMS (1-second windows, 22050 Hz mono) β₯ 0.018. Eval is Expert difficulty, Β±100 ms tolerance with a per-song global offset search (Β±200 ms / 10 ms steps) to neutralize chart-sync conventions.
| Instrument | F1 | Precision | Recall |
|---|---|---|---|
| Drums | 83.8% | 82.4% | 85.4% |
| Guitar | 65.1% | 74.5% | 57.8% |
| Bass | 69.4% | 65.8% | 73.4% |
| Vocals | 53.9% | 63.2% | 47.0% |
Reproduce with:
python scripts/eval_benchmark.py \
--gt-dir /path/to/charts-gt \
--pred-dir /path/to/strum-predictions \
--tolerance-ms 100 \
--global-offset-search \
--out benchmark_results.json- Python 3.11+
- PyTorch 2.x with CUDA
- ffmpeg
- ~6 GB disk for model checkpoints
git clone https://github.com/oprialopez/strum.git
cd strum
python -m venv .venv && source .venv/bin/activate
pip install -e .Model checkpoints (~6 GB) are not committed; download from the releases page or train locally (see below).
Drop one or more .wav / .mp3 / .flac files in a directory and run:
# Full chart package (all instruments)
python scripts/batch_pipeline.py \
--songs-dir /path/to/songs/ \
--output-dir /path/to/output/
# Drums only (faster, no Demucs vocals/keys/bass passes)
python scripts/batch_infer_hybrid.py \
--songs-dir /path/to/songs/ \
--output-dir /path/to/output/Each output folder contains notes.mid, song.ini, the source audio, and album art ready to drop into Clone Hero / YARG.
| Variable | Values | Default | Effect |
|---|---|---|---|
STRUM_GUITAR_BACKEND |
hybrid, neural, rule, basicpitch |
hybrid |
Guitar transcription pipeline |
STRUM_BASS_BACKEND |
hybrid, neural, rule, basicpitch |
hybrid |
Bass transcription pipeline |
STRUM_FRET_MAPPER |
0, 1 |
0 |
Use learned pitchβfret mapper instead of rules |
STRUM_V12C_VARIANT |
default, community |
default |
Swap drum classifier v12c checkpoint |
All trainers are plain python scripts/train_*.py invocations driven by Hydra-style YAMLs in configs/. They expect a manifest of preprocessed windows produced by the matching preprocess_* / build_* script.
| Model | Preprocess | Train | Config |
|---|---|---|---|
| Drum onset detector (V14 CRNN) | preprocess_onset_windows.py |
python scripts/train_onset_classifier.py (also trains the onset head) |
configs/drums_v14.yaml |
| Drum classifier ensemble (V2/V6/V12c/V15/V16) | preprocess_onset_windows.py |
python scripts/train_onset_classifier.py --config configs/onset_classifier_v15.yaml |
configs/onset_classifier*.yaml |
| Tom-vs-cymbal refinement | (uses Demucs drum stem at train time) | python scripts/train_tom_refinement.py |
inline |
| Guitar onset CRNN (V1/V2) | build_guitar_manifest.py β preprocess_guitar_windows.py |
python scripts/train_guitar_v1.py --config configs/guitar_v2.yaml |
configs/guitar_v1.yaml, configs/guitar_v2.yaml |
| Pitchβfret mapper | build_mapper_dataset.py |
python scripts/train_fret_mapper.py |
inline |
| Section classifier (verse/chorus/etc.) | build_section_labels.py β preprocess_section_windows.py |
python scripts/train_section_classifier.py |
inline |
A typical training session for the drum onset detector looks like:
python scripts/preprocess_onset_windows.py \
--manifest /mnt/ml-data/manifest.json \
--output-dir /mnt/ml-data/onset_windows/
python scripts/train_onset_classifier.py \
--config configs/onset_classifier_v15.yamlW&B logging is enabled by default; set WANDB_MODE=offline to disable.
strum/
βββ configs/ # YAML configs (one per trainable model)
β βββ drums_v14.yaml # Two-stage drum onset CRNN
β βββ onset_classifier_v{6,12_clean,15,16}.yaml # Drum classifier ensemble
β βββ guitar_v1.yaml, guitar_v2.yaml # Guitar onset CRNN
β βββ inference.yaml, preprocessing.yaml
βββ checkpoints/ # Trained weights (gitignored)
βββ scripts/
β βββ batch_pipeline.py # β
Full multi-instrument pipeline (entry point)
β βββ batch_infer_hybrid.py # Drums-only production pipeline
β βββ chart_postprocess.py # Snap-to-grid + rescue passes + quantization
β βββ chart_enhancer.py # Difficulty reduction + lane balancing
β βββ vocals_charter.py # Whisper + pYIN vocal transcription
β βββ keys_charter.py # Keyboard detection + Pro Keys export
β βββ guitar_basicpitch.py # Basic-Pitch guitar backend
β βββ bass_basicpitch.py # Basic-Pitch bass backend
β βββ train_onset_classifier.py # Drum classifier training
β βββ train_tom_refinement.py # Tom-vs-cymbal refinement training
β βββ train_guitar_v1.py # Guitar onset CRNN training
β βββ train_fret_mapper.py # Learned pitchβfret mapper training
β βββ train_section_classifier.py # Section (verse/chorus/etc.) training
β βββ preprocess_onset_windows.py # Drum window preprocessing
β βββ preprocess_guitar_windows.py # Guitar window preprocessing
β βββ preprocess_section_windows.py # Section window preprocessing
β βββ build_guitar_manifest.py # Guitar dataset manifest builder
β βββ build_mapper_dataset.py # Pitchβfret dataset builder
β βββ build_section_labels.py # Section label builder
βββ src/
β βββ models/
β β βββ drums_v13.py # TwoStageDrumsCRNN architecture (V14 ckpt)
β β βββ onset_classifier.py # 8-lane drum classifier
β β βββ onset_classifier_dataset.py, onset_classifier_cached_dataset.py
β β βββ drums_v14_dataset.py # Drum onset dataset w/ bg-mel subtraction
β β βββ tom_refinement.py # Tom-vs-cymbal head
β β βββ guitar_v1.py # Guitar onset CRNN
β β βββ section_classifier.py # Section labeler
β β βββ bg_mel.py # Background-mel subtraction
β β βββ common.py
β βββ inference/
β β βββ guitar_hybrid_v2.py # β
Production guitar/bass backend
β β βββ guitar_neural.py # Neural-only guitar/bass backend
β β βββ guitar_bass.py # GuitarChart/Note/Chord dataclasses + rule backend
β β βββ section_router.py # Section-aware onset gating
β β βββ c3_rules.py # C3 chart rules (5-fret reduction etc.)
β βββ preprocessing/
β β βββ parsers/ # .mid and .chart parsers
β β βββ alignment.py # Audio-chart alignment
β β βββ separation.py # Demucs wrapper
β βββ export/
β β βββ midi.py # Pro drums + guitar/bass/keys MIDI export
β β βββ chart.py # .chart format export
β βββ lyrics/ # LRCLIB + Lyrics.ovh fetcher
βββ docs/
β βββ ARCHITECTURE.md # Technical specification
β βββ ROADMAP.md # Development milestones
βββ pyproject.toml
| Component | Technology |
|---|---|
| Language | Python 3.11+ |
| ML Framework | PyTorch 2.x |
| Audio Separation | Demucs v4 (HTDemucs) |
| Pitch Detection | librosa pYIN |
| Speech-to-Text | OpenAI Whisper |
| MIDI I/O | mido |
| Experiment Tracking | Weights & Biases |
| Config Management | Hydra |
| Audio Processing | librosa, soundfile |
| CLI | Click + Rich |
STRUM generates standard Clone Hero / YARG compatible chart packages:
Song Name/
βββ notes.mid # MIDI chart (480 ticks/beat, 4 difficulty levels)
βββ song.ini # Metadata (artist, title, charter, BPM)
βββ song.ogg # Audio file
βββ album.png # Album art (fetched automatically)
Each MIDI contains up to 5 instrument tracks:
- PART DRUMS β 5-lane pro drums with cymbal markers (MIDI notes 96-100, tom markers 110-112)
- PART GUITAR β 5-fret guitar (MIDI notes 96-100)
- PART BASS β 5-fret bass (MIDI notes 96-100)
- PART VOCALS β Pitched vocal phrases with lyric events
- PART KEYS β 5-lane keys + optional Pro Keys
Four difficulty levels per instrument: Expert, Hard, Medium, Easy (progressive note reduction).
Developed on NVIDIA DGX Spark (GB10 GPU, CUDA 12.8). Trained on ~5,000 human-authored pro drum charts from the Clone Hero community.
- Architecture β Technical specification
- Roadmap β Development milestones
- Demucs β Audio source separation
- OpenAI Whisper β Speech recognition
- librosa β Audio analysis
- Clone Hero / YARG communities β Chart format documentation
MIT
