| Music Theory for Programmers(runjs.app) | |
| 397 points by birdculture 7 days ago | 242 comments | |
tl;dr: A programmer derives Western music theory from first principles using JavaScript and the Web Audio API, showing how the 12-note system emerges from reconciling powers of 2 (octaves) with powers of 3 (fifths), why equal temperament is a necessary compromise, and how scales, chords, and progressions reduce to arrays of integers. Along the way it explains consonance via overlapping harmonics, why major and minor differ by a single semitone, why V-to-I resolution works (the tritone inside the dominant 7th), and treats musical notation as a lossy serialization format with historical constraints. | |
HN Discussion:
| |