In music, a sequence is the restatement of a motif or longer melodic (or harmonic) passage at a higher or lower pitch in the same voice. It is one of the most common and simple methods of elaborating a melody in eighteenth and nineteenth century classical music (Classical period and Romantic music). Characteristics of sequences:
It is possible for melody or harmony to form a sequence without the other participating.
There are many types of sequences, each with a unique pattern. Listed below are some examples.
In a melody, a real sequence is a sequence where the subsequent segments are exact transpositions of the first segment, while a tonal sequence is a sequence where the subsequent segments are diatonic transpositions of the first. The following passage from J.S. Bach demonstrates both kinds of sequence at work:
Note: In the example image above, the annotation "the intervals in the second sequence are the same as in the first" is not entirely correct. The descending pitches in the first segment (G to A), have different intervals than in the second segment (C to D). The difference being in the last three pitches (C, Bb, A versus F, E, D). We have whole-step + half-step intervals in the first, and half-step + whole-step in the second.
A rhythmic sequence is the repetition of a rhythm with free use of pitches:
A modified sequence is a sequence where the subsequent segments are decorated or embellished so as to not destroy the character of the original segment:
A false sequence is a literal repetition of the beginning of a figure and stating the rest in sequence:
The above passage starts in F major and modulates to B flat major and then, via the chord of G to C major. Sometimes sequential passages combine more than one of the above characteristics. In the third and fourth bars of the "Air" from J.S. Bach's Orchestral Suite No. 3 in D major, the violin part forms a tonal sequence with the notes modified to fit the harmony, while the intervals in the bass line are unchanged, creating a real sequence. The whole passage also forms a modulating sequence, starting in D major and moving through E minor at the start of the fourth bar:
A sequence can be described according to its direction (ascending or descending in pitch) and its adherence to the diatonic scale--that is, the sequence is diatonic if the pitches remain within the scale, or chromatic (or non-diatonic) if pitches outside of the diatonic scale are used and especially if all pitches are shifted by exactly the same interval (i.e., they are transposed). The non-diatonic sequence tends to modulate to a new tonality or to cause temporarily tonicisation.
At least two instances of a sequential pattern--including the original statement--are required to identify a sequence, and the pattern should be based on several melody notes or at least two successive harmonies (chords). Although stereotypically associated with Baroque music, and especially the music of Antonio Vivaldi, this device is widespread throughout Western music history.
The device of sequence epitomises both the goal-directed and the hierarchical nature of common-practice tonality. It is particularly prevalent in passages involving extension or elaboration; indeed, because of its inherently directed nature, it was (and still is) often pulled from the shelf by the less imaginative tonal composer as the stock response to a need for transitional or developmental activity. Whether dull or masterly, however, the emphasis is on the underlying process rather than the material itself.-- Christopher Mark (2006), 
Descending fifths sequences, also known as "circle of fifths" sequences, are the most commonly used types of sequences, singular extended in some works of Claudio Monteverdi and Heinrich Schütz. It usually consists of a series of chords whose bass or "root" notes follow a pattern of descending fifths (or ascending fourths).
For example, if a descending fifths sequence in C major starts with the note C, the next note will be F, a perfect fifth below the first note. The next few notes will be B, E, A, D and so on, following a pattern of descending fifths.
The ascending fifths sequence, contrary to the descending fifths sequence, consists of a pattern of ascending fifths (or descending fourths). It is much less common than the descending fifths sequence.
The descending 5-6 sequences, also known as descending third sequences, consist of a series of chords whose root notes descend by a third each sequential repetition.
The sequence is almost never unadorned as shown above, but is generally filled in with intervening chords. The standard way of filling in this descending thirds pattern is to interpolate a first inversion chord in between each of these descents by thirds. The result is a bass line that moves down continuously stepwise, resulting in a figured bass of '5-6', and therefore, the standard descending 5-6 sequence.
An important subtype of the descending 5-6 sequence is the root position variant, also known as the Pachelbel sequence, due to the use of this sequence in Pachelbel's Canon. The Pachelbel sequence changes the first inversion chords in the descending 5-6 sequence to root position chords, resulting in a bass pattern that moves down a fourth, and then up stepwise.
The ascending 5-6 sequence, like the ascending fifths sequence, adorns a stepwise ascent. It follows a root movement pattern of down a third (usually to a first inversion chord sharing the same bass note as the first note) followed by a root movement up a fourth. This is often accomplished through an alternation of root position and first inversion chords. The figured bass is the same as the descending 5-6 sequence, but the bass itself follows an ascending pattern rather than a descending pattern.
The use of a similar 5-6 pattern outside of sequence is fairly common and is called 5-6 technique.
The Sound of Music (also known as Rosalia) sequence features root movement up a fourth followed by root movement down a third. Both chords are in root position. The sequence is very similar to the ascending 5-6 sequence since it also allows for an overall stepwise ascent between parallel triads, much like the ascending 5-6.
A well-known popular example of a threefold descending fifths diatonic sequence is found in the refrain from the Christmas carol "Angels We Have Heard on High," as illustrated immediately below ("Glo...ria in excelsis Deo"). The one-measure melodic motive is shifted downward at the interval of a second, and the harmonic aspect does so likewise by following the circle of fifths Play (help·info):
The following threefold ascending 5-6 chromatic (non-diatonic) sequence occurs in the duet of Abubeker and Fatima from Act III of César Cui's opera Prisoner of the Caucasus (compare a similar passage in the famous Rodgers and Hammerstein song "Do-Re-Mi," composed almost exactly 100 years later) Play (help·info):
Handel's "For Unto Us a Child is Born" (HWV 56) relies heavily on both melodic and harmonic sequencing, as can be seen in the following excerpt. In this vocal reduction, the soprano and alto lines reiterate a florid two-beat melodic motif for three and a half bars in a series of melodic sequences on the word "born." More subtle, though still present, is the underlying ascending 5-6 harmonic sequence. Play (help·info)
Other examples include Handel's "Ev'ry valley shall be exalted" ("exalted") from Messiah, the opening unison ritornello of J.S. Bach's D-minor harpsichord concerto. Another can be found in Arcangelo Corelli's sonata de camera gigue in Em. Here the composer sequences up in pitch after cadencing on a V.