The human sense of hearing perceives a combination of sounds 'in tune' if the corresponding harmonic spectra are correlated, meaning that the neuronal excitation pattern in the inner ear exhibits some kind of order. Based on this observation it is suggested that musical instruments such as pianos can be tuned by minimizing the Shannon entropy of suitably preprocessed Fourier spectra. This method reproduces not only the correct stretch curve but also similar pitch fluctuations as in the case of high-quality aural tuning.http://arxiv.org/abs/1203.5101
Related:
In case you've never heard of http://en.wikipedia.org/wiki/Just_intonation it's a tuning system that preserves the harmonic integer frequencies instead of accepting slight errors in retuning scales. It's only possible to use because of modern electronic synthesizers negating the need for physical key changes. But wave-graphs of JI music are much less dissonant and more visually appealing, and plenty of people claim the notes sound better.