The Ultimate Guide to Writing Better and More Memorable Melodies

Sam MatlaArrangement & Composition%s Comments


Photo Credit: Prabhu B Doss via Compfight cc

Want to learn how to turn great melodies into full songs? Check out my book. 

While groove is fundamental to electronic dance music, it isn’t something that sticks in your head. You don’t hum “groove” while taking your morning shower or driving to work, you hum melody. Melody is what gets stuck in someone’s head.

But melodies are hard to write.

There’s always that feeling that it’s just not good enough. You may feel like all melodies you come up with sound like they’ve been written before. Maybe your melodies sound horrible and you’re not sure how to improve.

If so, this is the article for you.

This isn’t a theory article, but a basic understanding of music theory will make it easier to follow along. Check out the TL;DR Guide to Music Theory if you need a primer.

Update: I’ve put together a FREE cheat sheet + pack of MIDI files for you to study. You can download them by clicking here.

A Basic Overview of Melody

Melody comes from the Greek word melōidía and is defined by a series of notes that are perceived by the listener as a single entity or object. When somebody listens to a melody, they don’t hear it as just a random combination of notes, they hear it as something. They can point out where it starts and ends, they can remove it from the song and remember it. The typical listener couldn’t care less about the clap sample you’re using or the bass you spent 20 hours designing in Massive. They care about what they can take away from your music.

What does a melody consist of?

It helps to picture melody as horizontal notation, and harmony as vertical. A melody is by definition monophonic (meaning one voice), but that doesn’t mean that chord progressions aren’t melodies. By the late 19th century, the top tone of a chord was considered to be part of a melody. The simple I, IV, V progression in C Major shown below has its own melody.

The yellow highlighted notes constitute a melody while being part of the chords.

The yellow highlighted notes constitute a melody while being part of the chords.

A melody consists of, or is characterized by a few elements:

  • Contour
  • Range
  • Intervals
  • Structure
  • Scale


A memorable melody follows a contour, a line that ascends, descends, arches or dips. There’s no particular formula. You don’t have to have a contour that rises and then falls, and you don’t need to have a certain number of drops or leaps. It’s completely down to preference. But you will notice how different contours elicit a different emotional reaction from the listener. For example: a melody that ascends may sound more uplifting than one that descends.

Orjan Nilsen's "Between the Rays." A great melody to show contour.

Orjan Nilsen’s “Between the Rays.” A great melody to show contour.


The range is the distance between the highest and lowest note of the melody. Some melodies occupy a very large range (2 octaves and up) while others have a much smaller range (half an octave). Range is important to consider when writing melodies as a wide range will make a melody more difficult to hum, whistle, and remember – whereas a narrow range will have less variation in pitch and won’t sound as interesting. Range


A melody uses more than one note, so there’ll always be at least one melodic interval. Does the melody jump up to certain notes? Or does it move up to them incrementally. It’s handy to know the different intervals and the musical quality they contain. Read: TL;DR Intervals


Melodies have structure too. You could have an A and B section to your melody, maybe even a C. Think call and response, up and down, etc.


Melodies are formed from scales. There are numerous types of scales:

  • Modal: variable patterns of Major/minor scale. Starting at different points
  • Major and minor: makes up the majority of Western music.
  • Chromatic: all twelve notes.
  • Pentatonic Scale: 5-note scale. Often used in blues and rock. (Learn more about the Pentatonic Scale)

There are of course others, but I’ll exclude them for sake of popularity and use (especially in EDM).

The difference between motif and melody

A motif does contain melodic characteristics, but calling it a melody is a little far-fetched. A melody is the main idea of the track. A motif or phrase is a short musical idea – it might be a few notes placed in a certain order or rhythm, but it isn’t the main feature. Another characteristic of motifs is that they’re generally repeated. Ideas that play frequently throughout the song and may vary slightly from section to section.

Three Common Types of Melodies in EDM

There are a ton of different melodic structures in music. You can arpeggiate a chord and turn it into a melody, you can add notes on top of a pre-existing chord progression, you can use long notes, short notes. The list goes on. In my opinion there are three main melody structures in EDM:

My 5-Step Approach to Creating Memorable Melodies

Now that you know a little theory, it’s time to launch into the practical side of things. While melodies can be created by randomly plotting in notes, I find it better to use a structure. Using a structure DOES NOT mean you won’t suffer from lack of inspiration or ideas, or that you’re restricting yourself. It means that you’ll be able create a musical idea more quickly and easily.

1. Choose a scale

Starting with a scale limits the amount of notes you can use straight away, so you won’t waste time plotting each note by ear or hitting random keys on your keyboard. I’ve chosen a C Major pentatonic scale which contains C, D, E, G, and A.

2. Create a Rhythm

After identifying the scale you want to create your melody in, you need to come up with the rhythm for your melody. You see, melody isn’t just a succession of notes. It’s a rhythmic succession of notes. Rhythm is extremely important in melody. Don’t neglect it.

Creating a simple rhythm which will be the foundation for the melody.

Creating a simple rhythm which will be the foundation for the melody.

You might want to use a kick drum or a metronome when working on the rhythm for your melody. Here’s how mine sounds so far:

3. Draw a contour

Now that the rhythm is nailed, it’s time to start sketching the outline of the melody. This is where you have to think! I like to draw one on paper, but you can just paint a mental image in your head if you want to save the trees.

A badly taken photo of my hand-drawn contour.

A badly taken photo of my hand-drawn contour.


4. Choose/create a sound

Whether you want to write your melody before or after sound design is completely up to you. I prefer to create or choose a sound first as I know having a good sound will influence my writing decisions (certain melodies will work great with a massive trance lead, but not as well with a cheap piano sound). I created a simple pluck sound in NI’s Massive.

5. Create!

At this point it’s time for you to refer back to the contour line you drew (or thought of) and change around some notes until you find something that rings with you. Don’t feel like you have to follow your contour line exactly. If something sounds out of place, fix it.


Following the contour line created earlier.


Adding Flair

The melody is nice, but it isn’t great. After creating something simple, you’ll want to make a few adjustments to add interest and flair. Try adding extra notes and varying note length.

Varied note length and added in extra notes

Varied note length and added in extra notes

Here’s what it ended up as.

Very… country-like. It lacks depth and power due to only being a single voice. But that’s a basic example of how you can use this structure to create melodies.


Sometimes it just doesn’t work. Try the following to regain your inspiration and get the right sound:

  • Use silence
  • Switch the instrument
  • Move it up or down an octave
  • Delete every second note

If you’re creating a melody from a chord progression then…

  • Work with the rhythm of the chord progression (if there is one)
  • Have the strong notes of the melody contained within the chord. I.e, if the first chord is a C Major, make the first note of the melody a C, E, or G.
  • Pay extra attention to the note before a chord change

Things to avoid:

  • Winding on and on. A good melody resolves and repeats itself.
  • Too much variation in pitch and rhythm. Consistency is key, keep it simple.

Analyzing 5 Memorable Melodies

One of the best ways to learn is by studying other artist’s work. Let’s deconstruct 5 well-known melodies.

1. Faithless – Insomnia

I had to choose this one, I just did. Insomnia is one of my favorite dance tracks of all time and I’m sure many others would agree with me when I say it’s CATCHY. Let’s take a listen…

The melody that comes in at 2:18 is simply awesome. It’s euphoric, uplifting, and most of all? It’s memorable.


MIDI of Faithless – Insomnia with contour shown

One thing that stands out about Insomnia is repetition. There’s an A and B section. The A section (first 4 bars) features a downwards slope from the 1st beat. The B section instead travels upwards from the E to the F-sharp instead of dropping down to the D. This provides some variation while keeping the overall melody memorable.

2. Paul Van Dyk – For an Angel

Yet another absolute classic. I’m sure you’ve all heard this one. (It’s in 240p so you know it’s old).

Below is the MIDI for the topline melody from this beautiful track. Notice the difference in range and rhythm compared to Insomnia. For an Angel This here is an example of how simple melodies can be. Look at it! Does it look complex? No. It’s straightforward. The rhythm and variation make it memorable.

3. Fisherman and Hawkins – Apache

This melody has been stuck in my head for the past few months. It’s epic and memorable at the same time. You can hear it from 4:00.

Pretty awesome, right? Let’s have a look at it.


MIDI for Fisherman and Hawkins – Apache

Check out the contour on that. What I love about this melody is variation in rhythm, you’ve got this staggering arp-like A section, then a long note followed by the close of the melody in a different rhythm.

4. Basto – Again and Again

I’m sure you’re sick of trance by now, so here’s a different one. One of my favorite tunes from Basto. The main melody can be heard after 0:35.


Ahhh. Ye olde Dancepiano 2k7 (if you made music during Avicii’s golden days, you’ll know what I’m talking about). Let’s take a look at the MIDI. Again and Again That top line seems complex but isn’t in theory. Basto is simply going up and down the scale before making a large jump on the fourth beat of every odd numbered bar. Notice how the D# is very prominent and drives the melody forward.

5. Calvin Harris – I’m Not Alone



This is one of my all time favorites. The main melody is based in chords, and gives off a trance feel but acts as a pop song and does it damn well. As for the MIDI. I'm not alone

3 Ways to Find Inspiration for Melodies

Recommended Reading: 37 Ways to Find New Song Ideas

Knowing how to write a melody is one thing, but what should you do when you’ve got no ideas? There are three things I do to find inspiration for melodies:

1. Find Contour from Images and Scenery

Some people like having a visual counter-part to audio. I find looking at photos and scenery, even just walking outside can trigger ideas for melodies. For example, you could extract a melody contour from an object in an image (like I’ve done here). Contour from image

2. External Noise

Human voice has pitch, birds chirp with a certain pitch. Take time to just listen and find the melodies that are being composed in every day life. They’re more obvious than you think. Listen out for melodies in:

  • Conversation
  • Wildlife
  • Machines and vehicles

It sounds cheesy, but give it a go.

3. Finding Rhythm from External Noise

You can find rhythm from external sounds just as you can find pitch. This can be found in conversation, maybe it’s a construction site where something’s being hammered. Everything has rhythm, you’ve just got to listen out for it. So you can find contour, pitch, and rhythm from simple things around you. That’s the basis for a melody. Endless ideas are at your fingertips! What are you waiting for?

A Final Word

You should now have a better idea of how to go about writing melodies and also finding inspiration for them. Melody writing will always be a challenge, but it should be enjoyable. Take the knowledge that you have and put some practice in. What’s your favorite melody of all time? Let me know in the comments section below.

Update: I’ve put together a FREE cheat sheet + pack of MIDI files for you to study. You can download them by clicking here.

New Producer?

EDM Foundations is the course for you.

It’s simple, to-the-point, and action-oriented. You won’t spend hours trawling through dry theory videos, you’ll be learning as you go.

By the end of the course, you’ll have finished 4 songs, including one original that you can share with family, friends, and the world.