Music Tools

Melody Generator

Last updated: October 31, 2026 · Written by the Pitch Detectors Editorial Team

Create melodies on a step-grid. Click cells to enable notes, set tempo, choose scale/instrument, then press Play.

120 BPM

Key Takeaways

  • A melody generator is a scale-constrained step sequencer: click grid cells to place notes that always stay in key — wrong notes are impossible by design.
  • Constraint beats freedom for beginners: limiting yourself to 7 scale notes produces better melodies than 88 piano keys.
  • The catchiest hooks use 3–4 distinct pitches — repetition with small variations is what makes melodies memorable.
  • Compose rhythm first, pitches second: tap a rhythm on one note, then assign scale degrees to it.
  • Export your pattern by ear into your DAW, then develop it with the chord progression generator for harmony underneath.

What Is a Melody Generator?

A melody generator is an interactive step sequencer that lets you compose melodies by clicking notes onto a grid. Each column is a time step, each row is a pitch from your chosen scale — click cells to place notes, press play, and hear your melody looped at your chosen tempo with a synthesized instrument.

Unlike random melody tools, this one is compositional, not generative: every note is your choice, but the grid only offers in-scale pitches, so nothing you click can clash with your key. It is a melody sketchpad that removes the fear of wrong notes.

How This Calculator Works

The widget above is a browser-based step sequencer running on the Web Audio API. The exact mechanics:

  1. Choose a scale and root: the grid's rows remap to the selected scale's pitches (e.g. C major: C–D–E–F–G–A–B across two octaves).
  2. Click cells: each filled cell schedules one note at that step; empty cells are rests. Multiple filled cells in one column play as a chord.
  3. Set tempo and instrument: the tempo slider (60–200 BPM) sets step duration; the instrument selector changes the oscillator timbre.
  4. Press play: a scheduler walks the columns left to right, triggering Web Audio oscillators at each step's frequency — looping until you stop it.

Because the grid only contains scale tones, every possible click pattern is diatonic — the tool constrains pitch so you can focus entirely on rhythm and contour.

Melody Math and Worked Example

The timing math behind the grid is simple division:

step duration (seconds) = 60 ÷ BPM ÷ steps per beat

Worked example: 16-step grid at 120 BPM with 4 steps per beat (16th notes).

  1. One beat: 60 ÷ 120 = 0.5 seconds.
  2. One step: 0.5 ÷ 4 = 0.125 seconds (125 ms).
  3. One full 16-step loop: 16 × 0.125 = 2.0 seconds = one 4/4 bar.
  4. Frequencies come from equal temperament: A4 = 440 Hz, each semitone multiplies by 21/12.

How to Use This Calculator

  1. Pick a scale and root: start with major for bright hooks or natural minor for darker ones.
  2. Set the tempo: match your project's BPM (find it with BPM tap tempo).
  3. Click a rhythm: fill 4–8 cells in one row first — rhythm before pitch.
  4. Assign pitches: move some notes to different rows, keeping the rhythm. Small moves (neighboring scale degrees) sound most natural.
  5. Loop and refine: press play, listen on repeat, and adjust one note at a time until it sticks in your head.

Reading Your Result: What Makes a Grid Pattern Work

Pattern trait What to check Why it matters
Pitch count How many different rows are used 3–4 pitches = memorable; 7+ = wandering
Contour The shape: up, down, arch, or flat Arches (up then down) feel most songlike
Rest density Empty cells between notes Rests create breathing room and groove
Repetition Does a 2–4 step motif repeat? Repetition is what makes hooks hook
Range Highest vs lowest row used An octave or less stays singable

Why Constraint Creates Better Melodies

Beginners write better melodies with 7 allowed notes than with 88. This is the paradox the grid exploits: unlimited choice produces random wandering, while a scale constraint forces you to make music from rhythm, repetition, and contour — the actual ingredients of memorable melody. Jazz improvisers practice the same way, restricting themselves to one scale until it sings.

Try the experiment: compose one 16-step pattern using all rows, then one using only 3 rows. The 3-row version will almost always sound more like a "real" hook. Limitation is a compositional technique, not a training wheel.

TEMPO & BEAT GRID Alt text: Comparison of two step-sequencer grids showing a scattered pattern versus a tight repeating hook motif. BEAT 1 BEAT 2 BEAT 3 BEAT 4 BAR 2 ¼ NOTE ¼ NOTE two 16-step grids side by side — a scattered 7-pitch pattern labeled "wandering" vs a
Alt text: Comparison of two step-sequencer grids showing a scattered pattern versus a tight repeating hook motif.

The 3-Note Hook Rule

The most memorable melodies in pop history use shockingly few distinct pitches. Think of hooks you can whistle: most live on 3–4 scale degrees, repeated with rhythmic variation. The brain latches onto small pitch sets because it can predict them — and prediction fulfilled feels like catchiness.

Practical method: fill your grid using only the root, third, and fifth of your scale (the 1–3–5 of the tonic triad). Write 8 steps. Then allow yourself one outside pitch as an accent. That single surprise note against a stable 3-note core is the entire craft of hook writing in miniature.

Rhythm First, Pitches Second

Professional songwriters compose rhythm before pitch. The groove of a melody — where notes fall against the beat — determines its feel far more than which notes they are. A great rhythm on one repeated pitch already sounds like music; great pitches with dead rhythm sound like an exercise.

Grid workflow: click 6–8 cells all in the same row until the rhythm grooves on loop. Only then start moving individual notes to new rows. You will find the melody almost writes itself — because the hard part (rhythm) is already solved.

From Grid to DAW: Finishing Your Melody

The grid is a sketchpad; your DAW is the canvas. Once a pattern loops well, recreate it in your DAW's piano roll by ear (16 steps at 120 BPM = one bar — count it in), then develop it: add a second phrase that answers the first, vary the ending, and harmonize it with chords from the chord progression generator.

Check your melody's note set against the scale finder if you plan key changes, and verify any sung version sits in a comfortable range with the vocal range finder.

[Infographic: the 5-step workflow — scale → rhythm → pitches → loop/refine → DAW — with icons]
Alt text: Infographic of the five-step melody workflow from scale selection to DAW production.

Limitations

  • Diatonic only: chromatic passing tones and blue notes aren't on the grid — add them in your DAW.
  • Fixed grid resolution: triplets and swung rhythms can't be represented on an even step grid.
  • Synth preview, not production audio: the Web Audio timbres sketch the idea; final sound design happens in your DAW.
  • No dynamics: every step plays at equal velocity — accents and phrasing are up to you.

Melody Generator vs Alternatives

Method How it works Best for Watch out for
This step sequencer Click notes on a scale-locked grid Beginners, quick hooks, no wrong notes Diatonic only; fixed grid
AI melody generators Model composes for you Instant ideas, block-breaking Generic output; you didn't write it
Piano roll (DAW) Full manual composition Complete control, production-ready Blank-page paralysis for beginners
Humming into a mic Voice memo + transcription Capturing inspiration anywhere Needs transcription to become usable

Melodies you compose with this tool are your own original work. The grid constrains pitches to your chosen scale but every rhythmic and melodic decision is yours.

Frequently Asked Questions

It is a step sequencer: columns are time steps, rows are pitches from your chosen scale. Click cells to place notes, set a tempo and instrument, and press play — the browser schedules each note via the Web Audio API and loops the pattern. Because rows are scale-locked, every click stays in key.

A grid-based composer where time flows left to right in fixed steps and pitch runs bottom to top. Each filled cell triggers its note when the playhead reaches that column. Step sequencers power classic drum machines and synth arpeggiators — this one is tuned for melody writing.

Start with rhythm on a single pitch, then assign 3–4 scale degrees to that rhythm. Repeat a short motif, vary its ending, and keep the range within an octave. Catchiness comes from repetition plus one small surprise — not from using many different notes.

Match your song's key: major for bright pop and dance, natural minor for darker or emotional tracks, pentatonic for foolproof hooks (five notes, zero wrong choices). If your chords are already written, use their key — the melody must live in the same harmonic house.

Fewer than you think — most iconic hooks use 3–4 distinct pitches across 4–8 rhythmic hits. The magic is repetition with variation: state a motif, repeat it, then change just the last note. If your grid uses all seven scale degrees equally, simplify.

Your song's tempo — the melody must lock to the track. Common zones: 90–100 BPM for hip-hop and R&B, 120–130 for house and pop, 140+ for energetic electronic. Set the slider to match your DAW project before composing so the rhythm translates directly.

Yes — you composed every note by clicking the grid, so the melody is your original work. (This differs from AI generators where authorship can be murky.) Short, common motifs aren't copyrightable anyway, but your specific rhythmic-melodic combination is yours.

Impose structure: limit yourself to 3 pitch rows, repeat a 4-step motif twice with a varied ending, and leave at least a quarter of the cells empty as rests. Randomness comes from too many pitches and no repetition — remove both and musicality appears.

A melody is the full tune; a hook is the short, repeated fragment designed to stick — usually the chorus's catchiest 4–8 notes. Every hook is a melody, but not every melody is a hook. Compose hooks on the grid, then expand them into full melodies in your DAW.

Recreate the grid in your DAW's piano roll by ear: set the same tempo and scale, then place notes at matching steps (16 grid steps at 120 BPM = one 4/4 bar of 16ths). Record the browser audio as a reference track if your DAW supports loopback, and use it as a guide while programming the final MIDI.