Disadvantages of the Pythagorean and harmonic scales
The harmonic and Pythagorean scales sounds very good when you play in the in one to 3 keys, but as you start modulate into all 12 keys it does not sound very nice.
The tempered scale
In the 17th century people wanted to make pianos and organs that could play in any key. The German organ builder Andreas Werckmeister made a system where he detuned every note systematically. He listened to the beat in the fifth and correlated the same beat in all fifth. Today we use a mathematical way of deriving the tempered scale.
This allowed to play in all keys. In the beginning there was a discussion. Because the tempered organ did not sound as good as the organ tuned the Pythagorean or the harmonic way, when playing in the basic key. Johannes Sebastian Bach solved the dispute by composing a melody that modulated into all 12 keys. This could only be played on the new instruments, so all instruments had to be tuned to the new principles if you wanted to play the new music.
Today all pianos, harmonicas and synthesizers are tuned in the tempered scale. So if you are playing together with these instruments, you should play tempered
The frequency is inverse proportional with the string length, so let us derive it frequency based.
The problem is to find a number that multiplied with it self 12 times yields a doubling of the frequency corresponding to an octave.
The equation looks like this
X= 1.059463094 about 6% higher pitch.
In string length
The square root of a number is the number that multiplied with itself yields the number. The twelfth root is the number that multiplied with itself twelve times yields the number. You may get the twelfth root on a scientific calculator by taking the number to the power of 1/12th.