Sustained pitches are assembled in a horizontal line with a determined rhythmic pattern to create something called a melody. It is the most noticeable and recognizable part of the music. It is what you hum or sing along with as the music is being played. The rhythm of the melody may be repetitive and predictable, bringing a feeling of comfort; or they may be asymmetric and unpredictable, bringing a feeling of surprise and uneasiness.
The line of notes chosen might be smooth and stepping, or wide and angular. It might consist of many notes in a long line or fewer notes broken up into several smaller lines. However the composer crafts and chooses, he or she is trying to bring about an emotional feeling in the ears of the audience.
If there are words, the melody should reinforce and reflect both the obvious and sometimes hidden meanings of the lyrics. If there are no words (or lyrics), the emotional flow of the melody is less accessible and more subjective, but still within reach of the active listener.
The melody is the most memorable and perhaps important part of the music. Combined with the words of the song, it makes a connection with both the intellect and the emotion of the listener. Good songs exist with mediocre melodies, but no great song exists without a great melody.