Piano Roll Theorymusic theory for producers
Start
0%
6.1Part 6, Melody, Bass and Arrangement

How to Write a Melody Over Chords

This lesson shows you how to lay a melody over a chord progression: which notes settle, which ones are there to move, where to place them in the bar, and how to give your line a shape and some air.

16 min8 questions
View

In the previous part, you learned to build chord progressions that move forward. Now you need something on top: a melody, whether it's sung or played by a lead, a pluck or a piano. This is where a lot of producers get stuck. They have a chord loop they like, they turn on scale highlighting, and still what they write sounds “off,” without them being able to say why. This lesson gives you what you need to understand what's going on.

Same scale, same rhythm, two results

Let's start by listening. The next two figures play the same two-chord progression in A minor, Am (A minor) then F (F major), with a melody in the same rhythm. In both cases, every note of the melody belongs to the A minor scale: none of them is wrong in the strict sense. Listen to the first one.

E5D5C5B4A4F4E4C4A3F3AmF
RootThirdFifthNot in the chordRows of A minor
First version: on every first and third beat, the melody plays a note of the chord sounding underneath.

Now here's the second version. The rhythm is identical and the notes come from the same scale, but they no longer land in the same places.

E5D5C5B4A4G4E4C4A3F3AmF
RootThirdFifthSeventhNot in the chordRows of A minor
Second version: same rhythm, same scale, but the first and third beats carry notes that don't belong to the chord.

You heard it: the first version settles, while the second one floats and never seems to arrive anywhere, especially on the long note at the end. And yet both use the same scale and the same rhythm. What changes is the relationship between each note and the chord sounding underneath at that moment. The scale tells you which notes are allowed in the track; the chord tells you which ones are stable at that exact instant.

Chord tones and passing tones

Over a chord, the seven notes of the scale split into two families. The chord tones are the ones that belong to the chord: over Am, they're A, C and E. They sound stable, and the melody can rest on them as long as it likes. The other notes of the scale act as passing tones: they aren't wrong, but they create a little tension that wants to move, usually toward the nearest chord tone.

There are several ways to move. A passing tone in the strict sense connects two chord tones by stepwise motion, that is, by moving from one note of the scale to its neighbor: in the first version, the D connects the E to the C. A neighbor tone starts on a chord tone, goes to the next note over, then comes back, like C, B, C. In both cases the principle is the same: the note that's foreign to the chord is short, and it resolves right away.

ChordChord tonesOther scale notes
AmA C EB D F G
FF A CG B D E
CC E GD F A B
GG B DA C E F
For the progression Am, F, C, G in A minor: the stable notes of each chord, and the scale notes that help you move from one to the next.

This table changes with every chord, and that's the whole challenge. C is a stable note over Am, F and C, but not over G. B, on the other hand, is only stable over G. So a melody that holds up over the whole loop is one that follows what's happening in the chords, at least at the important moments.

The strong beats decide

That leaves the question of which moments are the important ones. In a bar of four beats, the first beat is the strongest, the third comes next, and the second and fourth beats are weaker. The offbeats, those eighth notes that fall between the beats, are weaker still. Your ear judges a melody mostly by what lands in the strong spots, and even more at the exact moment the chord changes.

That gives us the basic rule, and it explains the difference between our two versions: put chord tones on the strong beats, and save passing tones for the weak beats and the offbeats. In the first version, every first and third beat carries a chord tone. In the second, the strong beats all carry notes foreign to the chord, and the melody never manages to settle.

Contour: the shape of the line

Once you have the right notes in the right places, look at the overall shape of your melody in the piano roll. This drawing is called the contour. A line can rise, fall, make an arch that goes up and comes back down, or wave around a single note. The contour is often what people remember first, even before the exact notes.

Two habits make a contour sound natural. The first is to move mostly by step, from one note to its neighbor, and to save leaps for a few chosen moments. The second: after a leap, come back a little in the other direction, in small steps, like a voice regaining its balance. Listen to this arch over four chords: it climbs by step, reaches its highest note only once, then comes back down.

A5G5F5E5D5C5B4A4G4E4D4C4B3A3G3F3AmFCG
RootThirdFifthSeventhNot in the chordRows of A minor
An arch-shaped melody over Am, F, C, G: it climbs for two bars, touches its highest note only once, then comes back down. Every first and third beat carries a chord tone.

Notice that the highest note, A5, only arrives once. A melody that keeps going back to its peak wears it out; a single peak becomes a moment, the one the listener waits for. Place it around the middle or two thirds of the way through the phrase, and rarely on the very first note. Also spot the little neighbor tone in the second bar, F, E, F, before the climb to the peak.

Register: where the melody lives

The register is the pitch zone your melody moves around in, and it matters as much as the notes. A melody placed too low blends into the chords and the bass, and you can't hear it clearly anymore. Placed very high, it can get thin or piercing. For a lead or a piano, the zone from C4 to C6 is a good starting point, above the chords rather than in the middle of them.

The other setting is the range, the distance between the lowest and highest notes of the melody. A line that fits within an octave, or just a bit more, is easy to remember and easy to sing. If you're writing for a voice, sing it yourself: if you have to strain, the person who sings it may have to strain too. We'll come back to where each part sits in the lesson on registers.

A melody that breathes

A common mistake is to fill every eighth note of every bar. In the piano roll, that makes a wall of notes; when you listen, it's a line that never stops and wears you out. A melody needs silences, the way a spoken sentence needs commas and periods. Silences leave room for the chords, the drums, and above all the next phrase.

Listen to a melody cut into two short phrases, each followed by a silence. There are only a few notes, and yet it sticks right away.

G5F5E5D5C5B4A4G4E4D4C4B3A3G3F3AmFCG
RootThirdFifthNot in the chordRows of A minor
Two two-bar phrases over Am, F, C, G, each followed by a silence. The empty cells of the grid are part of the melody.

The silences in this version count as much as the notes. They cut the line into phrases the ear can take in one at a time. Notice too that the second phrase repeats the exact rhythm of the first, with different notes: that's one of the reasons it sticks so quickly.

WorkshopExplaining piano rollFull screen
Enter the four chords Am, F, C and G, one bar each, and let the site confirm their names. Then add a melody on top, checking that every first beat carries a tone of that bar's chord.
Key: no notes yet. Add some notes, or pick a preset.
  
  
  
  
RootThirdFifthSeventhNot in the chord
Bar 1
 

Empty bar: click the grid to place some notes.

Bar 2
 

Empty bar: click the grid to place some notes.

Bar 3
 

Empty bar: click the grid to place some notes.

Bar 4
 

Empty bar: click the grid to place some notes.

Click a cell to add or remove a one-beat note; click a note name on the left to hear it. Each bar is analyzed as soon as you change a note.

Take the time to try several melodies in the workshop. Move a first-beat note to a neighboring note that doesn't belong to the chord, and listen to the stability disappear; put it back, and the phrase settles again.

Exercisetry it in your DAW too

Here's the progression Am, F, C, G, one bar per chord. Write a four-bar melody that puts a chord tone on the first and third beat of every bar, uses at least two passing tones on offbeats, and ends with a silence of at least one beat. In your DAW: draw the first-beat and third-beat notes first, then fill in between them.

G♯4G4F♯4F4E4D♯4D4C♯4C4B3A♯3A3G♯3G3F♯3F3E3AmFCG
RootThirdFifthRows of A minor

Now you know how to write a phrase that holds up. In the next lesson, we'll see how to turn it into an idea people remember, using repetition and variation.

Check your understanding

8 questions
1.
Over an F major chord (F), which notes of the A minor scale are chord tones?
2.
In a bar of four beats, which beats should get chord tones first?
3.
What is a neighbor tone?
4.
Every note of your lead is in the scale, but the melody sounds “off” over some chords. What do you check first?
5.
Your lead fills every eighth note for four bars and quickly gets tiring. What do you do?
6.
In the loop Am, F, C, G, which melody note will be most stable on the first beat of the G major chord (G)?
7.
Listen: does the long note at the end settle on the chord?
C5B4A4G4C4A3F3F
RootThirdFifthNot in the chordRows of A minor
8.
Where do you usually place the highest note of a phrase?

A lesson is completed automatically at 70% on the quiz. You can also mark it yourself.

A question, a mistake, a word about this lesson? Write to us.

Your address is only used to reply to you.