🔍📖 Reference
20 lessons

Writing a Melody

A good tune is not inspiration falling from the sky. It is a small idea, repeated with purpose, shaped into a question and an answer — and every rule of it can be heard.

lesson 1 of 2 in this unit

Builds on: 4.3 Progressions & Cadences3.1 Intervals: Naming the Distance

Start smaller than you think

Ask someone to hum Beethoven’s Fifth and they give you four notes. Ask for Ode to Joy and you get two bars. Memorable melodies are built from a motif — a scrap of two to six notes with a recognisable rhythm — and then that scrap is used: repeated exactly, repeated a step higher or lower (a sequence), turned upside down (inversion), stretched or squeezed in rhythm. The listener hears the motif once and then recognises it every time it returns, which is what makes a tune feel like one thing instead of a string of notes. Composition is less about inventing and more about deciding what to do with what you already have.

Question and answer

Melodies come in phrases, usually four bars long, and phrases come in pairs. The first phrase, the antecedent, ends somewhere open — often on the dominant, or on a scale degree that is not the tonic — so it sounds like a question. The second, the consequent, starts like the first (the motif again!) and ends on the tonic with a cadence: the answer. Twinkle Twinkle is a textbook pair: “Twinkle twinkle little star” lands on the dominant (G); “how I wonder what you are” lands on the tonic (C). Eight bars, one question, one answer, done. That 4 + 4 shape is called a period, and it is the frame nearly every song verse hangs on.

bars 1–4: motif → develop → open ending (V)  ·  bars 5–8: motif → develop → closed ending (I)the period: an antecedent that asks and a consequent that answers with the same opening

Contour: where the line goes

Draw a melody’s shape and most good ones make an arch: they rise toward a single highest note — the climax, usually about two thirds of the way through — and settle back down. A tune that stays flat is a chant; one with two competing peaks feels undecided. Movement is mostly by step, with an occasional leap for excitement — and a leap likes to be recovered by a step back in the opposite direction, as if the melody had jumped and needed to regain its balance. A sixth up, then steps down: the opening of My Bonnie, and of half the ballads ever written.

Chord tones and the notes between

Over a C chord, the notes C, E and G are chord tones: they sound at rest. D, F, A and B are non-chord tones: they sound like motion. A melody made only of chord tones is an arpeggio — stable but stiff. A melody that uses non-chord tones on the way between chord tones has the flow of speech. The common kinds all have names:

  • Passing tone: steps between two chord tones — C, D, E.
  • Neighbour tone: steps away and back — E, F, E.
  • Suspension: a note held over from the previous chord that then resolves down by step — the sighing sound at the end of a hymn line.
  • Anticipation: a chord tone of the next chord arriving a little early.

The rule of thumb: strong beats prefer chord tones, weak beats and off-beats are where the passing and neighbour notes live. Land your motif’s important notes on the chord and let the in-between notes carry you there.

Rhythm is half the melody

Take any tune and play its pitches all as quarter notes: it dies. The long-and-short of the rhythm, the note that arrives just before the beat (syncopation), the rest that lets a phrase breathe — these are as much the melody as the pitches. A motif with a distinctive rhythm survives even when the pitches change; that is why the four notes of Beethoven’s Fifth work on any pitch at all.

A recipe that always works

Two-bar motif → repeat it a step higher (sequence) → a third variation that rises to the climax → a fourth that comes down to the tonic. Bars 1–2, 3–4, 5–6, 7–8. Countless folk songs and pop verses are exactly this.

The sketchpad below is a two-bar piano roll over two chords. The readouts count your chord tones and non-chord tones, name the contour and count the leaps — write a motif, play it, and read what you wrote.

🎼 LabMelody Sketchpad

Two bars, eight eighth-notes each, over a pair of chords. Click a cell to place a note (one per column); pink rows are chord tones for that bar. Play loops it with the chords.

  • Load the example and play it: an arch that climbs to G and falls back to C, with two amber passing tones.
  • Write a two-note motif in bar 1, then repeat it a step higher in bar 2 — a sequence.
  • Put a non-chord tone on a strong beat (column 1 or 5) and hear it clash; move it one column and hear it flow.
Chord tones
6
Non-chord tones
5
Contour
arch
Leaps (> a 3rd)
1
Ends on
C4

Check your understanding

1. In a period (question-and-answer pair of phrases), the antecedent typically ends…

2. A melody moves C – D – E over a C major chord. The D is…

3. Repeating a motif a step higher or lower is called…

4. After a large upward leap, a melody most naturally…