The Rhythm In Anything: Audio-Prompted Drums Generation with Masked Language Modeling

Patrick O'Reilly, Julia Barnett, Hugo Flores García, Annie Chu, Nathan Pruyne, Prem Seetharaman, Bryan Pardo

TL;DR

TRIA (The Rhythm In Anything) is a compact, 43-million parameter masked transformer model that converts arbitrary rhythmic sound gestures—like beatboxing or finger tapping—into high-fidelity drum tracks. By conditioning generation on separate audio prompts for rhythm and timbre, TRIA achieves flexible, zero-shot drum synthesis. Remarkably, it matches or outperforms a state-of-the-art 1-billion parameter model despite being trained on less than 10 hours of audio.

What Problem Does This Paper Address?

Musicians and non-musicians alike frequently use vocalizations (beatboxing) or physical gestures (tapping on a desk) to express musical ideas. However, translating these rough acoustic gestures into fully produced drum tracks is a tedious process involving manual sequencing, audio editing, or rigid transcription tools.

Existing audio-to-audio style transfer systems fail to bridge this gap effectively. They either require retraining for every new target drum kit timbre, or they fail to capture the abstract nature of human gestures—often flattening distinct sounds (like a vocalized kick vs. a snare) into identical loudness spikes. TRIA introduces a self-supervised approach to map arbitrary, low-fidelity sound gestures to complex full-drumkit recordings using an exemplar drum sound provided at inference time.

Methods

TRIA is designed as a transformer-based masked language model, building upon the architecture of VampNet.

Figure 2. The proposed TRIA system. During training (left), acoustic tokens of a tokenized drum recording are predicted, conditioned on surrounding unmasked tokens and rhythm features extracted from an augmented version of the recording; we illustrate three training examples. During inference (right), we fix the timbre prompt as a prefix and predict a masked suffix conditioned on aligned features extracted from the rhythm prompt. Inference predicts tokens in coarse-to-fine order.

Key components of the method include:

  • Audio Tokenization: TRIA uses the Descript Audio Codec (DAC) to compress 44.1kHz mono audio into discrete hierarchical tokens across 9 codebooks.
  • Masked Language Modeling: During training, the model learns to predict masked spans of drum tokens. It is conditioned on unmasked surrounding tokens (which provide the target timbre) and aligned rhythm features.
  • Dualized Rhythm Representation: To prevent the model from accidentally copying the acoustic texture (timbre) of the rhythm prompt (e.g., the sound of a human voice), the authors introduce a novel two-band mel-spectrogram with an adaptive splitting frequency. This frequency dynamically divides the audio energy equally into low and high bands. The representation is then standardized, bounded via a sigmoid function, and quantized into 33 steps. This creates a strict information bottleneck: it captures the essential low/high structural dichotomy of percussion (kick vs. snare) without leaking fine-grained timbral details.
  • Inference: At inference, a target drum recording serves as an unmasked prefix (timbre prompt), while the dualized features of a sound gesture guide the iterative, coarse-to-fine parallel decoding of the masked suffix (rhythm prompt).

Datasets

  • Training: Drum stems isolated from a 90% split of the MusDB18-HQ dataset, totaling just 8 hours of audio.
  • Rhythm Evaluation:
  • AVP (Amateur Vocal Percussion): 56 amateur beatbox improvisations with human-annotated transcriptions.
  • TapTamDrum: 1,116 two-tone tapping imitations of drum beats.
  • Timbre Evaluation: Drum stems from MoisesDB (240 commercial tracks). For baseline text-to-audio comparisons, 50 synthetic descriptions of acoustic and electronic drum kit timbres were generated using GPT-4.5.

Key Insights and Ideas

  • The Power of Dualization: A single-band loudness representation is too simple to differentiate percussion elements, while a full spectrogram leaks too much timbral information. The adaptive 2-band "dualized" representation strikes the perfect balance, capturing the core groove while filtering out the source instrument's identity.
  • Self-Supervision via Data Augmentation: TRIA does not require paired beatbox-to-drum data for training. By training entirely on drum audio and applying heavy audio augmentations (noise, band-pass filtering, pitch/phase shifts) to the rhythm conditioning features, the model naturally generalizes to non-drum sound gestures at inference time.
  • Data and Parameter Efficiency: By enforcing a smart conditioning bottleneck, a 43M parameter model can successfully compete with a 1B parameter model trained on 2,000× more data.

Key Results

The authors compared TRIA against MelodyFlow, a 1-billion parameter state-of-the-art text-guided music editing model.

  • Subjective Evaluation: In ABX listening tests, human crowdworkers showed no statistically significant preference between TRIA and MelodyFlow on beatbox prompts (AVP), and actually preferred TRIA on tapping prompts (TapTamDrum) with a 56.1% win rate.
Listener Preference Results
  • Rhythm Adherence: TRIA significantly outperformed MelodyFlow in preserving rhythmic structure. On automatic drum transcription metrics (onset F1 score at 100ms tolerance), TRIA achieved scores of 0.47 (snare) / 0.66 (kick), vastly outperforming MelodyFlow's best configuration of 0.23 (snare) / 0.23 (kick).
  • Timbre Adherence & Leakage: MFCC similarity analysis revealed that MelodyFlow suffered from timbre leakage, often mimicking the spectral structure of the vocal rhythm prompt. TRIA successfully avoided leakage, cleanly adopting the target audio prompt's timbre.
Figure 4. Given a rhythm prompt (top) with vocal kick and snare drum imitations, the “snare” sound can be replaced by user-provided samples via TRIA’s timbre prompting ability: (a) a bongo drum, (b) wood cracks, and (c) a noise burst. Given corresponding timbre prompts in text form, MelodyFlow adheres more closely to the spectral content of the rhythm prompt.

Limitations and Future Work

  • Western Bias: Because it was trained on MusDB18-HQ, TRIA is inherently biased toward Western commercial drum kits and may underperform on traditional or non-Western percussion instruments.
  • Commercial Constraints: The training set is restricted to educational use; deploying TRIA commercially would require retraining on proprietary or non-copyrighted datasets.
  • Future Directions: The authors plan to scale up the model and dataset size, explore fully learnable (rather than hand-crafted) dualized rhythm features, and adapt the architecture for other tasks like audio inpainting and drums-to-drums style conversion.

Summary updated

BibTeX
@inproceedings{oreilly2025rhythm,
  author = {Patrick O'Reilly and Julia Barnett and Hugo Flores García and Annie Chu and Nathan Pruyne and Prem Seetharaman and Bryan Pardo},
  title = {{The Rhythm In Anything: Audio-Prompted Drums Generation with Masked Language Modeling}},
  booktitle = {Ismir},
  year = {2025},
  doi = {10.5281/zenodo.17706486},
}
Figure