This sense of the phrase is the precursor of the usage of the word in music theory. In music theory, quality is the number of harmonics of a fundamental frequency of an instrument (the higher the quality, the richer the sound).