gizmobench
BrowseDaily

Melody Sketch Generator

Pick one of 12 keys and 9 scales (major, natural and harmonic minor, Dorian, Phrygian, Lydian, Mixolydian, and major and minor pentatonic), then set up to 128 notes, the note lengths the rhythm may use, a range between A0 and C8, a seed and a tempo. The generator walks through the notes of that scale by rules it states: it opens on the tonic, third or fifth where the range allows, moves mostly by step, steps back after a leap of three or more scale steps and ends on the tonic when the range includes one. The same settings and seed always give the same melody. Drag a note up or down, or use the arrow keys and the edit buttons, to change pitch, length and order. Hear it on a simple built-in synth, then download a MIDI file for your DAW or a project JSON that reopens here.

Settings

Rhythm pool: the note lengths the melody may use
8 notes in C major
C5B4A4G4F4E4D4C4

Focus a note: Up and Down move it a scale step, with Shift a semitone; Left and Right pick the next note, with Shift shorter or longer; Delete removes it and Enter plays it. Drag a note up or down to change its pitch.

Text equivalent: Piano roll, pitch rows C4 to C5; rows outside C major or the chosen range are shaded, and notes there are drawn in coral. Notes in order: C4 for 0.5 beats, D4 for 0.5 beats, F4 for 0.5 beats, D4 for 0.5 beats, C4 for 1 beat, D4 for 0.5 beats, F4 for 0.5 beats, C4 for 2 beats.

Note 1 of 8: C4, MIDI 60, eighth, 0.5 beats, bar 1 beat 1

Notes
8
In scale and range
8 of 8
Length
6 beats, 3.0 s
Lowest to highest
C4 to F4

Worked cases

  • Allowed pitchesC major, range C4 to C5
    60 62 64 65 67 69 71 72 (8 MIDI notes)
  • Allowed pitchesA natural minor, range A3 to A4
    57 59 60 62 64 65 67 69 (8 MIDI notes)
  • MIDI exportTempo 120 BPM, 480 ticks per quarter, one half note
    tempo 500000 microseconds per quarter; note-on to note-off 960 ticks
How a melody is built. The allowed pitches are every note of the key and scale between your lowest and highest note, and nothing else can appear. The melody opens on the tonic, third or fifth, in the lower half of that range when one is there. It mostly moves one scale step at a time, sometimes repeats or skips a note, and now and then leaps three or four steps. After a leap of three or more steps the next note steps back the other way, the note before the close moves by a step or a skip, no pitch sounds three times running while another is available, and the further the line drifts from the middle of the range the more likely it turns back. A melody of two or more notes ends on the tonic nearest the note before it when the range holds a tonic, and a range with only one note of the scale repeats that note. Lengths come from your rhythm pool: off the beat, a length that lands on the next beat or stays inside it is chosen whenever the pool has one, and the last note takes the longest length in the pool. Pitches and rhythm come from separate streams of the seed, so a new pool changes only the rhythm.

Generated and played in this browser, with nothing uploaded and no account. After you change the melody or tempo, this browser can retain them when browser storage is available. Save project JSON keeps a separate file you can reopen. Once a project is saved locally, Start over appears above the tool and clears that browser copy.

Common questions

How can I generate an eight-bar melody?
Set Note count to 32 and leave only Quarter selected in the rhythm pool, then press Generate melody. Each note lasts one beat, giving 32 beats, or eight bars of 4/4. The Length readout shows the total beats. Adding other lengths to the pool or editing note lengths can change that total: note count sets the number of notes, not the number of bars.
Do I need an account or a plugin to generate and save a melody?
The core generator, piano-roll editing, MIDI download and project JSON saving are free to use without an account. They run on this page without an installed plugin. Download MIDI saves the note sequence for use in music software; it is not an audio recording. Save project JSON keeps the settings, tempo and edited notes for reopening here. Playback needs the browser's Web Audio support, but MIDI and project JSON export do not.
Can it generate a melody from lyrics, chords or an audio file?
No. The inputs are a key, scale, note count, rhythm pool, pitch range and seed. There is no lyrics or chord-progression input, audio transcription or AI model. Open project JSON reads only a melody project saved by this page. The output is one melody line, with no chord accompaniment or sung vocals.
How does the melody generator pick the notes?
The pitch and rhythm rules are listed in How a melody is built, after the worked examples. That section explains the opening note, steps and leaps, closing note and rhythm lengths.
Will the same seed give me the same melody again?
Yes. Keep the key, scale, note count, rhythm pool, range and seed together: the seed alone does not record the other settings. With all of them unchanged, Generate melody produces the same notes again. Tempo does not change the notes. Pitches and rhythm come from separate streams of the seed: changing only the rhythm pool keeps the pitches and changes the lengths, and a longer melody from the same seed starts with the same notes as a shorter one, apart from the shorter one's last two notes, which lead into its close. New seed draws a random seed from 0 to 999,999 and generates straight away when the settings are valid. Generating replaces your note edits, so save a project JSON to keep an edited version.
How do I edit notes in the piano roll?
Click or tap a note to select it, and drag it up or down to change its pitch by semitones. With a note focused, Up and Down move it one scale step, Shift with Up or Down moves it a semitone, Left and Right select the previous or next note, Shift with Left or Right makes it shorter or longer, Delete removes it and Enter plays it. The buttons under the roll do the same, and can also move a note earlier or later or duplicate it. A melody holds 1 to 128 notes, lengths run from a sixteenth to a whole note, and pitches from A0 to C8. Notes you move outside the key or the range are drawn in coral, and the readout shows how many notes are still inside both.
What is in the MIDI file?
A Standard MIDI File, format 0, with one track at 480 ticks per quarter note. It holds a track name, your tempo (500,000 microseconds per quarter note at 120 BPM), a 4/4 time signature, and a note-on and note-off for every note in order on channel 1 at velocity 100, so a half note spans 960 ticks. There is no program change, so the program you open it in chooses the instrument. Middle C is MIDI note 60, written C4 on this page.
Can I save a melody and keep working on it later?
Save project JSON downloads the melody's applied settings, the current tempo and every note, including your edits. Setting changes awaiting Generate melody are not included. Open project JSON checks the whole file before replacing your melody; a rejected file leaves the current notes intact. When browser storage is available, the page also saves the applied settings, notes and valid tempo after you generate, edit, open a project or change the tempo. Clearing browser data can remove that local copy, so download a project JSON to keep a separate file. Copy note list puts the current melody on the clipboard as text, with note names, MIDI numbers, lengths and positions in the bar.
Does playback use real instrument sounds?
No. Play sounds each note on a plain triangle-wave oscillator through the browser's Web Audio, at the tempo you set, with no instrument samples. Stop silences it at once, and changing a note or the tempo, hiding the tab or leaving the page stops it too. The MIDI file carries no sound of its own: the program you open it in plays it with its own instruments.
Is the melody original, and will it sound good?
Each melody is drawn from your settings by the rules above, not copied from a collection of existing songs. Short stepwise lines in a common scale can still resemble phrases that already exist, and nothing here checks for that. The rules keep the notes in your scale and range and give the line a shape; they make no judgement about whether it sounds good, so treat the result as a sketch to edit.

Rule-based music sketch, not AI composition or a quality guarantee. No copied melody corpus or instrument samples.