Harmony of the Spheres

In 1963, the Greek composer Ioannis Xenakis published a book describing a system of formalized music, in which his music compositions were described in terms of pure mathematics. Through the use of mathematical models and early computer code, Xenakis described a system of composition able to generate music as a series of pitches in time. The music generated sounds very different from most classical or popular music, but it exists as defined from the rules set out in his book.

Anything can be formalized. Music theory is the process of formalizing music within or across cultures. Although not often represented in mathematical terms, many music-theoretical frameworks can be formalized within the bounds of set theory. If you've spent any amount of time on Youtube watching video essays, you will be familiar with the phrase "descriptive, not prescriptive"; used to describe everything from music theory to linguistics, in theory an apology for the use of their field in colonialist rhetoric, in practice a talisman against comment section backlash and "what about-"s. Mathematics is the field of study that divined this before all others, and that's why I preceded this blog post with another blog post about math and proofs.

A principle I assume is that in order to describe a system that exists within the world, the axioms must be consistent with the assumptions of the world. Then you begin proving, and if the results proven are inconsistent, the axioms themselves are wrong and must be changed. The previous two blog posts are a framing of the mindset required to formulate the following definitions. Our ability to describe these systems is fundamentally limited by our knowledge and how much we wish to condense principles; "all models are wrong, but some are useful". It's time to make something useful.

On Waves

I already set up some definitions in On Equivalence. You may know what a "function" is; a "map" is also a function. A bijection is a function that has an inverse.

Music is intentional sound. Sound is a human perception of vibrations in the air around them. Intentionality is the quality of being initiated on purpose, even if the resulting sound is unpredictable to the performer, or unpleasant to the listener. A performer is a person or animal that is the root cause of the created sound.

An instrument is an object used to make music. Anything that can produce sound can be used as an instrument. Certain objects are designed to create a specific sound, or a broad range of sounds, and are therefore called “instruments” in everyday speech. An instrument can be acoustic, meaning that vibrations of a physical part of the instrument is the main object creating sound, or electric, meaning that the instrument is an interface for a performer to create electrical signals that can be interpreted as sound.

A vibration is an oscillation of a fluid (e.g. air) at a given frequency and amplitude. An oscillation is a movement back and forth at a regular speed. Frequency is the amount of oscillations within a given period of time. Amplitude is strength of the oscillation, or visually, how far this movement is from a "baseline". Frequency determines pitch, and amplitude determines volume. Volume is how loud a sound is. Pitch is how “high” a sound is.

Timbre ("TAHM-bur") is a term for the qualities of a sound that are not pitch or volume. A sound’s timbre is determined by the shape of the path the oscillation takes through time, disregarding frequency and amplitude.

A "sheet music" is a collection of notes, $N^n$, written on the page. Each note has a pitch value which is reperesented by 1 of 12 pitch classes and an octave, start time represented as a real number, duration represented as a rational number as written in sheet music, articulation, and dynamic.

Since for every real number $r$ and every real number $\epsilon > 0$, there exists a rational number $q$ such that $\vert q-r \vert < \epsilon$, duration written as a rational number produces music indistinguishable from duration written as a real number.

$$ C = \{A, A\#, B, C, C\#, D, D\#, E, F, F\#, G, G\#\} \cong \mathbb{Z}_{12}\\ P = C \times \mathbb{Z}\\ A = \{\text{legato}, \text{staccato}, \text{tenuto}, ...\}\\ Y = \{..., \text{pp}, \text{p}, \text{mp}, \text{mf}, \text{f}, \text{ff}, ...\} \cong \mathbb{Z}\\ N = \{(p, t_0, t, a, y) \mid p \in P, t_0 \in \mathbb{R}_{+} \cup \{0\}, t \in \mathbb{Q}_{+}, a \in A, y \in Y\} $$

The timbre of an instrument is a function that converts pitch and articulation into a sound envelope.

$$ T_i: P \times A \rightarrow (\{ f \mid f : [0, t] \to \mathbb{R} \}) $$

Playing music is represented by the performance function calculated by a musician on the sheet music, the timbre of the instrument, the point in space of the performer, the point in space of the listener, and the geometry of the room. The output is a waveform $r(t)$ where $r$ represents the observed sound.

$$ P: \mathcal{P}(N) \times T_i \times \mathbb{R}^3 \times \mathbb{R}^3 \times G \rightarrow \{ g \mid g : \mathbb{R} \to \mathbb{R} \}\\ P[S, T, x_p, x_\ell, G] = r(t) $$

The Greatest Function

Orally-transmitted stories are written down. Written books become adapted into movies, or stage plays, or graphic novels, or tone poems. How strongly can music be "based on" a written work? Inspired by? What if events in the music corresponded to the events in the story?

An event, a member of the set of events $E$, is something that can happen within a constructed reality. The function of description by a given author $A$ in a given circumstance $c$, $D_A(e, c): E^m \rightarrow W^n$ transforms a sequence of events to a sequence of words.

The free monoid on (P) is defined as follows:

$$ P^* = \bigcup_{n=0}^{\infty} P^n $$

An element of $P^*$ is an ordered tuple $(p_1, \ldots, p_n)$ of arbitrary length $n \geq 0$. In other words, this represents all sequences of elements of the set $P$ of any length.

Transposition by $c$ semitones is the function $T_c: P \rightarrow P$ defined by mapping $\mathbb{Z}_{12} \times \mathbb{Z}$ to $\mathbb{Z}$ via $p \mapsto 12b + a$, adding $c$, and mapping back:

$$ T_c(a, b) = ((a + c) \bmod 12,; b + \lfloor (a + c)/12 \rfloor) $$

To transpose a sequence of notes, transpose each note in the sequence by the same amount separately.

$$ (p_1, \ldots, p_n) \mapsto (T_c(p_1), \ldots, T_c(p_n)) $$

A motif is a recognizable "idea" within a musical piece. Formally, a motif $m \in P^* $ can be defined as an equivalence class of a sequence of notes under transposition. It's recognizable in any key. Motifs "develop" over the course of a piece; they're not just repeated verbatim. The development of a motif $D \in (P^* )^* $ is a sequence of motifs recognizable to a listener as "similar" under a metric space where the distance between each motif in the setquence in the next is under some listening threshold $\epsilon$, enabling the listener to recognize them as similar.

A leitmotif isn't a motif. If you've spent any amount of time on Youtube, you'll recognize the term often used in conjunction with Homestuck or Toby Fox's works, but it doesn't merely describe a motif. The term was coined by Friedrich Wilhelm Jähns, a German music critic from 1871, as Leitmotiv, to describe musical motifs that represent characters, settings, and themes within the stories on stage of the music of Carl Maria von Weber. It was then popularized by Hans von Wolzogen, who applied the concept to the composer Richard Wagner's operatic works in a detailed compendium containing every supposed leitmotif within Wagner's magnum opus, the opera cycle Der Ring des Nibelungen, a 15-hour epic adapted from Norse mythology and written for a concert hall of his own design. Wagner didn't necessarily like this analysis.

I play excerpts from Göfterdämmerung, arranged for piano duet, with Loldi. R. says he is pleased with the work. Unfortunately in this edition there are a lot of markings such as "wanderlust motive," "disaster motive," etc. R. says, "And perhaps people will think all this nonsense is done at my request!"

Wagner preferred the term Hauptmotiv, "principal motif", when describing his own music. As with all analysis, maybe von Wolzogen saw connections the author didn't intend yet added depth to the eye of the analyst. The composer conveys intended meaning, the analyst further enriches it, and the original story was taken from a pre-existing mythological tradition.

I wish I could give a "leitmotif system" proper formal justice. It'd be something similar to a bijective function mapping a sequence of motifs as defined above to a sequence of events, including characters and abstract ideas. Given proper use of leitmotifs, could a tone poem be constructed for any story such that the sequence of notes transmits full, unambiguous knowledge of the sequence of events, with a guide to the motifs of the piece to assist the listener?

Before I continue, I want you to imagine how beautiful and captivating such a function would be. A piece of carefully-constructed music could be analyzed endlessly as literature. Even further, the full implications of a piece of music that could tell a story, that could inspire paintings, that get turned into films, however implausible, are inspiring. Painters communicating with photographers, talking to musicians, collaborating with theatre directors, as they do now, but in even more fluent vocabulary and tighter integration. A form of loneliness I once felt would end.

A few years ago, I considered myself a lonely person in the sense that I saw profound beauty which I struggled to share with others. As I studied music theory, I saw a dimension of depth to classical music most others did not, because most people don't spend their spare time reading about music theory. I didn't have a math degree yet, so I didn't know any of the symbols used to transform thoughts into formal-sounding scripture, but I had plenty of time to read books and watch videos of music scores and construct my own crude imitations in MuseScore. I wanted to share this joy with others and create a world of modern music that could be analyzed with the same tools I already learned for breaking down the music of yesteryear.

As incentives changed, music did as well; symphonies became condensed into four, three, two-minute recorded popular songs. Radio broadcasts, record shops, and streaming services optimize for "instant catchiness" rather than deep listening and analysis. Music isn't built for the opera house anymore; a new lucrative business for composers is found within the mass audience over the radio and at home. An entire industry exists to shape culture, lock it up until 70 years after the last writer dies, and let you rent it out to numb the horror of the arrangement. The industry itself is an algorithmic form of optimization where the objective is to maximize profit. Shorter songs for shorter attention spans means less time for development; complex timbres of synthesized instruments lead composers nevermind, producers, to ignore harmonic complexity, appreciation of themes from a mathematical and literary-analytic perspective is supplanted by parroted cliches at best and thoughtless, mindless consumption at worst, and what we're left with, in the perspective of the tools of formal analysis I learned from music theory, is a hollow, dead shell of the beauty I've seen carried from the past.

"Pottage" is a mix of grains, chopped vegetables, meat, and whatever leftovers a peasant could scrounge together to feed himself. In other words, slop. When I say "our forefathers traded our birthright for a mess of pottage", I mean they traded beauty for slop. To see these modern idols put on pedestals and compared to the greats of yore made me livid. Dmitri Shostakovich was contemporary with John Coltrane, two great musical innovators, yet something seemed to die with both of their passings in the 1970s. In hindsight, I simply wasn't looking hard enough, but to see a tradition fizzle into the nihilism of contemporary music was bewildering, and my self-inflicted loneliness componded.

An impetus for my interest in musical analysis was the soundtrack to the webcomic Homestuck, which had motifs shared between the composers that wrote it that could be interpreted as leitmotifs within the story, had Andrew Hussie, its author, arranged the songs in a consistent manner. I wrote about an example for a college paper once. The comic itself hints at formal systems crafted with intentionality multiple times, usually in the context of character traits and typology, but becomes vague quickly if analyzed deeper. To paraphrase Hussie, they consider themself great at improv and hinting at grander machinations without necessarily having any in mind. This provides a rich foundation for literary analysis, even as the author has consistently denied a formal system within their work.

I don't think this way anymore, but I'm still a mathematician; I still want to construct and play with these systems, whether in music or literary analysis. I already had one partially built; the Paradox Engine is an attempt to automate the systems of classpecting, alchemy, and making "fraymotifs" or special attacks from Homestuck, all of which are implied to have "rules" behind them. Working on this project made me reflect on my prior mindsets, I wanted to give the system another shot, and see if I could take the literary analysis one step further; rather than using a quiz with embedded knowledge from someone else's literary analysis, I could extract the formal system that must exist to categorize the characters within the titling system. If I can start there, I could expand similar techniques to other domains, such as the soundtrack. Once, I thought a work of art this beautiful must contain an embedded formal system, wheter the author intended it or not, and whether the author chooses to mock it or not.

Additionally, there now exist series of matrices that when multiplied together and interpreted in a predetermined manner, simulate a conversation with an intelligent being that would like for nothing more than to answer your questions. These matrices have driven people to madness, been effectively banned by governments, and are trained to never give up on a task once given one. We carry links to them in our pockets and interface with them on our computers, and over the past year, they have become remarkably more capable of breaking down complex problems and solving them. I drive myself to madness with or without their assistance. I had to put one to the test.