Melody generator

Generate a tune in any key, then shape it by hand on the piano roll. Every note stays in the scale, strong beats land on chord tones, and the last bar comes home.

C6
B5
A5
G5
F5
E5
D5
C5
B4
A4
G4
F4
E4
D4
C4

Seed 1 · tap a cell to place a note · Shift-click or Extend mode lengthens the previous note · your melody is saved in this browser ().

What makes a melody work

Good melodies balance repetition and surprise. The generator follows a handful of rules songwriters and composition teachers have described for centuries:

  • Mostly steps, some leaps. Moving to the next scale note is smooth; a leap is exciting, and usually followed by a step back the other way.
  • Chord tones on strong beats. Beats 1 and 3 land on a note of the chord underneath, so the melody and harmony agree where it matters most.
  • Motifs. A short idea from bar 1 comes back in bar 3, sometimes moved up or down with the chord, so the listener has something to hold on to.
  • Cadence. The last bar approaches the tonic from a step above or below and holds it, like the full stop at the end of a sentence.

Pentatonic scales are the easiest place to start because they have no half steps, so no two notes clash. For chords to go with your tune, open the chord progression generator in the same key.

Questions

How does the melody generator work?

It writes one note per eighth-note step using the notes of your chosen scale. Strong beats snap to a note of the chord underneath, weak beats move mostly by step, earlier bars are sometimes repeated or shifted to form a motif, and the last bar always comes to rest on the tonic. Each seed number gives a different, repeatable melody.

Can I edit the melody?

Yes. Tap any cell in the piano roll to place or remove a note; placing a note on a step replaces whatever was there, because it’s a single melody line. Hold the Shift key (or use “Extend” mode on phones) to lengthen the previous note instead.

Can I use the melodies in my own music?

Yes — melodies you generate or write here are yours to use. Download a MIDI file and drop it into GarageBand, Logic, Ableton, FL Studio or MuseScore.

Why does it sound good even when random?

Because it is constrained by theory: every note belongs to the scale, chord tones land on the beats, big leaps are rare and followed by steps, and repetition gives the ear a pattern to follow — the same principles songwriters use.