News for hackers. Stuff that matters.
Re:Music Theory for Programmers by HexDecOctBin on Sunday September 06, 2026 @04:39AM (#49584476)
As a non-musician non-Western programmer, the only music book that is making sense to me (still reading) is Robert Snyder's Music and Memory[1]. It's the first book that doesn't trick me by trying to pass cultural artefacts (notes, scales, raga, etc.) as some universal truth, or douse me in medieval pseudo-science (Pythagorean small ratios, etc.)

I am not an expert, so maybe this book has its own shortcomings which I am being blind to. But this is the first book on music I have been able to read this far without having to fight the urge to fling it against a wall.

[1] https://mitpress.mit.edu/9780262692373/music-and-memory/

Re:Music Theory for Programmers by strenholme on Sunday September 06, 2026 @08:15AM (#49585769)
I don’t think it’s unreasonable to say 2/1, 3/2, 4/3, 5/4, and 6/5 are intervals which sound pleasant to the human ear. [1]

Once that is established, as per the linked article, 12-tone equal temperament makes a lot of sense (but isn’t universal, obviously) because it’s resulting tuning gives us a really close 3/2 and 4/3, and having a simple 12-tone scale reasonably in tune everyone can agree on makes sense.

We can then explain that 5/4 and 6/5 are a bit off in 12-tone, but are “good enough” that we tolerate them being slightly out of tune when using equal temperament. Once we accept that 12-tone has imperfect thirds, we can then look at the I IV V chord progression (I IV V comes from 3/2, 5/4, and 4/3 sounding pleasant to the human ear), and explain why that chord progression is so common in western popular music.

These aren’t universal truths—12-tone equal temperament is a compromise, but, as per the linked article, a reasonable one. Just intonation is, of course, another possible compromise.

[1] 2/1: Octave; 3/2: Perfect fifth; 4/3: Perfect fourth; 5/4: Major third; 6/5: Minor third

Re:Music Theory for Programmers by ludston on Sunday September 06, 2026 @09:25AM (#49586335)
> we tolerate them being slightly out of tune

And in many cases we don't need to tolerate this because most instruments barring guitar and piano allow musicians to tune chords to just temperament, and players will do this automatically and completely subconsciously.

Re:Music Theory for Programmers by strenholme on Sunday September 06, 2026 @10:16AM (#49586754)
I’m convinced that “Safe and Sound” by Capital Cities became a major hit because it uses an actual trumpet for the lead, causing the perfect intervals to be exact instead of the every so slightly off intervals 12-tone equal temperament has.

The linked article makes the case for equal temperament by showing that 12 just fifths played in sequence is flat compared to seven octaves.

Re:Music Theory for Programmers by Slow_Hand on Sunday September 06, 2026 @07:06PM (#49591818)
I'm not saying a real, recorded trumpet doesn't make an appreciable sonic difference, but if it were a sampled trumpet "Safe and Sound" would most likely still be a hit.

Attributing it's hit status to the perfect intervals is ignoring all of the other choices (and supporting infrastructure) that go into making a hit. It's like saying that the Dodge Charger was a successful car because the windshield wipers are of a certain make.

Side note: It may very well be a sampled trumpet.

Re:Music Theory for Programmers by strenholme on Sunday September 06, 2026 @08:20PM (#49592363)
https://web.archive.org/web/20150610163042/http://www.axs.co...

“"Safe and Sound's" trumpet line is partly responsible for the popularity Capital Cities is currently enjoying”

>>>The trumpet line in ‘Safe and Sound’, for example, didn’t appear in the production until nine versions into the song. The final version, on a whim, we decided to try using a trumpet, a live trumpet, to play that line and it stuck. We ended up actually using the trumpet a lot throughout the album after we included it in ‘Safe and Sound’.

"It was trial and error, right? We felt like that line was an epic line and we thought about different instruments that sounded epic, and the trumpet is obviously one of them,<<<

The thing about trumpets is this: Their fifth is a little “sharp” because it’s a perfect just intonated fifth (i.e. a perfect 3/2 ratio).

Re:Music Theory for Programmers by HexDecOctBin on Sunday September 06, 2026 @11:50AM (#49587683)
West Asian maqam has 24 notes, Indian classical has 22 notes, Indonesian gamelan has 5 or 7 notes. What would be the ratios that sound pleasurable now?

What is or isn't pleasurable is a matter of cultural training, and treating them as absolute facts is what I found frustrating in the books that I was complaining about.

Re:Music Theory for Programmers by simonask on Sunday September 06, 2026 @12:21PM (#49588024)
All of those systems you mention also include those so-called "pleasant" ratios.
Re:Music Theory for Programmers by HexDecOctBin on Sunday September 06, 2026 @01:06PM (#49588528)
How would you divide 22 in small ratios, considering that 11 is a prime number?
Re:Music Theory for Programmers by dahart on Friday September 11, 2026 @01:07AM (#49653792)
Those 22 notes are not evenly spaced, you know that, right? Primes are irrelevant.
Re:Music Theory for Programmers by strenholme on Sunday September 06, 2026 @04:21PM (#49590496)
Indeed. Bobby McFerrin has a demonstration where, regardless of culture, the pentatonic scale is universal. For the record, a just major pentatonic scale is the notes with the intervals (from the root note) 1, 9/8, 5/4, 3/2, and 5/3.

https://www.youtube.com/watch?v=ne6tB2KiZuk

Re:Music Theory for Programmers by pianopatrick on Sunday September 06, 2026 @04:49AM (#49584521)
If you like that book, you might also enjoy David Huron's books on voice leading and anticipation. I have not read the book you referenced, but from the description it seems like a similar approach.
Re:Music Theory for Programmers by PaulDavisThe1st on Sunday September 06, 2026 @10:38AM (#49586933)
"Music of the Whole Earth" by David Reck is pretty good, too.