← All postsHow to Write a Melody That Sticks: 7 Practical Steps
Read in:EnglishفارسیFrançais

How to Write a Melody That Sticks: 7 Practical Steps

· 7 min read· 4 viewsmelody writingsongwritingmotifmusic theorycompositiongame music

To write a melody that sticks, build it from a short motif of three to five notes with a distinctive rhythm, repeat it with small variations, keep the range singable, and shape the line with one clear high point. Memorable melodies are mostly repetition with controlled change, not a constant stream of new ideas.

Last reviewed: October 2026

What makes a melody memorable?

Listeners remember things they have heard twice. A melody that sticks gives the ear something to recognise, then rewards it with a variation. In practice that comes down to five ingredients: a motif, contour, rhythm, range and tension. The sections below take them in order, then walk through a complete example.

Step 1: What is a motif and how do you start with one?

A motif is the smallest recognisable melodic idea, usually two to five notes. What makes it recognisable is rhythm at least as much as pitch. If you tap only the rhythm of a famous tune, people often still identify it.

  1. Pick a key and a chord to sit under the motif.
  2. Choose a rhythm first: for example, long-short-short-long.
  3. Put pitches on it using mostly chord tones, with one or two passing notes.
  4. Play it ten times. If it bores you, change the rhythm before you change the notes.

Keep the motif small. A long idea is harder to repeat and vary.

Step 2: How should the melody move (contour)?

Contour is the shape of the line when plotted on a piano roll. The most common effective shapes are an arch (rise to a peak and fall), a wave, and a gradual descent. Mostly stepwise motion (adjacent scale notes) sounds smooth and singable, while leaps add emphasis. A good rule of thumb is to follow a large leap with a step in the opposite direction, which feels like the line catching its balance. The principles behind this are discussed in classical melody writing principles.

Here is a quick reference for the contour shapes and when each one fits:

ContourShapeEffectGood for
ArchRises to one peak, then fallsSatisfying, completeMain themes, memorable hooks
WaveRises and falls repeatedlyFlowing, relaxedExplore and ambient loops
DescentGradual fall from a high startSighing, resolvingEndings, sad or reflective moments
AscentGradual climbBuilding, hopefulBuild-ups, transitions to intensity

Step 3: How do repetition and variation work together?

Repeat the motif, then change one thing:

A classic pattern is statement, repeat, departure, return (A A B A). The listener gets familiarity in three of four slots.

Step 4: What role does rhythm play?

Mix long and short durations. A melody in all eighth notes sounds like an exercise, and one in all half notes sounds like a hymn. Anchor an important pitch on a strong beat (beat 1 or 3 in 4/4), and use syncopation, a note that lands just before a beat, to add energy. Leave rests too. Silence between phrases is breathing room, and it makes the next entry more noticeable.

Step 5: How wide should the range be?

Keep most of the melody within an octave. A range of a ninth or tenth is plenty for a main theme. A wide range makes a melody difficult to sing and to remember. Reserve the highest note for the climax and use it once or twice per phrase.

Step 6: How do you create tension and release?

Melodic tension comes from non-chord tones (notes foreign to the current chord) and from distance from the tonic. Release comes from landing on a chord tone, especially the tonic or the third of the chord, on a strong beat. Climb toward the peak with a suspension or a leading tone, then let the line settle. The most satisfying phrase ends are those that echo the harmonic cadence underneath; see classical cadences explained.

Step 7: How do you answer a phrase?

Think of the melody as a question and an answer. The first phrase ends on an unstable note (such as the leading tone or the second scale degree), and the second phrase ends on a stable one (the tonic). This is why most themes divide into two matching halves.

Worked example in C major

Take four bars of 4/4 over the chords C, G, F, G (one chord per bar). Write each note as pitch and duration.

Answer phrase (next four bars over C, G, F, C): repeat bars 1 to 3 exactly, then replace bar 4 with E4 whole note on C. The only change is the ending, and it feels like arriving home.

The total range is D4 to D5, one octave. The rhythm (dotted quarter, eighth, quarter, quarter) never changes, so the ear locks onto it quickly. Try it in the piano roll with a soft lead sound.

Exercises

  1. Write three different motifs over a single C chord, each with a different rhythm, and compare which is easiest to hum back.
  2. Take the example above and change only the rhythm of bar 3. Note how much the identity of the tune survives.
  3. Write an eight-bar melody with exactly one note above the rest of the range. Place it on a strong beat.
  4. Write a melody that uses only five notes. Constraints force clearer ideas.
  5. Take an existing melody and turn it into a loop for a game scene by ending the last bar on the second or fifth scale degree.

For game scoring, short strong motifs are especially useful, because a motif can be reused across states. A combat variation can play the same motif faster or in minor; see how AI composes game music for how a theme can be developed, and best BPM for game music for matching tempo to the motif's rhythm.

FAQ

How long should a melody be?

A complete theme usually runs four or eight bars, built from two phrases that answer each other. A motif is shorter, often two to five notes. In games, loops of eight or sixteen bars are common, and the melody is often a repeated motif with variations.

Should I write the melody or the chords first?

Either can work. Writing the melody first gives you freedom of shape and rhythm, and chords can be fitted afterwards. Writing chords first gives you guaranteed harmonic support. Many composers switch between them, building a loop of chords, improvising melodic ideas over it, and adjusting both.

What notes make a melody sound good over a chord?

Chord tones (root, third, fifth) sound stable, especially on strong beats. Scale notes that are not in the chord create mild tension, which resolves when they step to a chord tone. Notes outside the key add strong colour and should be used deliberately.

How do I make my melody less repetitive?

Vary one parameter at a time. Keep the rhythm but change the pitches, or keep the pitches but change the rhythm. Change the ending note, shift the motif up a step, or add a rest. Small variations hold interest while preserving the recognisable motif.

Why do some melodies stay in your head?

Usually because they combine a simple, distinctive rhythm with a small pitch range, repeat the central idea, and end phrases on clear resolutions. Stepwise motion and a single memorable leap help. Repetition builds familiarity, and the small variation prevents boredom.

Share

Hear it instead of reading about it

Every score on the marketplace plays live in your browser — and the ✨ AI composer drafts an adaptive score from one sentence.

Browse the marketplace

From the blog

More scores like this