Motivation
Music producers typically browse sample libraries looking for "a beat like this one" and recommendation systems tend to group songs by feel. Both system need a way to measure how similar two rhythm patterns are. Classic measures such as the Hamming or swap distance (Toussaint, 2013) were built for a single rhythm line; while they can be summed over instruments (Gómez-Marín et al., 2020), someone then has to choose how much each instrument counts. Each instrument is also still scored on its own, so the interplay between kick, snare, hi-hat, and bass is lost, there.
Contrastive self-supervised learning may capture this interplay. A model learns an embedding where two slightly altered versions of the same groove (i.e., a short, repeating drums and bass pattern) land close together, while different grooves land far apart. The alterations you choose (e.g., removing a very soft note, dropping some hi-hat hits, moving a bass note by one grid step) decide what the model treats as "the same groove". Nobody knows yet which choices give the best rhythm search: contrastive embeddings exist for audio (Spijkervet and Burgoyne, 2021) and piano MIDI (Bradshaw et al., 2025), but, to our knowledge, none exist yet for drums and bass patterns.
The project is hosted at RITMO and connected to GROOVE, a research project on rhythm in music.
Research questions
- RQ1. Which changes to a pattern should the model still treat as the same groove? Candidates include (i) making notes slightly louder or softer or removing the softest ones, (ii) dropping some hi-hat (cymbal) hits or swapping two bars, and (iii) moving notes slightly early or late. The question is which set gives the best groove search.
- RQ2. Does a little supervision from style labels, through a semi-supervised contrastive loss (Guinot et al., 2024), improve search for styles the model never saw labelled? What does it cost elsewhere?
- RQ3. If the clustering is rerun on a slightly different sample of the dataset, do the same grooves still end up together? Does this happen more often than with the Hamming and swap distances?
- RQ4 (extension). Can the symbolic encoder be distilled into an audio encoder, so the same groove search works on real recordings?
Evaluation
- For each groove, you check whether its nearest neighbours share its style, including styles held out from training.
- You recluster bootstrap samples of the dataset and measure how much the groups change (adjusted Rand index), against the Hamming and swap distances.
- As a sanity check, you compare embedding distances with published human similarity ratings of drum patterns (Gómez-Marín et al., 2020). No new listening experiment is needed.
Data and tools
- The Groove MIDI Dataset (Gillick et al., 2019) holds 13.6 h of drum performances by ten drummers, with style labels.
- The drums and bass tracks of Lakh MIDI allow larger-scale, noisier pretraining.
- The Lucerne Groove Library (444 drums and bass grooves with style labels) may be available through the GROOVE team.
A laptop is enough for the symbolic part. The audio extension needs a GPU, which the supervisors will arrange (e.g., the UiO machine learning nodes).
Plan
- Measure style search with the Hamming and swap distances (baselines) on the Groove MIDI Dataset.
- Encode drums and bass patterns as grids and build a library of pattern changes.
- Train encoders with different sets of changes (RQ1).
- Add style supervision and measure its trade-offs (RQ2).
- Analyse cluster stability (RQ3), then optionally train the audio encoder (RQ4).
Skills you will gain
- Self-supervised and contrastive representation learning in PyTorch
- Metric learning, embedding evaluation and retrieval
- Working with sequence data
Note that the same methods are used in search and recommendation systems well beyond music.
References
- G. T. Toussaint, The Geometry of Musical Rhythm, CRC Press, 2013. doi:10.1201/b13751
- J. Spijkervet and J. A. Burgoyne, "Contrastive Learning of Musical Representations," ISMIR, 2021. doi:10.5281/zenodo.5624573
- J. Guinot et al., "Semi-Supervised Contrastive Learning of Musical Representations," ISMIR, 2024. doi:10.48550/arXiv.2407.13840
- L. Bradshaw et al., "Scaling Self-Supervised Representation Learning for Symbolic Piano Performance," 2025. doi:10.48550/arXiv.2506.23869
- D. Gómez-Marín, S. Jordà, and P. Herrera, "Drum Rhythm Spaces: From Polyphonic Similarity to Generative Maps," Journal of New Music Research, 2020. doi:10.1080/09298215.2020.1806887
- J. Gillick, A. Roberts, J. Engel, D. Eck, and D. Bamman, "Learning to Groove with Inverse Sequence Transformations," ICML, 2019. doi:10.48550/arXiv.1905.06118