Endless Music Generator — Free Lofi, Ambient and Study Music in Your Browser
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.
Guide — endless background music in one click
Hit ▶ PLAY or Space. It writes music bar by bar and does not stop until you do.
Tap a mood or press 1–8. Changing mood starts a new piece.
Mute or swap instruments per layer, then set tempo, melody density, space, vinyl, wobble and rain.
COPY SHARE LINK or C saves the piece as a link that plays the same notes anywhere.
Export 16 to 128 bars as a WAV, or as MIDI to re-voice in a DAW.
What is in here
A mood is a set of ranges: tempo, scales, instruments, drums and bass style. Each seed picks its own key, tempo and harmonic path inside those bounds.
- Lo-fi · Study
- Rhodes and vinyl · steady, mid-tempo, brushed kit
- Ambient · Drift
- No drums, long pads · a soft pulse and wide reverb
- Cinematic
- Strings and piano in a big room
- Jazz café
- Swung sevenths, walking bass, brushes
- Rain · Chip
- Solo piano and rain · square waves and arpeggios
Each layer has a mute and a level. The mood picks the instruments, but you can swap any of them from the menu.
- Chords · Melody
- Rhodes, electric piano, piano, soft pad, strings, organ, glass, bell, marimba, nylon guitar, square wave, pulse lead
- Bass
- Sub, upright, electric, synth or square bass
- Drums
- Kit set by the mood, or none at all
- ALL ON
- Unmute everything in one go
Tempo, levels and textures change how the notes arrive, not which notes are written, so you never lose your place. Melody density is the exception.
- Tempo
- 40–170 BPM, independent of the piece
- Density
- 0–200% melody notes; part of the piece
- Space
- Convolution reverb amount
- Textures
- Vinyl crackle, tape wobble, rain
One seeded random number generator makes every decision. Same seed, same music, note for note, on any machine and in any browser.
- PLAY THIS SEED
- Type a seed number and hear its piece
- SHARE LINK
- Seed, mood and settings in one URL
- NEW PIECE
- A fresh seed, N
- SKIP
- Move the harmony on now, S
Exports restart from bar one of the current seed, so you get the start of what you are hearing. Nothing is watermarked.
- Length
- 16, 32, 64 or 128 bars
- WAV
- Rendered offline, faster than real time
- MIDI
- Four tracks: chords, melody, bass, drums on channel 10
Fullscreen keeps just the now-playing display and transport on screen. The sleep timer fades out gently instead of cutting off.
- Sleep
- 10 to 90 minutes, 20-second fade, then a real stop
- F
- Fullscreen now-playing view
- ↑ ↓
- Volume
A free endless music generator for lofi, ambient and study music
An endless music generator writes music while you listen to it. This one runs entirely in your browser tab. It picks a key, walks a chord progression, draws a melody over each chord and plays the result on a synthesiser built from Web Audio oscillators, a new bar every few seconds, until you close the tab. Use it as a lofi music generator, study music for deep work, an ambient generator for sleep, or royalty-free background music for a video, stream or game.
It is free: no account, no email, no credit balance, no trial and no paid tier. The page is static files, so there is no server to run and nothing to meter. If you find it useful you can buy me a coffee, but nothing is behind that.
Algorithmic, not AI
Most music generators today are machine-learning services: you type a prompt, a server renders audio, and you get a file after an account, credits and a wait. Those tools can do things this one cannot, such as a full arrangement with vocals from a sentence. This is the older idea, and for background music it is the better one. There is no model, no training data and no inference, just a chord transition table, a handful of probability rules and a seeded random number generator. Music from explicit rules can be endless, instant, free and reproducible at the same time: there is no cost per minute, the first bar plays the moment you press play, and a single seed brings the same piece back.
Does the music ever repeat?
Not in a way you will notice. It does not loop a fixed passage. Each bar is composed as it is reached, and the harmonic path, melody, chord rhythm and probabilistic drum steps are drawn fresh. What stays the same is the style: one mood, key and tempo for the whole piece, which is what makes it work as background. Press NEW PIECE for a new seed and everything changes.
How the music is put together
Harmony that goes somewhere. Picking random chords from a key sounds wrong straight away, because music in a key pulls towards home. So the chords come from a weighted transition table, a Markov chain with weights written to match functional harmony: from the dominant, the tonic is five times as likely as anything else. On top sits cadence pressure: once the harmony has been away from home longer than the mood allows, it is steered to a dominant and then resolves. That rule is most of the difference between music that wanders and music that breathes.
A melody that follows the chord. On each sixteenth the generator decides whether to place a note. Strong beats are more likely and prefer chord tones; weaker positions can use any note of the scale. Most moves are a step from the last note, with the occasional leap, and rests are frequent on purpose. The ambient mood plays very few notes, and that restraint is what makes it usable as background.
Bass, voicing and drums. The bass follows the chord root in a pattern set by the mood: a drone for ambient and cinematic, root and fifth for lo-fi, a walking line for jazz, octaves for chiptune. Chords use voice leading: of all the inversions in a sensible register, the generator picks the one whose notes move least from the previous chord, so pads never jump an octave. Drums, where a mood has them, are sixteen-step patterns with probabilistic steps, so two passes are never quite identical.
The eight moods
- Lo-fi — 68–86 BPM, minor or dorian, lo-fi kit. Warm, slightly out of tune: Rhodes chords, a lazy melody and vinyl. Good for working, reading or a stream.
- Study — 74–90 BPM, major or dorian, brushed kit. Steady and mid-tempo, with nothing that pulls your attention off the page.
- Ambient — 50–64 BPM, lydian, major or dorian, no drums. Long overlapping pads and a melody that appears rarely. For sleep, meditation and writing.
- Drift — 60–76 BPM, dorian, minor or lydian, a soft pulse. Between ambient and lo-fi, with wide reverb, for long focus sessions.
- Cinematic — 58–72 BPM, minor, phrygian or major, a soft pulse. Strings and piano in a big room; good for video beds.
- Jazz café — 96–132 BPM, dorian, minor or major, brushes. Swung seventh chords and a walking bass; the busiest mood.
- Piano & rain — 54–70 BPM, major, minor or dorian, no drums. Solo piano and rain, the sparsest mood after ambient.
- Chiptune — 120–156 BPM, major, minor or mixolydian, chip kit. Plain triads, square waves and a busy arpeggio, for game prototypes.
Two lo-fi pieces are recognisably the same genre without being the same music: tempo, key, scale, chord rhythm and harmonic path are all drawn from the seed inside the mood's bounds.
What the seed is for
A seed is a number between 1 and about 4.3 billion that starts the random number generator, a small function called mulberry32. Every decision reads from that one stream: the key, the tempo, the next chord, where the melody puts its notes and which drum steps fire. Same seed, same stream, same music. That is why a share link gives you not a similar piece but the identical one, and why you can note a seed today and hear it again next year. COPY SHARE LINK also carries the mood and your settings, including melody density. If you hear something you like, copy the link before you press NEW PIECE; you will not find it again by chance.
Tempo, volume and density
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, so muting the melody and bringing it back does not lose your place. Melody density is the exception: it changes which notes get written, so it changes the music from that bar on and is stored in the share link.
If it is not quite right
- Too busy? Pull melody density down, or mute the melody and keep chords and bass. Ambient with the melody muted is close to a pure drone.
- Too static? Push density up, switch to jazz café, or press
SKIPto move the harmony on. - Wrong tempo? The tempo slider does not change the notes, only how fast they arrive.
- Too clean? Turn up vinyl crackle and tape wobble. Wobble is real pitch modulation, not an EQ curve.
Music to fall asleep to
Set the sleep timer to 10, 20, 30, 45, 60 or 90 minutes. The music fades out over the last twenty seconds and then stops properly, which is gentler than a hard cut and does not leave your laptop playing all night. Ambient and Piano & rain suit it best: no drums and only an occasional melody. Phones usually pause a browser tab when the screen locks, so for overnight listening use a laptop with the lid open, or export a long WAV and play that.
Use it in videos, streams and games
You can use the music commercially too. It is synthesised in your browser from arithmetic, with no sample library, no rights holder and no watermark behind it, so there is nothing for a Content ID system to match. You do not need to credit this page, though a link is welcome. For a video, export a WAV and loop it, or leave the tab open and record your system audio for longer stretches. For scoring to picture, take the MIDI.
WAV and MIDI export
Both exports start the piece again from bar one of the current seed, so you get the beginning of what you are hearing, not a recording from wherever you clicked. The WAV is rendered, not recorded: the page rebuilds the synthesiser in an OfflineAudioContext and renders faster than real time. Longer exports take longer and use more memory; if a very long render fails, export 64 bars twice. The MIDI is a standard format-1 file with four tracks — chords, melody, bass and drums on channel 10 with General MIDI note numbers — plus the tempo, a 4/4 time signature and program changes that match the instruments you picked.
Where the sounds come from
There are no samples or soundfonts. Every instrument is two Web Audio oscillators through a filter with its own envelope, the classic subtractive synth layout. Drums are synthesised the same way: a kick whose pitch drops sharply, a snare made of filtered noise over a tuned triangle, hats built from square waves or filtered noise. The reverb is a convolution against an impulse response generated on the fly, and the vinyl crackle is hiss with pops baked into a looping buffer.
Private, and it works offline
No audio, seeds or usage data are sent anywhere, because nothing is composed on a server. Your settings are kept in this browser's local storage so the page opens the way you left it, with a fresh seed. The site uses privacy-friendly analytics that count page views without cookies or personal data. Once the page has loaded it needs no network: there is no service worker, so load it before you go offline, then disconnect and it keeps composing.
Keyboard shortcuts
Space start and stop · N new piece · S skip to the next chord · 1–8 switch mood · ↑ ↓ volume · C copy the share link · F fullscreen, Esc to leave it.
More music tools
If you would rather play than listen, try the chord pad with drums, the virtual piano or the live loop pedal. Make beats in Drum Loop Studio and chiptune in the 8-Bit Studio, hear songs built on four chords in the 4 Chord Song Player, or keep calm with Focus Audio. Everything is listed on the music tools page.