Musical scales are used throughout the world, but the question of how they evolved remains open. Some suggest that scales based on the harmonic series are inherently pleasant, while others propose that scales are chosen that are easy to communicate.However, testing these theories has been hindered by the sparseness of empirical evidence. Here, we assimilate data from diverse ethnomusicological sources into a cross-cultural database of scales. We generate populations of scales based on multiple theories and assess their similarity to empirical distributions from the database. Most scales tend to include intervals which are close in size to perfect fifths (“imperfect fifths”), and packing arguments explain the salient features of the distributions. Scales are also preferred if their intervals are compressible, which may facilitate efficient communication and memory of melodies. While scales appear to evolve according to various selection pressures, the simplest, imperfect-fifths packing model best fits the empirical data.