How to Compose Music: Write a Melody and Get It Written Down

November 3, 2026
Try the Audio to MIDI Converter on your own song.Free, right in your browser. Nothing to install.Open it, free
How to compose music step by step: learn a scale, build chords, write a melody, and record it as notes or MIDI. Includes a free way to capture hummed ideas.
composing
music theory
melody
midi
songwriting

To compose music, pick a scale, write a short melody (called a motif) using its notes, add chords underneath, and repeat and change the motif to build a full piece. Then write it down, either as sheet music or as MIDI notes in a music program. If you have a tune in your head, Audio to MIDI is free, runs in your browser, and turns something you hum or play into notes you can edit.

This guide is about composing: coming up with notes and getting them onto the page. For the full path to a finished recording, see how to make a song.

Composing in one sentence

To compose is to decide which notes happen, when, and for how long. That is all. Everything else, such as chords, form and style, is a way of making those choices.

You can compose on an instrument, in your head, on paper or on a computer. Many composers use all four.

Step 1: Learn one scale

A scale is a set of notes that sound good together. Composing with a scale means you cannot easily pick a note that clashes.

The major scale is the usual start. It follows this pattern of steps, where "whole" means two piano keys and "half" means one key:

whole, whole, half, whole, whole, whole, half.

Start on C and follow it, and you land on only the white keys: C, D, E, F, G, A, B, then C again. A minor scale sounds darker. The A minor scale uses the same white keys, starting from A.

Play the scale up and down a few times. Say the note names out loud as you go.

Step 2: Write a motif

A motif is a short musical idea, often just three to six notes. Many famous pieces grow from a motif of only a few notes.

Try this:

  1. Choose a rhythm first. Clap four beats with a pattern like long, short, short, long.
  2. Pick notes from your scale for each clap.
  3. Play it. If it sticks in your head, keep it. If not, change one note and try again.

Most good tunes mostly move by small steps, with an occasional jump. Big jumps feel dramatic, so use them on purpose. Ending the phrase on the home note (C in C major) feels finished. Ending on another note feels like a question.

Step 3: Repeat and change it

Repetition is what makes a tune feel like a tune. Play your motif again, then change it a little. Three simple ways:

  • Move it. Start the same shape on a different note.
  • Change the rhythm. Keep the notes but stretch or squeeze the timing.
  • Change the end. Keep the start the same, but end the phrase somewhere new.

A common shape is two phrases that match, where the second one answers the first. Question, then answer.

Step 4: Add chords

Chords are three or more notes played together. Each note of the scale can be the base of a chord that uses only notes from the scale. In C major they are:

NumberChordType
ICmajor
iiD minorminor
iiiE minorminor
IVFmajor
VGmajor
viA minorminor
vii°B diminishedtense

The I, IV and V chords form a strong base. A simple loop is I, V, vi, IV (C, G, A minor, F). Play a chord under each bar of your melody and listen. If a melody note clashes with the chord, change the note or change the chord.

Step 5: Shape the whole piece

Think in sections. A pop song might be verse, chorus, verse, chorus. A short instrumental piece can use A and B sections: write the first, then write a contrasting second one, then return to the first. Coming back to the opening gives listeners something familiar.

Contrast helps. Change the register (higher or lower notes), the rhythm, the volume or the chords from section to section.

Step 6: Write it down

You have three common options.

Sheet music. Staff notation is the standard way to share music with other players. You can write it by hand or in notation software.

A lead sheet. This is just the melody and chord names. It is faster and common in pop and jazz.

MIDI. MIDI is a file of note instructions, not sound. In a music program, notes appear in a grid called a piano roll, where each note's pitch, start and length are bars you can drag. You can change the instrument with one click. It is the quickest way to hear what you wrote.

Capture ideas from your voice or an instrument

Many tunes arrive when you do not have your instrument handy. Hum or play the idea into your phone, then convert it.

  1. Open Audio to MIDI. It is free, needs no sign-in, and runs in your browser, so your recording is not uploaded.
  2. Choose what kind of sound it is: Vocals / humming, Piano / keys, Guitar, Bass or Full song. Single-note choices read one note at a time. Piano and guitar keep chords.
  3. Upload a file (MP3, WAV, M4A, FLAC, OGG or AAC, up to 10 minutes), or press Record and sing, hum or play.
  4. Adjust the note sensitivity and shortest-note settings. They take effect straight away, with no need to convert again.
  5. Download the .mid file and drag it into a music program such as Ableton, Logic, FL Studio, GarageBand, Cubase or Reaper.

A clean, single instrument in a quiet room gives the best notes. A whole band in one recording will come out messy.

Learn by taking pieces apart

Composers learn by studying other music. If you want to know how a piano part in a song is written, you can separate it first. The Piano Extractor pulls the piano out of a song as its own track, and then you can run that file through the MP3 to MIDI page to see the notes. In our test, a 4 minute 44 second song split into six tracks in 56 seconds. New accounts get 5 free credits when they sign in with Google. The splitting runs in the cloud, so there is nothing to install, and the MIDI step is free.

Do this to study and practice. If you publish a piece that copies someone else's melody or uses their recording, you need permission. Writing your own melody in the same style is fine.

FAQ

Do I need to read music to compose?

No. You can compose by ear and by using a piano roll in a music program. Reading music helps when you want to share parts with players, but it is not a starting requirement.

What is the easiest way to start composing?

Pick a scale (C major is a good one), clap a rhythm, and fit notes from the scale to it. Repeat the idea and change one thing each time.

How do I turn a tune in my head into notes?

Hum it into a recording, then convert it with Audio to MIDI. Edit any wrong notes in the piano roll of your music program.

What is the difference between composing and songwriting?

They overlap. Composing is the broad word for creating music. Songwriting usually means a song with lyrics, and it often includes verses and choruses.

Can I compose music on a computer for free?

Yes. Free music programs let you write notes in a piano roll and play them with built-in instruments. Audio to MIDI is also free.