Music Tools

Melody Generator

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

Compose melodies on a 16-step grid: 12 rows of notes drawn from your chosen scale and root. Click cells to place notes, set the tempo, pick an instrument, then press Play.

120 BPM

Key Takeaways

  • A melody generator comes in two families: compositional (this step sequencer — you place every note) and generative (AI tools that compose for you). Compositional tools keep authorship clear.
  • Constraint beats freedom for beginners: the grid always shows 12 rows — in the four scale modes, 12 consecutive notes of one scale — and that narrow window produces better melodies than 88 piano keys.
  • The 3-note hook recipe works: 6 rhythmic hits on scale degrees 1–3–5, repeated with one varied ending.
  • Compose rhythm first, pitches second: tap the groove on one row, then move notes to new rows.
  • Scale lock applies to 4 of the 5 modes — Chromatic mode offers all 12 semitones with no lock.
  • Transfer patterns to your DAW by ear: 16 steps at 120 BPM = one 4/4 bar of 16ths. Harmonize with the chord progression generator.

What Is a Melody Generator?

A melody generator is an interactive tool that helps you create a tune. This one is a compositional step sequencer: a 16-step by 12-row grid where columns are time steps and rows are pitches from your chosen scale. Click cells to place notes, set a tempo and instrument, and press play. Unlike AI generators that compose for you, every note here is your decision.

The grid removes the fear of wrong notes without removing authorship. Scale lock constrains which pitches are available; rhythm, repetition, and contour — the real ingredients of a hook — are entirely yours.

How This Melody Generator Works

This melody generator is a browser-based step sequencer running on the Web Audio API. It schedules each filled cell as an oscillator note and loops the pattern. The exact mechanics:

  1. Choose a scale and root: the 12 rows remap to 12 consecutive notes of that scale in a bright, high register. In C major the rows run from E at the bottom up to B at the top — the root C sits six rows up, not on the bottom row. Major and minor windows span 12 scale notes (an octave plus a fifth); pentatonic and blues windows span two octaves of their notes; Chromatic mode skips the lock and offers all 12 semitones in one octave.
  2. Click cells: each filled cell plays one note at its step; empty cells are rests. Multiple filled cells in one column play together as a chord.
  3. Set tempo and instrument: the slider sets 60–200 BPM; the selector switches oscillator timbre (sine, square, triangle, sawtooth, pluck).
  4. Press play: a scheduler walks the columns left to right, triggering each step's notes — looping until you stop it.

In the four locked modes, every click is diatonic — pitch is constrained so you can focus entirely on rhythm and contour. In Chromatic mode, the training wheels come off.

Melody Math: Step Timing and Worked Example

The grid runs on simple division.

step duration (seconds) = 60 ÷ BPM ÷ 4 (4 steps per beat = 16th notes)

Worked example: 16-step grid at 120 BPM.

  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 of 16ths.
  4. Frequencies follow equal temperament: A4 = 440 Hz, each semitone multiplies by 21/12.

This math is your DAW transfer key: 16 grid steps at 120 BPM always equals one bar, so a pattern you sketch here drops straight into a piano roll at the same tempo.

TempoOne stepFull 16-step loop
60 BPM250 ms4.00 s
90 BPM166.7 ms2.67 s
120 BPM125 ms2.00 s
200 BPM75 ms1.20 s

How to Use the Melody Generator

  1. Pick a scale and root: start with Major Pentatonic for foolproof hooks or Natural Minor for darker melodies.
  2. Set the tempo: match your project's BPM first — find it with BPM tap tempo.
  3. Tap a rhythm: fill 4–8 cells in a single row until the groove loops well — rhythm before pitch. Click cells one by one, or drag across them to paint a run.
  4. Assign pitches: move notes to 2–3 different rows, keeping the rhythm. Neighboring scale degrees sound most natural.
  5. Loop and refine: press play, listen on repeat, and change one note at a time until the pattern sticks in your head.

Reading Your Grid: 5 Checks for a Working Pattern

CheckWhat to look atTarget
Pitch countHow many different rows are used3–4 pitches = memorable; 7+ = wandering
ContourThe shape: up, down, arch, or flatArches (up then down) feel most songlike
Rest densityEmpty cells between notes≥25% empty = breathing room and groove
RepetitionDoes a 2–4 step motif repeat?A repeated motif is what makes hooks hook
RangeHighest vs lowest row you actually usedAbout an octave or less keeps the line singable

Why Constraint Creates Better Melodies

Beginners write better melodies inside a 12-row window of one scale than across 88 piano keys. Unlimited choice produces random wandering; a scale constraint forces you to build 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.

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

Alt text: Two step-sequencer grids compared — a scattered 7-pitch pattern versus a tight repeating 3-pitch hook motif.
Alt text: Two step-sequencer grids compared — a scattered 7-pitch pattern versus a tight repeating 3-pitch hook motif.

The 3-Note Hook Recipe

Fill this exact recipe into the grid and you get a working hook in under a minute.

  1. Set the scale to Major Pentatonic, root C, tempo 120.
  2. Place notes on steps 1, 4, 7, 10, 13, and 16, using only rows that play scale degrees 1–3–5 (C–E–G, the tonic triad — in C pentatonic each of those notes appears on two rows; either set works).
  3. Leave steps 8 and 15 empty — rests are part of the groove.
  4. Press play and loop it twice.
  5. On the second loop, change one note to a different scale degree — the small surprise the brain remembers.

The brain latches onto small pitch sets because it can predict them, and prediction fulfilled feels like catchiness. Three stable notes plus one surprise is the whole craft of hook writing in miniature.

Rhythm First, Pitches Second

Professional songwriters compose rhythm before pitch. Where notes fall against the beat determines a melody's 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 move individual notes to new rows. The melody nearly writes itself — because the hard part (rhythm) is already solved.

You Wrote It: The Authorship Line

This melody generator is compositional — you made every decision. You chose the scale, placed each note, set the rhythm, and shaped the contour. The tool constrained the pitch menu; nothing else. That makes the result unambiguously your original work.

AI melody generators differ: the model makes the compositional decisions from your text prompt, and authorship of that output is legally murky (review any AI output before commercial use, as Musely's own page advises). With a grid, there is no ambiguity — the clicks are yours, so the melody is yours.

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: same tempo, same scale, notes at matching steps. 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 of the five-step melody workflow from scale selection to DAW production
Alt text: Infographic of the five-step melody workflow from scale selection to DAW production.

Limitations

  • Scale lock is not universal: Chromatic mode offers all 12 semitones — including clashing ones. In the other four modes, chromatic passing tones aren't on the grid (the Blues scale's ♭5 is, in Blues mode); add passing tones in your DAW.
  • No save and no export: the grid holds your pattern only while this page stays open — reloading loses it, and there is no MIDI or audio download. Recreate the pattern in your DAW with the step math above before you close the tab.
  • High register: the rows sit in a bright, lead-synth register, well above a typical singing range. Treat the loop as a sketch and transpose it down in your DAW for vocals.
  • 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

MethodHow it worksBest forWatch out for
This step sequencerYou click notes on a scale-locked gridBeginners, quick hooks, clear authorshipDiatonic only (except chromatic); fixed grid
AI melody generatorsA model composes from your text promptInstant ideas, no theory neededGeneric output; you didn't write it; murky authorship
Random MIDI toolsAlgorithms generate note sequencesStarting points, block-breakingOften needs heavy editing to sound musical
Piano roll (DAW)Full manual compositionComplete control, production-readyBlank-page paralysis for beginners
Humming into a micVoice memo + transcriptionCapturing inspiration anywhereNeeds 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

This one is a step sequencer, not an AI composer. Columns are 16 time steps; the 12 rows are pitches from your chosen scale. Click cells to place notes, set a tempo (60–200 BPM) and instrument, then press play — the browser schedules each note via the Web Audio API and loops the pattern. Four of the five scales lock rows to in-key pitches; Chromatic mode offers all twelve semitones.

A step sequencer is a grid-based composer: time runs left to right in fixed steps, pitch runs bottom to top. Each filled cell fires its note when the playhead reaches that column. Drum machines and synth arpeggiators run on the same principle — this one tunes the grid for melody by locking rows to a scale.

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 and harmony must live in the same key.

Fewer than you think: most iconic hooks use 3–4 distinct pitches across 4–8 rhythmic hits. State a motif, repeat it, then change just the last note. If your grid uses all seven scale degrees equally, simplify down to three rows.

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 the model made the compositional decisions and authorship is murkier. Short, common motifs aren't copyrightable anyway — but your specific rhythm-pitch 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. Random-sounding melodies come 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 equals one 4/4 bar of 16th notes. Record the browser audio as a reference track if your DAW supports loopback, and use it as a guide while programming the final MIDI.

The grid's 12 rows are a window of consecutive scale notes in a bright, high register, not one octave starting on the root. In C major the rows run from E at the bottom to B at the top, so C sits six rows up. Find the root rows first and anchor your motif around them — every row stays in key either way.