How to make a melody for electronic music: from motif to hook

MIDI keyboard at night with five keys lit in amber, the notes of a minor pentatonic scale

You open the piano roll, pick a synth and start placing notes. Twenty minutes later you have sixteen bars that are not wrong, but that nobody will remember. Most of the time the problem is method. If you think like a songwriter, you look for a long line that tells a story, and club music rarely works that way. In a house or techno track, the melody is a short motif with a strong rhythm, repeated over a loop and changed a little at a time.

The six steps below get you to that motif. The Melodic Sequencer is embedded right after the first one, so you can try each idea as you read.

1. Pick the scale before the first note

A scale is the set of notes your melody is allowed to use. Choose it before you start and you stop testing all twelve keys and start choosing between five or seven. For a first attempt, the minor pentatonic is the safest: five notes, none of them clashing with the others, so almost any combination sounds like music. In C minor pentatonic those are C, E flat, F, G and B flat.

The Melodic Sequencer opens in exactly that scale, C minor pentatonic, with the grid locked so notes outside the scale cannot be written. When five notes stop being enough, move to the natural minor (Aeolian) or to Dorian, which has a major sixth and sounds warmer. In Ableton Live, the Scale MIDI effect does the same job: it pushes any note you play into the scale you chose.

Interactive tool: Melodic Sequencer

2. Rhythm first, notes second

In club music, people recognize a melody by its rhythm before its pitches. Try writing the whole line on a single note, the root, and decide only where the notes land and how long they last. Once that rhythm grooves on its own over the kick, start moving pitches. Andrea Stolpe at Berklee makes the same point from the songwriting side: note length, the space between notes and where a phrase starts (before, on or after the downbeat) shape a melody as much as the pitches do.

Leave some silence, because a line with rests breathes over the loop. And put at least one note between the beats. Syncopation is what makes a body react to a line, and Oscar from Underdog Electronic Music School has a whole video on it.

3. A two-bar motif, as call and response

A motif is an idea of three to five notes that repeats. Write it across two bars, which is exactly the size of the sequencer grid. In the next two bars, repeat it almost unchanged and alter only the ending. If the first half ends on a note that leaves the phrase hanging, the second half ends on the root and closes it. That is call and response, and four bars are enough for it.

Repetition feels like too little when you are starting out, but it is what lets the ear catch the melody. Berklee on one side and Will Darling from EDM Tips on the other reach the same conclusion: a melody that changes every bar never gets remembered, and small variations only work because there is repetition underneath.

4. Chord tones on the strong beats

If you already have a progression, lean the melody on it. The working rule is to put a note of the chord that is sounding on the strong beats, 1 and 3 of each bar, and use the other notes of the scale to move between them. A melody that hits the chord when the ear is paying most attention sounds tied to the harmony, even if it passes through outside notes on the way.

The Chord Progression Generator makes this link for you. Once you have a progression you like, Write the melody opens the sequencer in the same key, mode and tempo, with the chords playing underneath and each chord’s notes lit up on the grid. Oscar from Underdog suggests going the other way round, starting from the harmony and an arpeggiator: you take the notes of the chords and let the arpeggio’s rhythm suggest the melody. If you do not play keys, it is one of the methods that works best.

5. The shape of the line: steps, leaps and one high point

Look at the melody as a drawing in the piano roll. The ones that work move by step, to the neighboring note in the scale, more often than they leap. When they do leap, they usually come back by step in the opposite direction. Ableton’s Making Music book adds a useful idea: a good melody almost always has one note higher than all the others, and that note often lands on a strong beat. If your line has three equal peaks, keep one and lower the other two.

Arpeggios are the exception. When a melody walks through the notes of a chord, the leaps between them sound complete and do not need to come back.

6. Vary it without losing the motif

After thirty-two bars, the same motif gets tiring. Before you write a new one, vary this one. Take it up an octave in the second drop, remove a note, shift it half a beat forward, or keep the notes and slowly open the filter cutoff. In techno, a lot of the variation comes from here, with the sound changing while the notes stay put. Every version should still be recognizable as the same motif.

The sound also decides how many notes fit. A pluck, with a fast attack and short decay, leaves room for rhythm and can carry a busier line. A lead with a long release fills the space and wants fewer notes. The article on ADSR envelopes shows how to move from one to the other, and how synthesizers work explains where the tone comes from.

What changes from genre to genre

House: the melody is often the chord itself, as short stabs or a piano riff repeated in a syncopated rhythm. In deep and melodic house, minor modes with sevenths and ninths set the mood. House chord progressions are the place to start.

Techno: few notes, sometimes only two or three, repeated for a long time. The tension comes from repetition, dissonance and the sound transforming, which is what Oscar breaks down in Underdog’s music theory for techno video. Phrygian, with a minor second right above the root, gives that dark color. More in how to make techno.

Organic house: long, spaced-out notes on plucks, flutes or kalimbas, almost always in Dorian. The melody comes in late, says little and leaves early. The article on how to make organic house explains why restraint works so well here.

Afro house: call and response is the most common shape, often over a two-chord vamp, with percussive tones like marimba or kalimba and syncopated figures that talk to the percussion. Pentatonic and Dorian are safe choices. Afro house drum patterns help you see where the melody needs to leave space.

Try this now

In the sequencer above, in C minor pentatonic, write two bars on the note C only, with at least one note between the beats. Turn on the kick in the groove section and listen for whether the rhythm already swings on its own. Then change the pitch of three notes without touching the rhythm, and put a G or an E flat on beat 1 of the second bar. Export the MIDI, drag it into your DAW, duplicate the two bars and, in the copy, change only the last note so the phrase ends on C. Fifteen minutes is enough.

From here, the natural next step is to pair the melody with a progression in the generator and take both into your DAW. The electronic music production tutorials page shows what comes next on the path, from arrangement to mixing.

Ohxala Records Academy

Learn to produce electronic music.

Structured courses, interactive tools and real-world references. Built for producers who are just starting out.

Discover the Academy