~/endless-music-generator ☀ LIGHT 🎵 music 🎹 Chord Pad ☕ Support me apps ← about me

Endless Music Generator — Free Lofi, Ambient and Study Music in Your Browser

8 moods · never repeats · no account · WAV + MIDI

Press play and it starts writing music, bar by bar, and it does not stop. Chords that follow real harmony rather than a random walk, a melody over the top, a bass line and — depending on the mood — drums. Every piece grows out of a seed number, so the same link always plays the same music, and you can take any stretch of it away as a WAV or a MIDI file. It is algorithmic, not AI: no account, no credits, no queue, nothing uploaded. The whole composer is about thirty kilobytes of JavaScript running in this tab.

80
Now playing
Ready
press play
MoodLo-fi
Key
Tempo
Bar0
Playing for0:00
Seed
Nothing here was written by a person and nothing here was written by a language model. The chords come from a transition table of ordinary functional harmony, the melody is drawn from the current chord and scale, and a seeded random number generator decides the rest — which is why the same seed gives you the same piece back, every time, on any machine.
Mood Changing mood starts a new piece
Layers
Chords
78
Melody
70
Bass
72
Drums
brushed kit
66
Shape & texture
78
100%
40
35
35
0
Tempo, the levels and the textures are playback settings: the notes are already decided and they just arrive faster, slower, louder or wetter, so turning the melody down and back up does not lose your place. Melody density is the one exception — it changes which notes get written, so it is part of the piece and travels in the share link along with the seed.
Seed
A seed is a whole piece of music written as one number. Two people opening the same link, on different machines, in different browsers, hear exactly the same notes in the same order — forever, not just for the first minute. If you stumble on something you like, copy the link before you press NEW PIECE; there are four billion seeds and you will not find it again by accident.
Take it away
Both exports start the piece again from bar one of the current seed, so what you get is the beginning of what you are hearing rather than a recording that happens to start wherever you clicked. The MIDI file has four tracks — chords, melody, bass and drums on channel 10 — ready to drop into a DAW and re-voice with real instruments. Everything is rendered here; nothing is uploaded and nothing is watermarked. Use it in a video, a game or a podcast without asking.
Keyboard
Space starts and stops · N a new piece · S skip to the next chord · 18 switch mood · volume · C copy the share link · F fullscreen

# What this actually is

An endless music generator is a program that writes music while you listen to it. This one runs entirely in your browser tab. There is no model, no server, no queue and no credits: the whole composer is a few hundred lines of JavaScript that chooses a key, walks a chord progression, draws a melody over each chord and hands the result to a synthesiser built out of Web Audio oscillators. It produces a bar of music roughly every three seconds and it will keep doing that until you close the tab.

Nothing is uploaded, because there is nothing to upload. Nothing is downloaded either, apart from the page itself — there are no samples, no soundfonts and no audio files. If you turn off your wi-fi after the page has loaded, it carries on composing exactly as before.

# Algorithmic, not AI

Almost everything that calls itself a music generator today is a machine-learning service: you type a prompt, a server somewhere renders audio, and you get back a file — after an account, a credit balance and a wait. Those tools can do things this one cannot, and if you want a full arrangement with vocals from a sentence of description, you want one of those and not this.

This is the older idea, and for background music it is the better one. Music that comes out of explicit rules can be endless, instant, free and reproducible at the same time. There is no cost per minute, so it never has to stop. There is no inference step, so the first bar plays the moment you press the button. And because a single random seed drives every decision, the piece is a number: share the number and the music comes back, note for note, on any machine.

# How the music is put together

The harmony is not a random walk

The most obvious way to generate chords — pick one from the key at random, repeat — sounds immediately wrong, and it is worth understanding why. Music in a key has a pull towards home. The dominant chord wants to resolve to the tonic; the subdominant wants to move to the dominant; the relative minor works as a substitute for the tonic. A uniform random choice throws all of that away, and what comes out is recognisably a computer: every chord is plausible, and no sequence of them goes anywhere.

So the chords here come from a weighted transition table — an ordinary Markov chain, but with the weights written to match functional harmony rather than filled in evenly. From the dominant, the tonic is five times as likely as anything else. From the tonic, five different moves are all reasonable. On top of that sits cadence pressure: once the harmony has been away from home for longer than the mood allows, the table is overruled, the next chord is steered towards a dominant, and the one after that resolves. That single rule is most of the difference between music that wanders and music that breathes.

The melody follows the chord

Each bar, the generator decides on each sixteenth whether to place a note. Strong beats are more likely than weak ones, and strong beats prefer chord tones while weaker positions can use any note of the scale. The next note is usually a step from the last one, with an occasional leap, because a line made entirely of leaps sounds exactly like the random number generator it is. Rests are deliberately frequent: the ambient mood plays a note about once every eight beats, and the restraint is what makes it usable as background rather than as something you have to listen to.

Bass, voicing and drums

The bass follows the root of the chord, in a pattern chosen by the mood — a drone for ambient, root and fifth for lo-fi, a walking line for jazz. Chord voicings are chosen by voice leading: of all the inversions in a sensible register, the generator picks the one whose notes move the least from the previous chord, so the pad never jumps an octave between bars. Drums, where a mood has them, are sixteen-step patterns with probabilistic steps, so two passes through the same loop are never quite identical.

# The eight moods

MoodTempoScalesDrumsGood for
Lo-fi68–86minor, dorianlo-fi kitworking, reading, a stream
Study74–90major, dorianbrushesrevision, deep work
Ambient50–64lydian, majornonesleep, meditation, writing
Drift60–76dorian, minorsoft pulselong focus sessions
Cinematic58–72minor, phrygiansoft pulsevideo beds, trailers
Jazz café96–132dorian, minorbrushesa room that needs noise
Piano & rain54–70major, minornonesleep, anxiety, rain sounds
Chiptune120–156major, mixolydianchip kitgame prototypes

A mood is a set of ranges, not a set of fixed values. Two lo-fi pieces are recognisably the same genre without being the same music: the tempo, the key, the scale, the chord rhythm and the harmonic path are all drawn fresh from the seed inside the bounds the mood sets.

# What the seed is for

Every decision the generator makes comes from one seeded pseudo-random number generator — a small function called mulberry32 that turns a number into an endless, repeatable stream of randomness. Feed it the same seed and it gives you the same stream, in the same order, forever. That is why the share link works, why the WAV export sounds like what you were listening to, and why you can write down a seven-digit number today and get the same piece back next year.

There are just over four billion seeds. If you hear something you want to keep, copy the link before you press NEW PIECE — you will not find it again by chance.

# Using the music

Nothing generated here is copyrighted by anyone, and none of it is watermarked. Use it in a video, a podcast, a Twitch stream, a game, a shop, a waiting room or a school project. You do not need to credit this page (though it is always welcome), you do not need a licence, and there is no rights-management system waiting to strike your upload — the audio was synthesised in your own browser from arithmetic, a few seconds ago.

For anything longer than a few minutes, export a WAV and loop it, or leave the tab open and record your system audio. For scoring to picture, take the MIDI instead: it arrives as four tracks — chords, melody, bass and drums on channel 10 — so you can swap in real instruments, stretch the tempo and edit the notes in any DAW.

# If it is not quite right

# The rest of the music tools

? Frequently asked questions
The basics
Is this really free, with no account?

Yes. There is no account, no email box, no credit balance, no trial and no paid tier. The page is static files; there is no server to run and nothing to meter. If you find it useful you can buy me a coffee, but nothing here is behind that.

Does the music ever repeat?

Not in any way you will notice. The generator does not loop a fixed passage — it composes each bar as it reaches it, and the harmonic path, the melody, the chord rhythm and the probabilistic drum steps are all drawn fresh. What recurs is the style: the same mood, key and tempo throughout a piece, which is exactly what makes it usable as background.

Press NEW PIECE for a new seed and everything changes — key, tempo, scale and all.

Is it AI?

No, and the distinction matters. There is no model here, no training data and no inference: the music comes from a chord transition table, a handful of probability rules and a seeded random number generator, all running in your browser. Nothing is sent anywhere, so nothing can be logged, and the first note plays instantly rather than after a render queue.

Does it work offline?

Once the page has loaded, yes — it needs no network at all. There is no service worker installed, so you do need to have loaded the page before you go offline, but after that you can disconnect and it will keep composing. Nothing about the music depends on being online.

Using it
Can I use this music in a YouTube video, stream or game?

Yes — commercially too. The audio is synthesised in your browser from arithmetic; there is no sample library behind it, no rights holder and no watermark, so there is nothing for a Content ID system to match. You do not need to credit this page, although a link is appreciated.

For a video, the practical route is a WAV export you loop, or a MIDI export you re-voice in a DAW so the music can follow the picture.

How do I get the same music back later?

Press COPY SHARE LINK. The link carries the seed along with the mood and your settings, so opening it anywhere — another browser, another machine, a year from now — plays exactly the same notes in the same order. You can also just note the seed number shown under Now playing and type it back in.

What is in the MIDI file?

A standard format-1 MIDI file with four tracks: chords, melody, bass and drums. Drums are on channel 10 with General MIDI note numbers, so they map correctly in any DAW. The tempo and a 4/4 time signature are written into the file, and the melodic tracks carry GM program changes matching the instruments you picked on the page — which your DAW will happily ignore in favour of whatever you load.

The export always starts at bar one of the current seed rather than wherever you happened to be listening.

Why does the WAV export take a few seconds?

It is rendering the music rather than recording it. The page rebuilds the entire synthesiser inside an OfflineAudioContext and renders faster than real time, which is why a 128-bar export does not take five minutes. Longer exports take proportionally longer and use more memory; if a very long render fails, export twice at 64 bars instead.

Can I use it to fall asleep?

That is what the sleep timer is for. Pick a length and the music fades out over the last twenty seconds and then stops properly, which is gentler than an abrupt cut and does not leave your laptop playing all night. Ambient and Piano & rain are the two moods built for it — no drums, no pulse, and a melody that only appears occasionally.

Phones will usually pause a browser tab when the screen locks, so for overnight use a laptop with the lid open, or export a long WAV and play that instead.

Under the hood
What is a seed, exactly?

A number between 1 and about 4.3 billion that initialises the random number generator. Every decision the composer makes — the key, the tempo, which chord comes next, where the melody puts its notes, which probabilistic drum steps fire — reads from that one stream. Same seed, same stream, same music. It is the reason a share link can promise something an AI generator cannot: not a similar piece, the identical one.

How does it avoid sounding random?

Three rules, mostly. Chords move by a table weighted towards real functional harmony rather than uniformly. Cadence pressure forces a resolution once the harmony has been away from the tonic too long, so the music arrives somewhere instead of wandering. And the melody prefers chord tones on strong beats and steps rather than leaps, which is what makes a line sound like a line.

Remove any one of them and it audibly falls apart — the first version of the cadence rule counted chord changes instead of bars, and the slow moods drifted twenty-two bars without ever coming home.

Does changing the tempo or the volume change the piece?

No. Tempo, the four layer levels, the reverb and the textures are playback settings: the notes are already decided, they just arrive faster, slower, louder or wetter. Melody density is the exception — it changes which notes get written, so moving it changes the music from that bar on. It is stored in the share link for exactly that reason.

Where do the sounds come from if there are no samples?

Every voice is two Web Audio oscillators through a filter with its own envelope — the standard subtractive synth layout. Drums are synthesised the same way: the kick is a sine wave whose pitch drops sharply, the snare is a filtered noise burst with a tuned triangle underneath, and the hats are six square waves through a bandpass. The reverb is a convolution against an impulse response generated on the fly, and the vinyl crackle is noise with pops baked into a looping buffer.

Is anything stored or sent anywhere?

Your settings are kept in this browser's local storage so the page opens the way you left it — that never leaves your machine. No audio, no seeds and no usage data are sent anywhere. The site uses privacy-friendly analytics that count page views without cookies or personal data.