In any musical composition, there is a dominant line that creates a tone pattern known as the piece's melody. There are specific rules for the musical composition of a melody, and most fall into regular patterns.
The ancient Greek word melōidía was used to denote a tune for lyric poetry. It was derived from melos, which meant "song." In most songs, the melody follows a logical, mathematical pattern that creates a memorable line of notes. The word suggests a beautiful and pleasant sound, as was celebrated in the 1946 Irving Berlin lyrics, "A pretty girl is like a melody that haunts you night and day."