Understanding the Mathematical Backbone of Western Music
Pythagoras figured out musical intervals around 500 BC by dropping weights on strings and listening to the ratios. A string vibrating at half the length produces an octave. Two-thirds gives you a perfect fifth. One and a half gives you a perfect fourth. The patterns are simple, but they're also where everything else comes from. Most people don't realize that equal temperament—the tuning system used in basically all modern music—is actually an approximation of these ratios. The twelfth root of two, raised to various powers, gives you twelve equally spaced semitones across an octave. But every note is slightly out of tune compared to the pure harmonic relationships Pythagoras discovered. That tradeoff is what lets you play in any key without things sounding wildly wrong. It's not perfect, but it works for most purposes.
From Ratios To Chaos: Music And Mathematics From Pythagoras To Fractals
The jump from clean fractional ratios to fractal mathematics happened much later. Around the 1970s, composers like Iannis Xenakis started applying set theory and stochastic processes to music. More recently, generative fractal algorithms have been used to create melodic structures and rhythms that follow recursive patterns. A Mandelbrot set, when mapped to frequency domains, can produce sequences that sound musical even though they're derived entirely from iterative complex number calculations. I spent a few months working on a project where I tried to generate drum patterns using a modified Lorenz attractor. The basic idea was to map the X and Y coordinates to velocity and pitch, then use the Z coordinate to control timing offsets. The output was interesting but rhythmically inconsistent because the attractor doesn't naturally produce the kind of periodic structure you need for beats that humans find groovy. I ended up quantizing the timing to a grid and then applying a low-pass filter to the pitch values, which smoothed out the worst chaotic jumps while keeping enough randomness to avoid sounding robotic. That workaround probably isn't the best solution. A better approach might be to constrain the attractor within a bounded phase space or use a different chaotic system altogether, like a driven damped pendulum, which has more predictable oscillatory behavior. But for quick prototyping, the quantization plus filtering method got the job done.
Here's something people often miss about the relationship between music and math: most of what musicians actually use on a daily basis has very little to do with advanced mathematics. You don't need fractals to write a chord progression. You don't need differential equations to understand counterpoint. The math shows up more clearly when you're doing signal processing, synthesis, or audio analysis than when you're composing. If someone tells you that music is fundamentally mathematical, that's partially true but also a bit misleading. Music is fundamentally about patterns humans find pleasing, and mathematics is just one of several tools we use to describe those patterns. The practical side of this starts with understanding that scales are just divisions of a frequency ratio. The major scale maps to the intervals 2:3:4:5:6:8:9:10:12:15:16 when you work from a base note and measure everything in just intonation. Equal temperament squashes those ratios so they divide the octave into twelve equal logarithmic steps instead. When you mix instruments tuned to different systems—say, a piano alongside a string quartet playing from the same score—you'll hear beating and dissonance that wouldn't exist if everything were in pure intonation. This is especially noticeable in sustained chords. Fractals enter the picture differently. They're useful for modeling the self-similar structures that appear in both music and nature. Bach's fugues, for instance, show recursive patterns at multiple timescales. A motif appears, gets transformed, and then reappears in a larger context. That's structurally similar to how a fractal contains smaller copies of itself at every magnification level. It's not a coincidence. Human pattern recognition operates on these recursive principles whether we're listening to music or looking at a coastline.
Get the Full Details

I once had a graduate student try to use a Hilbert curve to map musical data across multiple dimensions. The idea was to preserve locality when visualizing a large dataset of pitch and rhythm features. The Hilbert curve does a decent job of that, but it introduces its own distortion because of the way it folds through space. A simpler approach using principal component analysis combined with a t-SNE projection gave us cleaner visual clusters that were easier to interpret. Sometimes the more elegant mathematical tool is the wrong one for the practical task at hand. There's also a limit to how far you can push the music-math connection before it stops being useful. Automated composition systems that rely heavily on mathematical models often produce music that sounds technically correct but emotionally flat. The systems can replicate the surface structure of a piece without understanding why certain progressions work in a particular context. A circle-of-fifths progression works in a Bach chorale for reasons that go beyond the raw intervals. It works because of voice leading, harmonic rhythm, and the listener's expectation built up over centuries of exposure to similar patterns. If you want to experiment with this yourself, the easiest starting point is a basic Python environment with NumPy and SciPy. You can generate sine waves, apply frequency ratios, and hear the difference between just intonation and equal temperament within an hour. From there you can move into more interesting territory like building a simple synthesizer or generating patterns from iterative functions. There are no special downloads required beyond standard scientific libraries, and nothing proprietary that you'd need to pay for or register with.
The core concepts hold up reasonably well but they're not a complete picture of how music actually works in practice. The math describes structure, not meaning. Understanding that distinction saves you from chasing elegance where it doesn't belong.