Melody is a sequence of musical notes that are perceived as a single entity, often forming the main theme of a piece of music. It is the aspect of music that is most easily remembered and hummed, usually consisting of a series of pitches arranged in a rhythmic pattern. Melody serves as the foundation for both classical and contemporary music styles, linking various elements like harmony and rhythm to create an emotional and memorable experience.