Many years ago, I had to write an essay for an examination in English language. I wanted to surprise my teacher, a very gentle Briton from somewhere around Manchester, so I put together a study halfway between science and literature, titled Sherlock Holmes and the vanished information. In the essay I compared two mystery novels, The murders in the Rue Morgue by Edgar Allan Poe, in which the amateur detective Auguste Dupin elucidates the crime, and A study in scarlet, by Arthur Conan Doyle, in which Sherlock Holmes makes his first public appearance. There is a literary connection between the two novels, since it is generally acknowledged that Conan Doyle modeled his Sherlock on the figure of Dupin. My idea was to try to understand what triggers the interest of a reader of a mystery novel, how the suspense is created all along the text, and how the author builds up his case, to keep the reader interested until the final conclusion when the mystery is revealed. To this purpose, I used the notion of Shannon entropy. I divided the two novels into small blocks, each including a few pages (Poe’s novel is in fact a short story that fits in about 30 pages, while Conan Doyle’s novel is much longer, so I excluded all the initial part about Holmes and Watson meetings, and the long descriptions of Mormon life in the second part of the book). I assigned to each small block an “information score”, according to the amount of information and clues offered to the reader, compared to the knowledge needed to get to the final solution. Then, I estimated the Shannon entropy of the two novels and, on this basis, I concluded that Conan Doyle’s “pop” writing was superior to that of the great master Poe, at least as far as “mystery” quality is concerned (not daring to question the respective literary values). According to my modest analysis, the progressive and steady decrease in entropy found in Doyle’s novel was the key to keep the reader interested until the end, while the sudden revelation by Poe of the missing orangutan, just in the middle of the story, corresponded to a drastic change in the “information entropy”, something which makes the reader to anticipate too much too early, about the conclusion. 

Why am I telling you this? Because I was nicely surprised by an article published last February in Physical Review Research, in which the authors use a very similar idea to find the Information content of note transitions in the music of J. S. Bach. Of course, they are not as naïve as I was (but my study dated from 1981, I did all the calculations with pencil and paper…) and are using very sophisticated machine learning and neural networks to do the job. They analyzed a large number of musical pieces by Bach, by means of a computational model in which each note is represented by a node in a multidimensional space, and transitions between notes are represented by connecting arrows. Then, they used information theory on this large ensemble of data to deduce networks, ranked according to their Shannon entropy (a note-node connected to many others has a larger entropy that a note showing fewer transitions), and constructing patterns as random walks in the note-node space. As a result, they found that Bach’s music examples fall in a category of high-entropy networks, when compared to random networks of similar size, and the higher information content of Bach’s music networks is due to a higher heterogeneity than expected, from transition structures of comparable size. In short, the old Bach was able to pack more information into his musical structures compared to random computer-generated “music”. As a long-time passionate listener of Bach (the very first LP I bought at age 13, by saving on my pocket money, was a collection of Bach organ pieces played by Eberhard Fölster), I could not find this surprising at all: it always struck me obviously how Bach could write beautiful music, which didn’t look at all random. I could have written a Phys Rev paper myself with little effort.

What I find more interesting in this story, in the first place, is the possible connection between the well-known methodological regularities that Bach used to construct his music, and the underlying mathematics of musical composition. Bach was not a mathematician. There is no “Bach theorem” or a “Bach transform” in algebra or analysis. We know that he had no formal training in mathematics beyond elementary arithmetic. However, his music displays a quantity of patterns, structures, recursions, that have stimulated many mathematical reflections over the years. In terms of production Bach is no doubt the leader, with the BWV catalog counting 1128 compositions, ranging from short solo pieces to magnificent architectures like the Mass in B-minor (BWV 232). The Italian music historian Massimo Mila once wrote: “Bach’s immense musical production was put together […] with the scrupulous care of a craftsman, and relentlessly intended as a service to God. If Bach had been a shoemaker, he would have made to the greater glory of God an endless number of shoes, all carefully crafted and finished.”  One of the marvelous things about Bach is that he gave a delightful and enjoyable musical expression to some fundamental ideas in mathematics. Knowingly or not, he used purely geometric operations to explore melodies: techniques like transposition, inversion, and retrograde inversion, all have analogs in the world of classical geometry. For instance, his “Crab Canon” from The Musical Offering (BWV 1079) is a perfect example of his mathematically-minded writing, and of a playfulness that one would not expect from the rigid German composer. He designed a single melody in such a fashion that it provides its own counterpoint when played backwards on itself, like in a sort of musical Möbius strip (see this nice YouTube video).

The connection between sound and numbers is not new. Already in the VIth century BC, Pythagoras found proportions and consonances between the pitch of musical notes, and ended up with a philosophical construction linking music to numbers and to the very structure of the universe. This theory of “music of the spheres”, or Harmonia universalis, was developed in the Middle Age and arrived in the hands of Johannes Kepler, who wrote a treaty, Harmonices Mundi, to describe the similarities between regular polygons, music and astronomical measurements. In chapter V he starts with a long astrologicaldiscussion, but gloriously ends it by announcing the Third Law of planetary motion. The technique of contrappunto (counterpoint) developed from Gregorian monodic singing of the Xth century, into rich musical forms, like the canon and the fugue. Counterpoint has an undeniably mathematical appeal, although its foundation is very intuitive and mostly psychological: if you ever sung Frère Jacques or Froh zu sein in good company, you will agree on this. Sound can indeed be described in mathematical terms, and suggests a connection between the sort of mental gymnastics done by our brain when calculating, and the writing or reading of a musical score. It is well known that there exist mathematical relationships between the pitch of the notes on the musical keyboard. In our Western diatonic system, an octave is the basic repeat unit, separated by adjacent octaves by a factor of two in frequency. This makes the succession of notes on a piano a logarithmic scale of frequencies, and it cannot be a chance that our ear has a logarithmic scale of sensitivity. Intervals between notes have fixed frequency ratios within each octave, for example a fifth interval (say C to G) has the ratio 3/2. The first C in Bach’s Toccata and fugue in D-minor(BWV 565) has a frequency of 2094 Hz, the corresponding G is at 3136 Hz in the same octave, and at 1568 Hz (the half) in the octave below (this C-to-G, spiraling down from 2094 to 1568 Hz, is the descending interval you can hear in the famous opening of the toccata). Why such a fixed ratio? This was the significant innovation in the 17th and 18th century: the tempered musical scale, in which each octave was divided into twelve exact (“tempered”) intervals, and two adjacent notes on the keyboard are therefore separated in ratio by the twelfth root of 2 = 1.059463… Bach himself was the first great composer to strictly adhere to this tempered scale, a feature he exemplified in the twenty-four compositions of the Well-Tempered Clavier (BWV 846-893), one for each major and one for each minor key of the 12, in the scale of tones.

The deeper questions that come to mind are then, what makes music to please our ears? What makes it different from noise? Since music can be turned to numbers, is there a relationship between the musical brain and the mathematical brain? Human brain has evolved into an exquisite machine to detect patterns in the world outside us, and mathematics can be seen as a very sophisticated evolutionary device for survival. Our ancestors in the late Pleistocene had to fight and defend themselves in a hostile environment: it is no chance that the migratory expansion of early humans coincides with the extinction of the largest, most dangerous animals. Human brain developed to its present form around 200,000 years ago, up to a fourfold increase in size, and quickly turned into the most lethal weapon against its competitors. We have no sharp fangs, ripping claws, or venom glands, nor a thick exoskeleton to defend ourselves, but we can calculate and predict things such as aiming an arrow at hundred meters distance. Our mathematical ability is grounded in pattern recognition. Then, is it the melodic patterns that make music such a nice and fulfilling experience? And do such patterns have roots in a mathematical construction taking place inside our brain? In an interesting 2022 paper in Frontiers of Neuroscience, authors used magneto-encephalography (MEG) to track brain activity in professional musicians during simple arithmetic calculation tasks, and compared the results to the brain activity of the same musicians when involved in musical transposing (the operation of shifting up or down in the scale all the notes of a composition, by a fixed quantity). Music and math occupy separate cognitive domains, and separated from language, although there is some evidence they may both share domain-general structural processing mechanisms with language. The above study found both similarities and differences between the brain areas activated in the two types of tasks, math vs. music. Older neural imaging studieshad found a correlation between good mathematical performance of people trained in music vs. lower calculation abilities in others without any musical education. So, the question of a possible relationship between music and mathematics at the neuronal level is still very open.

When it comes to memory, music has peculiarities which are not found in other complex tasks. Learning information from a textbook may involve quite a lot of reasoning; learning a sequence of operations at work can require lots of time, and trial and errors; however, remembering a musical piece, or even memorizing a new song, is in most cases done effortlessly. You can usually recognize a song by listening to just one or two measures, even catching in the middle of the melody. Music is the last thing we forget. In his book Musicophilia, the renowned psychiatrist Oliver Sacks tells the story of a musician who, after suffering herpes encephalithis, was unable to retain any memory for more than a blink. He was unable to remember his entire past life, but he could play pieces he knew at the piano, and even conducting a choir by singing along. And his case is not unique also among non-musicians. He had his hippocampus destroyed by the infection, and by studying other patients with long-term amnesia, it is deduced that hippocampus and neighboring regions of the temporal lobe are crucial for storing and accessing long-term memories. Recent studies found that musical memory, however, localizes in two distinct areas (called “caudal anterior cingulate area” and “ventral pre-supplementary motor area”); since these areas are quite far from the hippocampus, they can be preserved even in badly damaged brains, such as in advanced Alzheimer patients, who in many cases can remember and play music with ease. The interesting thing is that these areas are also not extraneous to mathematical processing.

Since mathematics appears to be an exclusive feature of the human brain, I cannot conclude this letter before making another jump, to compare our human musical abilities to those found in other animals. First question is: are there any? Vocal learning, the ability to learn sounds from parents, seems to be extremely rare in the animal kingdom: it is restricted to humans, some marine mammals, bats. It is notably absent in higher primates. But it’s widespread in birds. Now, birds are an extremely interesting case. They are notoriously good at singing, and their vocalization very often feels like real music to our ears. However, their vocal anatomy and their brains are strikingly different from ours. Birds do not have a cerebral cortex, the brain region that is generally thought to give primates some of our more impressive cognitive abilities. And yet, despite lacking a cortex, birds are able to do many cognitively demanding tasks (you may have observed crows and magpies using simple tools to procure food; if you never have, check this video). Are their musical (according to our taste, Shakespeare confirms) abilities a sign of a more profound cognitive structure? Are birds… mathematical? While their brain lacks the traditional layered structure of the mammalian cortex, a recent study appeared in Science found some striking similarities at the molecular and cellular level. For example, the authors observed bird brain’s neurons with similar gene expression and connectivity patterns as those in distinct layers in the mammal brain, indicating that maybe the functional analogies are more significative than the anatomical dissimilarities.

If, at this point, I managed at least to arouse your curiosity, you may want to have a look at this 2014 PNAS paper by a group of scientists from Vienna and Marburg about the melodies of the hermit thrush, a small North-American bird whose singing was described by Walt Whitman as the most harmonious among birds. By recording 71 songs from this bird, the study found that the vast majority of songs used notes that fitted the same simple mathematical ratios as the human “well-tempered” harmony. While the study cannot conclude that birds follow the same musical conventions as humans (many other birds do no seem to care at all for our delicate ears), it certainly proves that humans recognize as “pleasing” those harmonies that follow those same mathematical proportions. And if you don’t want to read the paper, you might at least want to listen to the hermit thrush

Singing in the brain

Post navigation


Leave a Reply

Your email address will not be published. Required fields are marked *