First off, an A is not always the same as another A. Some time in the last century (wikipedia if you want the exact date, in fact, if you want further reading, just wikipedia some key phrases from this response) it was decided upon that concert A should be 440Hz - this, as I understand it, was largely in search of consistency between manufacturers. Before that, A had been set at a number of points, going down into the 40teens.
That's only the beginning of complications. As it turns out, even if you can get everyone to agree on a base frequency, different methods of calculating the proper frequency yield different results. Pythagorean Tuning uses whole number ratios to calculate the frequencies, starting with 3:2 (a perfect fifth). [Quick note: if you've never seen Donald Duck in Mathmagic Land, youtube it now] But this method has the unfortunate outcome of giving slightly different values for the diminished fifth and the augmented fourth - which are theoretically the same note.
To ancient musicians, this was like getting a wooden train set and putting the curved pieces together in sequence, only to find that they didn't form a circle. The proverbial last piece is known as the
So people started to fudge it. This is called temperament. There's a bunch of different ways (mathematically and mechanically) to do it, but I don't really have the time or understanding to get into all of them so I'll skip forward to present day. If you walk into your local music shop and play a chromatic scale on a random keyboard, you'll likely hear what's called Equal Temperament. In short, divide your octave into equal parts (in the case of this example, 12) and you have your 12 notes to a chromatic scale.
And it's just that simple. Of course I skipped over tons, but I'm similarly on my way out the door, so deal with it. Or e-mail me if you really care.
If you're not a musician, producer, technician, or the like, [http://en.wikipedia.org/wiki/Music_and_mathematics] should be more than you'll ever need to know. In fact, I wish I had known about that page 10 years ago.
Not enough? This is the textbook I used in school on the topic. It's a little less historical and more sciencey, if that's your bag: http://www.amazon.com/Acoustical-Foundations-Music-John-Back...
Get dozens of book recommendations delivered straight to your inbox every Thursday.