The Circle of Fifths as Latent Geometry in Bach’s Well-Tempered Clavier

Najla Sadek, Joseph Bakarji
Proceedings of Machine Learning Research, PMLR 303:1-13, 2026.

Abstract

Can unsupervised deep learning methods encode fundamental music-theoretic features? We answer this question by training an autoencoder on J.S. Bach’s Well-Tempered Clavier and analyzing its latent space via principal component analysis. Sequences in the first two principal components are clustered hierarchically into pieces and keys that spontaneously arrange in a circle-of-fifths geometry. Quantitatively, relative major-minor key pairs (sharing pitch collections) lie more than three times closer than non-relative pairs, and circle-of-fifths distance correlates strongly with learned distances. This structure emerges entirely from reconstruction loss, with no harmonic labels or supervision. Our results suggest that the circle of fifths is an intrinsic property of tonal relationships, demonstrating that unsupervised representation learning can recover harmonic principles that open the door for interpretable data-driven exploration of latent spaces across diverse musical traditions.

Cite this Paper


BibTeX
@InProceedings{pmlr-v303-sadek26a, title = {The Circle of Fifths as Latent Geometry in Bach’s Well-Tempered Clavier}, author = {Sadek, Najla and Bakarji, Joseph}, booktitle = {Proceedings of Machine Learning Research}, pages = {1--13}, year = {2026}, editor = {Herremans, Dorien and Bhandari, Keshav and Roy, Abhinaba and Colton, Simon and Barthet, Mathieu}, volume = {303}, series = {Proceedings of Machine Learning Research}, month = {26 Jan}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v303/main/assets/sadek26a/sadek26a.pdf}, url = {https://proceedings.mlr.press/v303/sadek26a.html}, abstract = {Can unsupervised deep learning methods encode fundamental music-theoretic features? We answer this question by training an autoencoder on J.S. Bach’s Well-Tempered Clavier and analyzing its latent space via principal component analysis. Sequences in the first two principal components are clustered hierarchically into pieces and keys that spontaneously arrange in a circle-of-fifths geometry. Quantitatively, relative major-minor key pairs (sharing pitch collections) lie more than three times closer than non-relative pairs, and circle-of-fifths distance correlates strongly with learned distances. This structure emerges entirely from reconstruction loss, with no harmonic labels or supervision. Our results suggest that the circle of fifths is an intrinsic property of tonal relationships, demonstrating that unsupervised representation learning can recover harmonic principles that open the door for interpretable data-driven exploration of latent spaces across diverse musical traditions.} }
Endnote
%0 Conference Paper %T The Circle of Fifths as Latent Geometry in Bach’s Well-Tempered Clavier %A Najla Sadek %A Joseph Bakarji %B Proceedings of Machine Learning Research %C Proceedings of Machine Learning Research %D 2026 %E Dorien Herremans %E Keshav Bhandari %E Abhinaba Roy %E Simon Colton %E Mathieu Barthet %F pmlr-v303-sadek26a %I PMLR %P 1--13 %U https://proceedings.mlr.press/v303/sadek26a.html %V 303 %X Can unsupervised deep learning methods encode fundamental music-theoretic features? We answer this question by training an autoencoder on J.S. Bach’s Well-Tempered Clavier and analyzing its latent space via principal component analysis. Sequences in the first two principal components are clustered hierarchically into pieces and keys that spontaneously arrange in a circle-of-fifths geometry. Quantitatively, relative major-minor key pairs (sharing pitch collections) lie more than three times closer than non-relative pairs, and circle-of-fifths distance correlates strongly with learned distances. This structure emerges entirely from reconstruction loss, with no harmonic labels or supervision. Our results suggest that the circle of fifths is an intrinsic property of tonal relationships, demonstrating that unsupervised representation learning can recover harmonic principles that open the door for interpretable data-driven exploration of latent spaces across diverse musical traditions.
APA
Sadek, N. & Bakarji, J.. (2026). The Circle of Fifths as Latent Geometry in Bach’s Well-Tempered Clavier. Proceedings of Machine Learning Research, in Proceedings of Machine Learning Research 303:1-13 Available from https://proceedings.mlr.press/v303/sadek26a.html.

Related Material