In music, a melody is a series of linear events or a succession, not a simultaneity as in a chord. However, this succession must contain change of some kind and be perceived as a single entity (possibly gestalt) to be called a melody. Most specifically this includes patterns of changing pitches and durations, while most generally it includes any interacting patterns of changing events or quality.
Melodies often consist of one or more musical phrases, motifs, and is usually repeated throughout a song or piece in various forms. Melodies may also be described by their melodic motion or the pitches or the intervals between pitches (predominately conjunct or disjunct or with further restrictions), pitch range, tension and release, continuity and coherence, cadence, and shape.
Different musical styles use melody in different ways. For example, rock music, melodic music, and other forms of popular music and folk music tend to pick one or two melodies (verse and chorus) and stick with them; much variety may occur in the phrasing and lyrics. In western classical music, composers often introduce an initial melody, or theme, and then create variations. Classical music often has several melodic layers, called polyphony, such as those in a fugue, a type of counterpoint. Often melodies are constructed from motifs or short melodic fragments, such as the opening of Beethoven's Ninth. Richard Wagner popularized the concept of a leitmotif: a motif or melody associated with a certain idea, person or place.
While in both most popular music and classical music of the common practice period pitch and duration are of primary importance in melodies, the contemporary music of the 20th and 21st centuries pitch and duration have lessened in importance and quality has gained importance, often primary. Examples include musique concrete, klangfarbenmelodie, Elliott Carter's Eight Etudes and a Fantasy which contains a movement with only one note, the third movement of Ruth Crawford-Seeger's String Quartet 1931 (later reorchestrated as Andante for string orchestra) in which the melody is created from an unchanging set of pitches through "dissonant dynamics" alone, and Gyorgy Ligeti's Aventures in which reoccurring phonetics create the linear form.