Temperament
The need for temperament can be explained by the fact that you can't fit twelve
perfect fifths into seven octaves. The span of seven octaves is 2^7 = 128 but the span of twelve perfect fifths
is 1.5^12 = 129.75. This extra amount is called the ditonic comma. Some or all of the fifths
must be slightly detuned or tempered some fraction of the comma. For any temperament, all the fractions of
comma must add up to negative one. A temperament is typically described by listing the fraction of comma
added to or taken away from each fifth. An interval with zero comma would be a perfect fifth. The following
is the equation to calculate the frequency ratio for the interval of a fifth given its amount of comma:
f (x) = (128 / 1.5^(12 + 1 / x))^(1 * x)
For example, to calculate the interval of a fifth minus 1/4 comma, us 0.25 for the value of x. This gives
a frequency ratio of 1.49493. Here's a table of frequency ratios for the different fractions of comma. Using
this table, you can easily calculate the frequencies for any temperament. 

Here is an example of how to calculate the frequencies for the Valotti temperament. The Valotti
temperament has six perfect fifth intervals and six intervals with –1/6 comma. The perfect fifths
are BF#, F#C#, C#G#, G#Eb, EbBb and BbF. The –1/6 comma fifths are CG, GD, DA, AE, EB and FC.
The frequency ratio for a perfect fifth is 1.5 and for a –1/6 comma is 1.49662. The following table shows
the series of calculations. Several times there will be division by two to keep the frequencies in the
same octave. Start on A = 440 Hz and use the frequency ratios to go around the circle of fifths. 

Here is a table of some other temperaments:
Here are the corresponding frequencies all based on A = 440 Hz:
