This work studies melodic lines of western art music tradition from frequency of occurrence of their constitutive elements. The model of analysis uses pairs of successive sounds as the minimal structural elements of a melody. Each pair of possible sounds in a musical instrument is associated to a quantity related to the difference of acoustic energies of the sound waves. This quantity expresses consonance properties that have been studied in experiments about the perception of combinations of sounds. We find statistical distributions of this quantity that show the existence of preferences for certain elements in a given melodic line. This preference can be interpreted as a consequence of the use of both formal musical theory rules and the creativity of the composer in order to create pleasant sensations in the listener.