Why 12 notes in Western music?
Another possible explanation, which I'm surprised the author didn't go through is the "Circle of Fifths" which basically says:Since Fifths sound so great, why not just keep doing that?  When we get to the next octave, then come back down.  If we get to a place that's "pretty darn close" to another note, then stop.  The Python explanation looks like:  f = 440
  for i in range(13):
      print(i,f)
      f = f * 3/2
      if f > 880: f=f/2.0

  0 440
  1 660.0
  2 495.0
  3 742.5
  4 556.875
  5 835.3125
  6 626.484375
  7 469.86328125
  8 704.794921875
  9 528.59619140625
  10 792.894287109375
  11 594.6707153320312
  12 446.00303649902344

Note that after exactly 12 steps, we're back at 446 which is "pretty close" to 440.  So, we take this set of notes, sort them, and just jigger it a little bit to get the 12 notes we know today.