Music Is Mathematics
A guitar string, a radio tower, and a neutron star are, underneath, doing the same thing: vibrating at a rate that a wave equation can describe exactly. This page follows that single idea from one plucked string all the way out to scales, harmony, digital audio, radio, and the rhythms of the cosmos — with a full hands-on audio laboratory along the way. Every tool plays real sound through your speakers; nothing here plays itself.
One String, Four Numbers
Pluck a stretched string and it settles into a standing wave — a shape that vibrates in place, bouncing between two fixed ends. How fast it vibrates depends on exactly four things: how long it is, how tight it's stretched, how heavy it is per unit length, and nothing else.
Shorten the string, raise the tension, or use a thinner string, and the frequency goes up — exactly why a guitarist presses a fret (shortens L), tunes a peg (changes T), and uses thinner strings for higher notes (lowers μ).
Seven Letters for an Infinite Dial
Frequency is a continuous dial — there are infinitely many pitches between any two notes. Music theory just puts labels on useful stops along that dial: C D E F G A B, repeating every octave, with sharps and flats filling the gaps between most of them.
The anchor point is A4 = 440 Hz — not a law of physics, but an agreement. Before the 20th century, "A" wobbled anywhere from about 415 Hz to 450 Hz depending on the country, orchestra, and era. An international conference in London in 1939 standardized concert pitch at 440 Hz, later codified as ISO 16 — a human decision layered on top of a physical continuum[1].
Doubling Is the Whole Trick
220 Hz, 440 Hz, 880 Hz, 1760 Hz — each one sounds like "the same note," just higher, because each is exactly double the last. Human hearing perceives pitch ratios, not pitch differences: doubling frequency always sounds like "one octave up," whether you start at 55 Hz or 5,000 Hz.
No Note Is Ever Just One Frequency
Real vibrating strings and air columns almost never move at just one frequency. They vibrate simultaneously at the fundamental (f) and a stack of harmonics above it — 2f, 3f, 4f, 5f — all at once, layered together. The mix of how loud each harmonic is, relative to the others, is timbre: the reason a flute and a trumpet playing the identical fundamental frequency sound nothing alike.
Consonance Is Just Small Whole Numbers
The intervals that sound most stable to human ears turn out to be the simplest string-length ratios: cut a string in half and it sounds an octave higher; cut it to two-thirds and you get a fifth. Legend credits Pythagoras, around the 6th century BCE, with discovering this on a single-string instrument called a monochord — sliding a bridge along a string and finding that the pleasing divisions all landed on small integer ratios.
Twelve Equal Slices of a Doubling
The ratios in Chapter 05 are beautiful but don't stack evenly — a keyboard tuned in pure ratios plays wonderfully in one key and badly out of tune in others. The modern fix, standard since the 18th–19th century, is equal temperament: divide the octave into twelve equal logarithmic steps instead of using pure ratios at all.
The price of equal spacing: every interval except the octave is now very slightly out of tune from its pure ratio. It's a small enough compromise that every key sounds equally good — or equally imperfect, which is the entire point.
Fifth (3:2)
Pure: 701.96 cents. Equal-tempered: 700 cents. Off by ~2 cents — nearly imperceptible.
Major third (5:4)
Pure: 386.31 cents. Equal-tempered: 400 cents. Off by ~14 cents — the interval most tuning purists complain about.
When Two Waves Meet
Overlap two waves and they add together, point by point. Peaks lining up with peaks make a bigger wave (constructive interference); a peak lining up with a trough cancels out (destructive interference). Play two frequencies that are nearly — but not exactly — the same, and the result pulses in volume at a rate equal to the difference between them: a beat frequency. It's how every musician tunes by ear, listening for the beating to slow down and stop.
Same Note, Different Fingerprint
Every instrument playing "the same note" is really playing a different mix of harmonics on top of that shared fundamental. These are illustrative harmonic profiles — a simplified sketch of each family's character, not a measurement of one specific instrument — but the shape of each is real: a flute is close to a pure tone with a weak second harmonic; brass instruments push a lot of energy into higher harmonics, which is why they sound "bright"; a clarinet's cylindrical, closed-at-one-end bore suppresses even-numbered harmonics almost entirely.
Try these same harmonic mixes yourself in the Harmonic Mixer tool below.
Turning a Continuous Wave Into Numbers
A microphone produces a continuously varying voltage. A computer can only store numbers, taken at discrete moments — so digitizing sound means two separate approximations: sampling (how often you measure) and bit depth (how precisely you round each measurement).
The Nyquist theorem sets the rule for sampling: to faithfully capture a frequency f, you must sample at more than 2f times per second. CD audio samples at 44,100 Hz specifically because human hearing tops out around 20,000 Hz. Sample too slowly and high frequencies fold back into false low ones — aliasing. Round too coarsely (low bit depth) and you get quantization noise — a graininess in the waveform. Formats like MP3 add a further trick: they throw away the parts of the sound humans can't hear anyway (frequencies masked by louder nearby ones), which is why compression can shrink a file 10× with only subtle loss.
What Software Actually "Sees"
To a computer, music is just a long list of numbers over time — a time domain signal. But most of the interesting structure (which notes, which timbre, which harmonics) is easier to read in the frequency domain: a breakdown of how much of each frequency is present. The tool that converts one into the other is the Fourier transform — the same mathematical machinery a spectrum analyzer, a tuner app, and a graphic equalizer all quietly run underneath.
The Spectrum Analyzer in the lab below runs a real Fourier transform (via the Web Audio API's AnalyserNode) on whatever tone you're currently playing — the same live technique used in radio receivers, described in Radio Communications.
A Note Is a Wave. So Is a Satellite Signal.
A4 at 440 Hz, an FM radio station at 100 MHz, an amateur ("ham") radio band at 145 MHz, and a satellite uplink in the gigahertz range are all, mathematically, the exact same object: v = fλ. Nothing about the wave equation cares whether the medium is air carrying a pressure wave or vacuum carrying an electromagnetic one — only the frequency, and what's doing the vibrating, changes.
Log scale, 20 Hz – 40 GHz — nine orders of magnitude, one equation.
For the full picture of what happens once you're up in the radio bands — modulation, propagation, spacecraft telemetry — see Radio Communications and the broader survey of wave physics in Waves.
The Universe Keeps Time Too
Resonance and periodic vibration aren't confined to instruments. The Sun's entire surface rings like a bell, oscillating with a dominant period of about five minutes — a global "p-mode" acoustic wave first measured via the Doppler shift of sunlight, and the basis of the field called helioseismology, which probes the Sun's interior the way seismology probes Earth's[2].
Neutron stars called pulsars spin with such extreme regularity that some function as natural clocks precise enough to rival atomic ones. The fastest confirmed, PSR J1748-2446ad, completes 716 rotations every second — a rate that, remarkably, falls squarely inside the range of human hearing[3]. And when two black holes spiral together and merge, the gravitational waves they emit sweep upward in frequency into a literal audible chirp — LIGO's first detection in 2015 was pitch-shifted only slightly to become audible, turning a ripple in spacetime itself into a sound a person can hear[4].
Orbital resonance — where two orbiting bodies' periods lock into a simple ratio, echoing the same small-integer-ratio logic as musical intervals — is explored further in RESONANCE: The Mathematics of Music on the Aerospace field guide.
Nine Tools. Real Sound.
Everything below runs on the Web Audio API, live, in your browser. Nothing plays until you press play.
The Same Mathematics, Everywhere
A vibrating string, a column of air, a radio antenna, a neutron star, and a rippling patch of spacetime are all the same kind of object wearing different clothes: something oscillating, describable by the same handful of equations, whether the output is a melody or a chirp from half a billion light-years away.
- ISO 16:1975 — Standard tuning frequency (A4 = 440 Hz) — International Organization for Standardization.
- Solar Oscillations — arXiv, on the discovery and physics of the Sun's 5-minute p-mode oscillations.
- Pulsar Breaks Speed Record — Physics World, on PSR J1748-2446ad's 716 Hz spin rate.
- Gravitational Wave Audio Files — Gravitational Wave Open Science Center (LIGO/Virgo/KAGRA).