Music Theory for Programmers
109 points - last Wednesday at 8:19 PM
SourceComments
If you actually want to learn music theory for the purposes of playing I strongly recommend you just follow whatever tutorials for your instrument and style and if you get to the point where feel you want to learn more and take it seriously in and of itself, buy âThe Jazz Theory Bookâ by Mark Levine[1]. In spite of what it says, there really isnât any such thing as Jazz theory - itâs just music theory, and this book is a great presentation with lots of good examples. If you like jazz (or the western popular music tradition including rock, pop, funk, etc) youâll come out understanding how that music works better than most people. If youâre doing a music degree, there will be books recommended by your music programme, but honestly, Levine will cover most of what you need if youâre not doing a straight classical course in which case youâll want to augment with a more conventional source so you understand the ârulesâ they want you to follow when writing pastiche counterpoint etc.
If you want to get big into composition and/or want to understand late romantic and 20th century music, get Harmonielehre and âStructural Functions of Harmonyâ by Schoenberg. Together they are by far the best harmony books I have ever seen and go super-deep into why the western classical tradition works the way it does. If you compose thereâs a decent chance they will change your life forever as his approach is to not take anything for granted but exhibit everything with examples from masterworks of the western tradition. Amazing books both of them. Harmony is not a spectator sport though - to get full benefit you have to get the books and work through stuff on the piano. It will reward you immensely.
If you want something else that will blow your mind, read âThe technique of my musical languageâ by Messiaen. If you read Levine first this will have the additional benefit of showing you where the âdiminishedâ and âaugmentedâ scales and the whole âharmonic majorâ thing come from.
There is of course a lot of physics involved. But there is at least as much convention at play. So imho this is a very one sided way of looking at it.
There is a physical reason the 12 notes are those 12 notes (though the exact frequencies assigned are influenced by culture as well), but lots of different cultures use less notes, or more, or extra notes inbetween.
So 'Because that is the convention.' is imho at least a good an explanation as the physics one.
This article is trivializing music down to a few not-so-important facts and mistaking some math for anything that would help `programmers` (?) understand music.
Maybe start by rewatching "This is Spinal Tap" instead, and consider that https://www.reddit.com/r/musictheory/comments/59n3pg/remembe...
https://bcantrill.dtrace.org/2026/09/05/the-revolt-of-the-re...
Oh, and rhythm is just the same as consonance. Most are octave based, beats on wave peaks of overlaid octaves getting quieter. The 3 based on times like 6/8 are the same but for 5ths and 17ths. (The bottom number 8 is just a BPM hint from old days.) beyond those the intervals get unstable feeling, like 7/4 in Money by Pink Floyd has that cut off feeling, someone took a few from each measure, but maps to a minor 7th interval.
Doesn't HN have a temporal deduplication system?
Where's the "reject non-essential cookies" button?
Which takes you very quickly to equal temperament and perfect fourths and perfect fifths. This tells us where the notes C and F and G are located on the chromatic scale, but then the rest are pretty arbitrary eh. Semitones from C to C go 2-2-1-2-2-2-1, but there is nothing heavenly ordained by this particular arrangement. E-to-F and B-to-C are a collective choice.
If I had been presented with this kind of explanation fifty years ago, I might have been less skeptical of the entire enterprise.
Fun interactive examples though. With another human pass, this could be great.
> Here are five notes. Every one is double the frequency of the one before it. [...] They are different pitches, and yet they sound like the same note.
Nothing about these notes seem similar to me. You could play pretty much any sequence of rising notes and (falsely) claim they're the "same note" and I'd believe it. This is one reason I've always had trouble learning music.
> â2 the awkward one -> 311.13Hz
That one doesn't sound particularly awkward to me. Again, I blame my inability to distinguish pitch.
The only instrument I was able to pick up pretty easily was drums.
Hi Claude
Over time, I developed shorthands for understanding theory like i can easily look at a fretboard and know which note it is.
But what bugged me is that you seem to imply the reason why you couldn't learn a instrument was because you did not understand the why. That makes very little sense to me. I know several professional musicians who don't even know what a mode is or what formal notation is. One of them has pitch perfect ear, he can literally hear anything and tranpose that on his guitar. He has no idea how notes work and just writes tabs.
So while this is very nicely from a programmer point of view and an objective explanation of things but learning all this will not make you a better musician is the point.
Practice above all. Dont try to fit all theory into the pratice but understand what you are practicing particulalry using the theory. Otherwise you end up with all theory and no practice experience of using that theory and creativity.
As a perosn who likes code, this is interesting. As a musician who also understands music theory, this is kind of alienating in terms of how it presented. Like if someone just read this article and thought they understood music theory now, they would be pretty unsufferable to actual musicians.
> The system we want, where the octave is pure and the fifths are pure and everything closes into a neat loop, does not exist and never has. Every tuning system in history is a different choice about where to dump the error.