Music

Melody vs. Harmony: Similarities and Differences with Musical Examples

Written by MasterClass

Last updated: Jun 7, 2021 • 7 min read

Music consists of three primary elements: melody, harmony, and rhythm. (Sung music will add a fourth element: lyrics.) These first two elements, melody and harmony, are based on the arrangement of pitches. And, while these two components work in tandem, they are not to be confused for one another.

Learn From the Best

What Is Melody?

A melody is a collection of musical tones that are grouped together as a single entity. Most compositions consist of multiple melodies working in conjunction with one another. In a rock band, the vocalist, guitarist, keyboardist, and bassist are all playing melodies on their respective instruments. Even the drummer is playing one.

The melody in a piece of music consists of two primary components:

  1. 1. Pitch. This refers to the actual audio vibration produced by an instrument. These pitches are arranged as a series of notes with names like C4 or D#5.
  2. 2. Duration. The definition of melody also includes the duration of time that each pitch will sound. These durations are divided into lengths such as whole notes, half notes, quarter-note triplets, and more.

Learn more about melody here.

What Is Harmony?

Harmony is the composite product when individual musical voices group together to form a cohesive whole. Think of an orchestra: the flute player may be playing one note, the violinist plays a different note, and the trombonist plays yet a different note. But when their individual parts are heard together, harmony is created.

Harmony is typically analyzed as a series of chords. In this hypothetical orchestra, let’s say that the flutist was playing a high G, the violinist bowed a B, and the trombonist sustained an E. Together, those three notes comprise an E minor triad. Therefore, even though each instrumentalist was only playing a single note, together they played an E minor chord.

Learn more about harmony here.

Melody vs. Harmony: What Is the Difference?

While melody and harmony work in tandem, there is a distinct difference between the two. In Western music, melody and harmony are both derived from the same set of 12 pitches. Most compositions, from classical music to pop hits, are written in specific keys, which means they use seven of the 12 available pitches.

For instance, take the key of C major:

  • The key contains the pitches C, D, E, F, G, A, and B.
  • It omits the pitches C# (aka Db), D# (aka Eb), F# (aka Gb), G# (aka Ab), and A# (aka Bb).
  • Therefore, a melody in the key of C major will use only notes from the C major scale.
  • A harmony in the key of C major will be built around chords using the notes of the C major scale. For instance, C major harmony might include a D minor chord because its notes (D-F-A) are all contained within the C major scale. It would not contain a D major chord because that chord is spelled D-F#-A, and F# is not part of the C major scale.

Consonance and Dissonance

But do all songs in the key of C major really only use the notes of the C major scale? The answer is no. Plenty of songs go beyond the scale pitches. This leads us to the concept of consonance and dissonance. Popular music is full of both.

  • Consonant melodies and harmonies are based entirely on scale tones.
  • Dissonant melodies and harmonies include tones that aren’t included in the core scale of the key.

Consider the song “Be My Baby” by the Ronettes. The song’s verse is 16 measures long. The first eight measures are entirely consonant: their melodies exclusively consist of notes from the song’s home scale (E major) and the harmony consists of three chords (E major, F# minor, and B major) that come from that scale. However, the ensuing bars feature the chords G# major, C# major, and F#7—all of which contain notes that aren’t part of the E major scale.

So, the second part of the verse is dissonant but only mildly so. G# major, C# major, and F#7 each feature only one note that isn’t part of the E major scale, so they don’t particularly challenge the listener’s ear.

The mildly dissonant chords in “Be My Baby” feature melodies that go along with the chord tones. For instance, a G# major chord features the note B#, which is not part of the E major scale. The song’s vocal melody includes a B# over that chord. It embraces the mild dissonance and reinforces it.

SONGWRITING TIP: When writing melodies, make sure they reinforce the harmony of the chord underneath them. That’s more important than reinforcing the harmony of the overall song.

Examples of Melody in Music

Musical melodies exist in two forms: as sung vocal lines and as instrumental passages. Here are examples of how this might show up in real musical compositions:

  • Lead vocal lines. The lead vocalist on a piece of music sings the main melody. This could be a soprano diva singing an aria in a Mozart opera. It could also be a heavy metal vocalist singing a thrash song. Both are performing the same function.
  • Backing vocal lines. Backing vocalists tend to thicken a melody by harmonizing over it. Over an F major chord, a lead vocalist might sing an A (which is the third of that particular chord). A backing vocalist might sing a C (the fifth of that chord) at a slightly lower volume. This reinforces the F tonality, so in a sense, this backing vocalist is providing harmony. But she is also singing her own distinct melody line, albeit one designed primarily to complement the lead vocal.
  • Instrumental riffs. Instruments play melodies, too. Whether it’s Jimmy Page playing the intro to “The Immigrant Song” on his Les Paul, or pianist Glen Gould playing a Bach prelude on a Steinway Grand, instrumental melodies are just as much a part of music as vocal melodies are.
  • Featured solos. What’s a guitar solo or a saxophone solo if not a melody? When John Coltrane plays a fixed set of notes at the start of “Giant Steps,” he’s playing a melody. But when he rips into a cascade of notes during a long solo, he’s also playing a melody. Remember, melodies don’t have to be fixed on a piece of sheet music. They can just as likely be improvised on the spot.

Examples of Harmony in Music

Like melodies, harmonies appear throughout music in a variety of forms. These include:

  • Static chords. When a pianist plays steady quarter-note block chords, or when a guitarist strums single chords for one or two measures at a time, we say the chords are static; they don’t change, and no melody is laid on top—at least not by the pianist or guitarist in question. This is a very simple form of harmony, but it’s found in all genres of music.
  • Chords interspersed with melodic lines. There’s no rule that says harmony and melody are disjunct entities that cannot blend into one another. Many players, particularly those with a bit more skill, will toggle back and forth between harmony and melody, often within the same bar of music. Jimi Hendrix is a master of this technique. Listen to how he seamlessly transitions between strummed chords and picked notes on tunes like “Castles Made of Sand” and “Little Wing.” Pianos, with their natural polyphonic potential, lend themselves very well to a mixture of melody and harmony played all at once.
  • Bass lines. Basses tend to play one note at a time, but those single notes can imply entire chords. Let’s say a bass is playing in the key of D minor, a key built on the seven notes of the D minor scale. If the bassist plays the note F, our ear will naturally infer an F major chord, because F major is part of the D minor scale but F minor is not.
  • Choral passages. A chorus is a group of individual performers who share a common family of instruments. A vocal chorus, for instance, is a group of singers. Some will sing quite high (sopranos), some will sing quite low (basses), and others will slot somewhere in between. By assigning different notes to different sections of a chorus, composers can represent entire harmonies. A composer might assign an Eb to the basses, a Db to the tenors, a Bb to the altos, and a Gb to the sopranos. Together, they produce an Eb minor chord, with the third (Gb) in the melody. (Note that any family of instruments can form a chorus or choir—strings, saxophones, guitars, etc.)
  • Counterpoint. The notes of a chord don’t have to be played all on the same beat. Many composers will create independent lines that intersect with one another but aren’t always playing on the same beats. The combination of notes will imply chords that don’t appear in static blocks but are subconsciously clear to the listener. This technique, known as counterpoint and exemplified through the fugues of J.S. Bach, is considered one of the most advanced forms of musical composition.

Learn more about melody and harmony with Carlos Santana here.