Why do some melodies feel instantly right, balanced, memorable and satisfying, even if you have never heard them before?
New research from the University of Waterloo suggests that more than creativity is at play. Behind many great melodies, researchers found something surprisingly powerful: symmetry. Their work shows that advanced algebra can reveal deep musical patterns that are not always obvious by ear or even on a written score.
The findings could help composers better understand what makes melodies work, as the study offers a recipe for generating new melodies that follow specific symmetry rules, opening new creative possibilities for composers and researchers.
"Our goal was to build a clear mathematical bridge between abstract algebra and the experience of listening to music," said Olga Ibragimova, a PhD student in computational mechanics in Waterloo's Faculty of Engineering. "When we think of melodies as shapes we can transform, it becomes clear that composers have been using these kinds of symmetries intuitively for centuries."
To explore the blueprint of melody, the team used group theory, a branch of mathematics that studies symmetry and transformations. They simplified melodies into their essential note groups and examined how common musical changes affect structure. These changes include transposition, which shifts a melody up or down; inversion, which flips it; retrograde, which reverses it; and translation, which moves it through time.
Their analysis revealed symmetrical relationships in many melodies that help explain why certain musical phrases feel cohesive and complete.
The researchers created a framework that assigns each of the 12 notes in the chromatic scale a number from one to 12. This turns melodies into a form that can be studied using algebra. With this structure in place, they examined two major types of symmetry: tonal symmetry, which relates to the notes themselves, and positional symmetry, which relates to how those notes are arranged.
By separating those two layers, the team developed formulas showing how a melody can be transformed while keeping its underlying structure intact or intentionally reshaping it in predictable ways.
"What surprised us is how cleanly the mathematics separates tonal structure from positional structure," said Dr. Chrystopher Nehaniv, a professor of systems design engineering at Waterloo. "This duality helps us identify patterns that are not obvious by ear or by looking at a musical score. It also means we can systematically construct and count all possible symmetric melodies for a given length."
A paper on the study, Algebraic Applications in Investigation of Musical Symmetry, was published in the proceedings of the 6th AMMCS-International Conference on Applied Mathematics, Modeling, and Computational Science.