  Consonance is related to the perception of pleasantness arising from a
combination of sounds and has been approached quantitatively using mathematical
relations, physics, information theory, and psychoacoustics. Tonal consonance
is present in timbre, musical tuning, harmony, and melody, and it is used for
conveying sensations, perceptions, and emotions in music. It involves the
physical properties of sound waves and is used to study melody and harmony
through musical intervals and chords. From the perspective of complexity, the
macroscopic properties of a system with many parts frequently rely on the
statistical properties of its constituent elements. Here we show how the tonal
consonance parameters for complex tones can be used to study complexity in
music. We apply this formalism to melody, showing that melodic lines in musical
pieces can be described in terms of the physical properties of melodic
intervals and the existence of an entropy extremalization principle subject to
psychoacoustic macroscopic constraints with musical meaning. This result
connects the human perception of consonance with the complexity of human
creativity in music through the physical properties of the musical stimulus.
