A few years ago a musician friend asked me “there’s this new tool topologists have called Persistent Homology. I’d like to see what it can do when you apply it to data from music. Want to help?”
That friend is also an electrical engineer and knows some things about signal processing. This was important to me — we had some external criterion (from outside of mathematics) for determining whether or not the insights from Persistent Homology were interesting or not.
So I said “okay!” Not really knowing what I was getting myself into.
We got to work, over some rather cool, soggy Victoria winter days.
The idea was to take piles of data from music, put various standard metrics on them, feed them into software that computes the barcodes, and analyze the output, to see if the barcodes see anything that we did not already know about the data. The answer turns out to be yes.
Sometimes the barcodes saw some rather subtle and insightful things. Sometimes they saw some subtle and relatively mundane things. Let me tell you about a few.
First, a quick summary of persistent homology. Jesse has talked about this quite a bit on the blog, but if you’ve forgotten or missed it, the idea goes back to Vietoris.
Given a finite metric space X, you form a family (parametrized by a non-negative real number ε≥0) of simplicial complexes X(ε) whose vertex set is X. You give X(ε) an edge if the distance between two vertices of X is less than ε, similarly you give it a simplex is the pairwise distance between all the prospective vertices is less than ε. The family X(ε) forms a filtration of a contractible simplicial complex X(∞), so the homology of the spaces X(ε) is a family of abelian groups and inclusions, which eventually “dies” when the parameter ε is larger than the diameter of the metric space X. Similarly, the homology of X(0) is that of a finite discrete space. The homology classes that exist for large ε-intervals are called persistent, and one imagines them as describing somewhat relevant shapes in your data. The bar codes essentially represent these intervals over which homology classes live.
The subject of Persistent Homology is advancing fairly rapidly at present, but there are still many unsolved foundational problems in the field. If a person has envy for all the successes of Milnor, Thom and Serre, setting up the foundations of algebraic and differential topology, I can’t imagine a better field to go into.
Anyhow, back to our computations. One of the more interesting computations we looked into was the homology of certain points in the space of rhythms. Here we think of rhythms as the periodic beating of a drum. To make a space from rhythms, we consider the finite-subset space of a circle. Typically this is denoted exp(S^1). A point of exp(S^1) is a finite (non-empty) subset of the unit circle. The metric on exp(S^1) is the Hausdorff distance. That is the longest distance between a point in one set, and a point in the other. One thinks of a point in exp(S^1) as an explicit periodic beating of a drum, with one point for each beat, and the beat repeats itself every 2π units of time. This does not suffice because two essentially-identical beats can be phase shifts of each other, so our periodic rhythm space is the metric quotient exp(S^1)/SO_2 where SO_2 acts on the circle in the natural (linear) way. So this model for beats ignores many things — for instance the loudness and duration of a drum strike are ignored. There is no notion of different types of drums in this model, and so on.
As our data set, we took a table of Afro-Cuban rhythms. Here are the barcodes.
There are a few nifty things about this computation. There are no homology classes other than in dimension 0. So these barcodes say the data begins as a collection of isolated points, and then after a certain threshold (near ε=0.06) a transition occurs, and the simplicial complex becomes contractible. This strongly suggests the data is a metric tree. We checked, and it turns out the data is a metric tree. The tree appears to be the genetic tree for how afro-cuban rhythms evolved (I don’t know this branch of music well enough to know for sure, but that’s my hunch). Specifically, the centre of the tree of Afro-Cuban rhythms is known as son clave (or clave son), which is thought to be the first afro-cuban rhythm. It would appear the remaining rhythms evolved from this, by making individual changes — doubling a drum strike here, or shifting one there, etc.
Other metric spaces we considered were things like the space of pairs of notes, where one note occurs immediately after another in a composition. The feature we saw most often here in the barcodes were things like a composer’s tendency to “return” to a theme note, with little departures here and there.
On a more topological side, there were some fun observations that a certain “octave-reduced space of 3-note melodies” were homeomorphic to S^1 x S^2, so the homology of S^2 sometimes appears naturally when studying melodies in this manner.
There are several databases out there of various condensed forms of all world music — close to everything recorded in human history. It’s interesting to speculate about what the shape of that data would be. It would be interesting to discover if there is much relatively unexplored territory in this space — is it because we lack the imagination to find it, or is it because it’s all too atonal? More pessimistically, it could be a gaussian distribution centred on Britney Spears.
This leads to one of my personal favourite questions: what kind of normality tests are there for data, using persistent homology?