Preface

A Confession and a Claim

This textbook begins with a confession: for most of the history of Western academic institutions, physics and music have been placed in separate buildings. The physicist studies waves with differential equations; the musician studies harmony with staff notation. Both make use of concepts like frequency, resonance, and rhythm, but they rarely compare notes. When they do, the comparison is usually dressed up in soft language — "music is like physics," or "physics can be an inspiration for composers." The analogy is acknowledged, celebrated briefly, and then both parties return to their separate buildings.

This textbook rejects that arrangement. Its central claim is not that physics and music are analogous but that they share deep structural identity in many of their most important features. The harmonic series — the sequence of integer multiple frequencies produced by any resonating physical system — is not merely a loose metaphor for the quantized energy levels of quantum mechanics. It is the same mathematical object: a set of discrete states allowed by boundary conditions imposed on a wave equation. Fourier analysis does not "apply to" both music and physics as two separate applications of a single technique. It is the shared language in which both domains are written, because both deal fundamentally with the decomposition of complex signals into their component frequencies. Symmetry breaking is not a colorful way of describing how tonal music establishes a "home key" by analogy with how water freezes into ice. It is, by formal analysis, the same mechanism — a system that begins in a state of equal possibility selects one state, breaking the equivalence of all others.

These are not metaphors. They are structural identities. And once you see them, you cannot unsee them.

What Makes These Connections Non-Trivial

The connections between physics and music are not the obvious ones. It is trivially true that sound is a physical phenomenon — pressure waves propagating through matter — and that music is made of sound. That observation, while correct, is about as deep as observing that paintings are made of chemicals. It is technically accurate but misses everything interesting.

The non-trivial connections operate at the level of mathematical structure. Consider the harmonic series: when a string vibrates, it does not vibrate at a single frequency but at a whole set of frequencies — the fundamental, the octave, the fifth above that, the next octave, the major third above that. These frequencies stand in the ratios 1:2:3:4:5:6:... This series is not a curious fact about strings; it is a consequence of the wave equation combined with boundary conditions (the string is fixed at both ends). The allowed frequencies are exactly those for which an integer number of half-wavelengths fits in the string length. This is, mathematically, the same reason why electrons in a box can only have certain energies: the wave function of the electron must satisfy boundary conditions, and only discrete solutions are allowed. The musical overtone series and the quantum energy levels of a particle in a box are both manifestations of the discretization of a continuous spectrum by boundary conditions.

Or consider Fourier analysis. Joseph Fourier proved in 1822 that any periodic function can be represented as a sum of sinusoidal components. This theorem, which earned him both fame and resistance from the mathematical establishment of his day, turned out to be one of the most productive ideas in the history of science. It applies to heat conduction, to electromagnetic waves, to quantum wave functions, to signal processing — and to sound. Every musical tone has a Fourier decomposition, and that decomposition is exactly its harmonic series. The spectrum of a musical note and the spectrum of an atom are both Fourier decompositions; they are both representations of a complex wave as a sum of pure frequencies. The language is the same because the underlying physics is the same.

These are non-trivial connections because they operate not at the level of surface similarity ("both use the word frequency") but at the level of shared mathematical structure. Recognizing them is intellectually productive: insights from one domain transfer to the other, and the combined perspective reveals things that neither discipline sees on its own.

The Three Running Examples

Because this textbook covers an enormous range of material — from the physics of vibrating strings to the neuroscience of emotion, from Fourier analysis to the history of recording technology, from quantum mechanics to cultural musicology — it uses three recurring examples to provide continuity and grounding.

The Choir & the Particle Accelerator is a structural comparison that recurs throughout the book. A choir is a resonant acoustic system: each singer's vocal tract resonates at characteristic formant frequencies, the room resonates at its normal modes, and when voices align in frequency they create constructive interference. A particle accelerator is a resonant electromagnetic system: charged particles oscillate in resonant cavities, energy is exchanged between particle and field at characteristic resonant frequencies, and particles can exist in superpositions of quantum states that interfere constructively or destructively. The mathematics of resonance, interference, and normal modes is the same in both systems. By comparing them throughout the book, we build an increasingly rich understanding of what resonance is as a mathematical phenomenon, independent of whether it manifests in an acoustic or a quantum context.

Aiko Tanaka is a fictional character — a Japanese-American graduate student working on dual degrees in condensed matter physics at Stanford and music composition at the San Francisco Conservatory. Her dissertation topic is "Symmetry Breaking as a Compositional Strategy: From Phase Transitions to Tonal Collapse." She is not an idealized genius but a real-feeling student: precise but playful, impatient with artificial disciplinary boundaries, sometimes frustrated, sometimes delighted. Aiko appears in case studies and thought experiments throughout the book, modeling what it looks like to actually think across both domains rather than merely acknowledging that they are related.

The Spotify Spectral Dataset is a curated collection of audio features — spectral centroid, spectral rolloff, chroma features, MFCCs, tempo, valence, energy — drawn from Spotify's audio analysis API across approximately 10,000 tracks spanning 12 genres, from classical and jazz to K-Pop and West African highlife. This dataset grounds the technical chapters in real musical data. When we study Fourier analysis, we apply it to actual recordings. When we study audio compression, we measure the spectral loss in actual MP3 files. When we study the relationship between music and social media, we look at actual spectral correlates of viral tracks. The dataset makes the physics tangible and the music measurable.

The Four Recurring Themes

Beyond the running examples, four recurring themes appear and reappear throughout the book, each visited from new angles as we accumulate more tools.

Reductionism vs. Emergence asks whether physics can fully explain music. Sound is "just" pressure waves — but does that account for why Schubert's late string quartets are heartbreaking? Neural activity is "just" electrochemical signaling — but does that explain musical meaning? We will not pretend to resolve this philosophical question, but we will give it increasingly precise content as we move through the material.

Universal Structures vs. Cultural Specificity asks which features of music are grounded in physics and which are culturally constructed. The octave's special status seems to be both physics (the 2:1 frequency ratio) and cross-cultural fact (it appears in nearly every musical tradition). But the specific scales used within an octave vary enormously across cultures. Where is the boundary between physical necessity and cultural choice?

The Role of Constraint in Creativity observes that physical laws impose constraints on music — a string can only produce certain frequencies, a room can only support certain acoustic modes — but these constraints do not merely limit creativity. They generate it. The tuning systems of different musical cultures are creative responses to physical constraints; the contrapuntal techniques of Bach are maximally inventive solutions to the constraint of voice leading rules; John Cage's 4'33" is an exploration of the most fundamental constraint: the impossibility of silence.

Technology as Mediator tracks how each major technological change — from the invention of the piano to the invention of the MP3 to the invention of the recommendation algorithm — has changed not just how music is produced or distributed but what music is. Every medium introduces new physical constraints and removes old ones, and those physical changes have aesthetic and cultural consequences.

How to Approach This Book

This book is not designed to be read passively. Each chapter contains substantial analysis, and the Python chapters require active engagement with code. The exercise sets are graded from accessible to genuinely challenging, and the capstone projects require months of sustained work. But the book is also designed to be readable — to be intellectually exciting, to tell you things you did not know, and to change how you think about both music and physics.

The central question — why does the universe produce music? — is not a question with a simple answer. But it is a question with a very rich one, and this textbook is an attempt to provide it.


Let us begin.