My favorite way to write melodies when I'm stuck - Songwriting tutorial by Music By Mattie
Songwriting 5 min read

My favorite way to write melodies when I'm stuck

Sometimes writing melodies feels like banging your head against a rock. Here's the 5-step trick I use to get unstuck in 30 seconds.

Mattie
Mattie
April 10, 2026 · Updated May 1, 2026
Difficulty:
Beginner
#Songwriting#Melody#Creativity#Music Production

Key Takeaways

  • When you're stuck, borrow the rhythm of a melody you love and apply your own pitches to it.
  • Pick a reference song with similar BPM and genre - the closer the match, the easier the import.
  • MIDI rhythm transfers cleanly between projects when the BPM matches. You only have to swap the pitches.
  • Snap your imported MIDI to the scale of your project's key, then drag pitches freely until it sounds right.
  • Don't just copy and paste your melody - vary at least one note per iteration so the listener doesn't get bored.

I wrote the melody you’re about to hear in 30 seconds after being stuck for hours.

Not from scratch. I borrowed the rhythm from another song.

I used to sit at my piano for literal hours, praying some god-tier melody would birth itself out of my fingers. It pretty much never happens. So now, when I get stuck, I use a 5-step trick that gets me out of the rut every time.

I also made a full video on this…

All the ideas in this article come from the video below. If you don't feel like reading, well, I gotchu.

The core idea

Great melodies are hard to write from scratch. But great melodies are easy to identify.

It’s much easier to hear an amazing melody and say “wow, I love that” than to write one out of thin air. That’s actually most of what being a good songwriter is - your taste outpaces your ability, and the gap closes over time.

But when you need a melody now, you can shortcut the gap by borrowing the rhythm from a melody you already love and using it as scaffolding for your own.

You’re not stealing. You’re not even using the same notes. You’re just using the shape of the rhythm - and that’s something you can’t actually copyright. (Plus everyone you love does this. Welcome to writing music.)

Here’s the 5-step process.

Step 1: Pick a reference

Find a song with a melody you’d be proud to write.

If you’re new to this technique, the most important rule: pick a reference that’s similar to the song you’re working on. Same genre, same energy, and most importantly - same BPM.

The closer the BPM match, the easier the next steps get. You can always shift things later, but starting from a tempo match means the rhythm will line up cleanly when you import it.

For my example, I pulled a song from Epidemic called “How About Forever” by Vicky Vox at 120 BPM. The chorus had a melody I really liked.

Step 2: Map the rhythm only

Drop the reference song into your DAW and play through the rhythm of the melody on a MIDI keyboard.

Don’t worry about pitches. Don’t even try to match them. Just bang on a single note (or any notes - it doesn’t matter) and capture the timing of the original melody as MIDI.

how it sits in the pocket between the drums.

Rhythm in melody is vastly underrated. Pitch gets all the credit, but a good melody really lives in how it sits in the pocket between the drums. That’s what creates a melodic groove - the part of a melody that gets stuck in your head before you even know what notes are playing.

Make sure your project BPM matches the reference. In my case, both were 120.

Top-down view of Mattie's hands playing Nektar SE49 MIDI keyboard controller on wooden desk

Step 3: Apply new pitches

Now we have rhythmic MIDI data. Time to make it your own song.

Drag the MIDI clip over to your project. If your BPM matches, it lands cleanly on the grid - no time-stretching, no quantizing weirdness.

Then snap every note to the scale of your project’s key. I was in E flat, so I dragged everything to E flat scale notes.

Now drag notes up and down until something clicks. Literally just experiment with pitches until it sounds good.

This is the magic part: you spent hours getting nothing, and now you’re getting melodic ideas in seconds. There are no wrong answers here. If it sounds good, congratulations. You’ve been unstuck.

Step 4: Make it yours

The melody is sounding different from the reference, but you can still go further.

Some easy moves to add personality:

  • Add or remove notes at the start or end of phrases
  • Change a pitch or two to add a hook
  • Frankenstein it - stitch parts of multiple melodies together

In my example, I really liked the first melody I came up with, but I felt it needed one extra note at the beginning to really sing. One note. That was the difference between “okay melody” and “this is a song now.”

Change a pitch or two

A small change makes a melody yours. You don’t have to rewrite the whole thing.

Mattie in checkered shirt playing Casio keyboard with hands positioned on keys during melody composition session

Step 5: Extend it

Here’s where most beginners blow it.

Once you’ve got a melody you like, you’ll be tempted to copy and paste it a million times through the song. Bada-bing, brilliant songwriter, Nobel Prize incoming.

That’s a trap.

Repetition is good. Listeners need familiarity to make a song feel catchy. But pure repetition gets boring fast.

Think of it as a seesaw:

  • Too little repetition → no one remembers the song
  • Too much repetition → no one wants to listen all the way through

You want a balance. Catchy enough that the chorus burrows into the listener’s brain, varied enough that they don’t tap out by the second verse.

The fix is small variations. Even changing a single note on the third repetition gives the ear something fresh while keeping the melody recognizable. You can also tweak the rhythm - drop a note, shift one onset slightly, hold something longer - to keep the same pitches feeling different.

Listeners will rarely consciously notice this. But subconsciously, the song stays interesting all the way through.

A real example: writing rap melody in 60 seconds

I tested this whole process on a brand new beat in a genre picked at random.

Got rap. Started with an 808. Layered in some trappy drums. Sampled my own voice, cut the speed in half so it sounded cooler. Added a bell. Beat was ready for melody.

Then I pulled another song, mapped the rhythm of its melody to MIDI using exactly this process, dragged the notes into my key, tweaked them until I liked it, and the melody was done.

The whole thing took me less than the time it would’ve taken me to even consider writing a melody from scratch.

This works in any genre. Pop, rap, country, EDM, indie. The rhythm-borrowing trick doesn’t care what style you’re writing in - the math is the same.

Why this works (and why it isn’t cheating)

The thing most aspiring songwriters miss is that every great writer does this. Not always literally importing MIDI - but borrowing rhythmic and melodic patterns from songs they admire is how songwriters develop their voice.

You’re not stealing because:

  1. Rhythm itself isn’t copyrightable
  2. The pitches will be different
  3. You’ll change things to make it yours

What you’re really doing is using a known-good rhythmic shape as a scaffold. The scaffold lets your taste do its job - shaping pitches and tweaking notes until the melody is uniquely yours.

Next time you’re banging your head on the piano hoping inspiration strikes, try this instead. Pick a reference, steal the rhythm, swap the pitches, make it yours, vary the repeats.

Five steps. Thirty seconds. Out of the rut.

Share this article:

Twitter Reddit
Mattie

About Mattie

Mattie is a music producer, songwriter, and educator specializing in Logic Pro and vocal production. With over 10 years of experience in the music industry, he's helped thousands of artists transform their home studio recordings into professional-quality tracks.

As the founder of Music By Mattie, he creates tutorials, presets, and courses that simplify complex production techniques. His mission is to make professional music production accessible to everyone, regardless of budget or experience level.