Projects › Advanced › Beat maker

Free online beat maker, and how to make your own

Press Play, pick a style, then tap the squares to make it yours. 808s, chords, hi-hat rolls and three drum kits, with no sign-up. Download it as a WAV or MIDI file, then build your own beat maker with a free AI assistant.

Medium 1 to 2 hours Free · nothing to install Works offline
Tempo
140BPM
Start from
Drums
Melody

Tap a square to add a sound, tap again for an accent (hi-hats roll), and once more to remove it. Drag to paint. The chords and 808 follow the chord progression, so they always fit. Press Space to play or stop. Everything is made by code in your browser and saves here only.

Watch it come together, start to finish
What you'll build

Your own drum machine, built in stages

This is an advanced project, built in six stages, but you still won't write any code. You'll describe each part to a free AI assistant, paste what it writes into a file, and listen.

  • A 16-step beat maker that opens in any web browser and works offline
  • Six drums made with code (kick, snare, clap, hi-hat, open hat, perc) in three kits: 808, 909 and lo-fi
  • A chord row and an 808 bass that follow a four-chord progression, so the beat changes every bar and always sounds in key
  • A melody row of eight notes from a scale where every combination sounds good
  • Accents, and hi-hat rolls for trap beats
  • A big Play button, the space bar, tempo with tap tempo, swing and volume
  • Seven genre presets, "Surprise me", undo, share links, and WAV and MIDI download

Good for: anyone who's made a Starter project and wants a bigger challenge, music fans who want a beat maker with no account or paid sounds, and teachers mixing music, maths and code.

Before you start

What you need

An AI chat assistantClaude, ChatGPT or Gemini. The free versions work. A long project like this can hit a free plan's daily limit, so if you're cut off, carry on tomorrow: your file is saved.
A text editorNotepad or TextEdit (in plain text mode) is fine. If you'd like line numbers and colours, try the free VS Code.
Headphones or speakersLaptop speakers can't play deep 808 bass, so headphones help.
New to saving files like this? Read How to save and open an HTML file first. It takes two minutes.
Before you start

The trick to bigger builds

Big projects go wrong when you ask for everything at once. The AI tries to do too much, something breaks, and it's hard to tell what. So this guide builds the beat maker in stages. After each stage, check it works and save a copy (beats-v1.html, beats-v2.html and so on). If a change goes badly, open the last good copy, paste it back into the chat and say "Let's go back to this version."

Step by step

Build it in six steps

  1. Ask for the grid, the drums and a big Play button

    Copy this prompt
    I don't know how to code. Please make me a beat maker (a step sequencer drum machine) that runs in a web browser.
    
    Requirements:
    - Everything in ONE single HTML file (HTML, CSS and JavaScript together), so I can save it and double-click it.
    - No external libraries, no sound files, no internet connection needed. Make every sound with the Web Audio API.
    - A grid with 6 rows and 16 columns: Kick, Snare, Clap, Hi-hat, Open hat and Perc. Clicking a square turns it on or off.
    - A big, obvious Play / Stop button at the top. When playing, a playhead moves along the 16 steps and plays every sound switched on in that column, then loops.
    - The space bar also plays and stops. Use preventDefault so the page never scrolls when I press it, and don't let it trigger twice if the Play button has focus.
    - Make the drums sound good: an 808-style kick (a sine wave that drops quickly in pitch, slightly distorted), a snare of filtered noise plus a short tone, a clap of three quick noise bursts, and hi-hats made from six square waves at clashing pitches through a high-pass filter, like a real 808. A closed hi-hat cuts off the open hi-hat.
    - Use accurate timing: schedule the sounds a little ahead with the audio clock (audioContext.currentTime), not setTimeout alone, so the beat doesn't wobble.
    - A dark background, rounded squares, each row its own bright colour.
    
    Please give me the complete file in one code block, then tell me in simple steps how to save and open it.

    Save it as beats.html and double-click it. Press Play, then click some squares. A good first beat: Kick on steps 1, 8 and 11, Snare and Clap on step 9, Hi-hat on every other step. That's the start of a trap beat.

    No sound? Browsers only allow sound after you click something on the page, so press Play first. Check your volume, then tell the AI exactly what happens.
  2. Tempo, swing, accents and rolls

    Copy this prompt
    That works, thank you. Now please add:
    - A tempo display from 60 to 180 BPM with − and + buttons, plus a "Tap" button: tap it in time and it sets the tempo.
    - A swing slider from 0% to 60% that delays every second step a little, for a hip hop bounce, and a volume slider.
    - Tapping a square cycles it: off, on, accent (louder, shown brighter with a dot), then off again. On the hi-hat row, an accent plays a quick roll of three hits instead, for trap beats.
    - Click and drag across the grid to paint the same value onto lots of squares. It must work with a finger on a phone too.
    - Clicking a row's name plays that sound once.
    - The playhead column glows, squares flash when they play, and the Play button pulses on every beat.
    
    Send me the whole updated file, not just the changed parts.
    Always ask for the whole file. Then you replace everything, save, and refresh the browser tab (F5, or Cmd+R on a Mac).
  3. Add chords and an 808 bass

    This is the step that makes it sound like real music.

    Copy this prompt
    Please add a "Chords & bass" section under the drums with two rows:
    - Chords: each square that's on plays a chord, held until the next square in that row or the end of the bar.
    - 808 bass: each square plays a deep, slightly distorted sine wave bass on the root note of the current chord, with a quick pitch drop at the start, also held until the next hit.
    
    The chords come from a four-chord progression that moves on one chord every time the 16 steps loop, so the beat changes every bar. Add a menu with these progressions, all in A minor:
    - Moody: Am, F, C, G
    - Dreamy: Fmaj7, Em7, Dm7, Am7
    - Dark: Am, Dm, F, E
    - Uplifting: F, G, Am, C
    - One chord: Am
    
    Show the four chord names in a strip above the grid and light up the one that's playing. Give the chords two sounds to choose from: Keys (an electric piano using a little FM synthesis) and Pad (detuned sawtooth waves through a low-pass filter, with a slow fade in). Each time the kick plays, briefly turn the chords and bass down (a sidechain "pump"). Send me the complete updated file.
  4. Add a melody, drum kits and a polished sound

    Copy this prompt
    Please add:
    - A Melody section: 8 more rows, one for each note of the A minor pentatonic scale, highest at the top (A5, G5, E5, D5, C5, A4, G4, E4). Every combination sounds good over the chords. Three sounds to choose from: Pluck (detuned sawtooths with a closing filter), Bell (FM synthesis) and Lead (square and sawtooth with vibrato). Send the melody through an echo timed to the tempo.
    - Three drum kits: 808 (long boomy kick, cowbell perc), 909 (punchy kick, brighter hats, rim shot perc) and Lo-fi (soft kick, a gentle low-pass filter over everything and quiet vinyl crackle).
    - A reverb made with a ConvolverNode and an impulse generated from decaying noise, for the snare, clap, chords and melody.
    - A compressor on the final output, then a soft limiter (a tanh curve on a WaveShaperNode) so the sound never crackles or clips.
    
    Send me the complete updated file.
  5. Presets, "Surprise me", undo and saving

    Copy this prompt
    Please add:
    - Seven preset buttons that load a complete beat (drums, chords, bass and melody) with its own tempo, swing, kit, progression and sounds: Trap (140 BPM, 808, hi-hat rolls, Dark chords), Boom bap (90 BPM, swung, Lo-fi kit), Lo-fi (78 BPM, lots of swing, Dreamy chords), House (124 BPM, 909, offbeat open hats), Afrobeats (104 BPM), Reggaeton (95 BPM, the dembow rhythm) and Synthwave (108 BPM, Pad chords, Lead melody). Pressing one starts it playing.
    - A "Surprise me" button: pick a genre, keep its groove, change a few drum hits, and write a new short melody that moves up and down the scale.
    - An Undo button (and Ctrl+Z or Cmd+Z) that steps back through my changes, and a Clear button.
    - Save the beat in the browser (localStorage) so it's still there when I come back.
    
    Send me the complete updated file.
  6. A visualiser, share links and downloads

    This is the part that makes people say "how did you make that?"

    Copy this prompt
    Please add:
    - A visualiser behind the chord strip: bars drawn on a canvas that jump with the music, using an AnalyserNode, coloured from pink to green, sharp on high-resolution screens.
    - "Share link": pack the whole beat (every square, tempo, swing, kit, progression and sounds) into a short code at the end of the page address after #beat=, and copy the link. When someone opens a link like that, load that beat.
    - "Download WAV": render four bars (once through the chords) with an OfflineAudioContext using exactly the same sound code, and save it as my-beat.wav.
    - "Download MIDI": save the same four bars as a standard MIDI file, drums on channel 10 using General MIDI drum notes, so I can open it in GarageBand, FL Studio or Ableton.
    - Lay it all out like a polished music app that still fits on a phone screen.
    
    Send me the complete updated file.

    Share links only work for other people once your beat maker is online. See Putting your project online for free.

ADVERTISEMENT · IN-ARTICLE
If it goes wrong

Quick fixes

The beat drifts or stutters

The timing is being done with setTimeout. Ask: "The timing drifts. Please use a look-ahead scheduler: every 25 milliseconds, schedule any notes due in the next 100 milliseconds using audioContext.currentTime."

It crackles or distorts when lots of sounds play at once

Ask the AI to "lower the volume of each sound and put a DynamicsCompressorNode on the master output".

Pressing the space bar scrolls the page

Ask: "When I press Space the page scrolls. Please listen for Space on the whole window in the capture phase, call preventDefault, and ignore it only when I'm typing in a text box."

Dragging on a phone scrolls the page instead of painting squares

Ask:

Copy this prompt
On my phone, dragging across the grid scrolls the page instead of switching squares on. Please use pointer events, set touch-action: none on the grid, and use document.elementFromPoint to find which square my finger is over while it moves. Send me the complete fixed file.
Sound works on my computer but not my phone

On iPhones the mute switch also silences web pages. Flip it, and make sure Play is the first thing you tap.

I can't hear the 808

Small speakers can't play very low notes. Use headphones, or ask the AI to "add more distortion to the 808 so its harmonics come through on phone speakers".

The page is blank

The AI's reply was probably cut off. Scroll to the bottom of its code: it should end with </html>. If not, ask: "Your code was cut off. Please send the complete file again." For a long file, you can ask it to "send the file in two parts and tell me exactly where to join them".

You want to see the error the browser is hiding

Press F12 (or Cmd+Option+I on a Mac), click the Console tab and copy any red text into the chat.

Make it your own

Twist it into something else

Once the engine works, it can become all sorts of things:

Your own sounds

Ask for a "Record" button on each row so you can record a sound with your microphone (a clap, a pan, your dog) and use it as a drum.

More steps

Switch between 16 and 32 steps, with a second pattern you can chain after the first.

Your own chords

Let me pick any chord for each bar from a menu, in any key.

Song mode

Save patterns A, B, C and D, then line them up into a whole song.

Keyboard jam

Play the melody notes live on your computer keyboard over the top of the loop.

Classroom rhythm game

The computer plays a beat and the player has to copy it on the grid to score points.

Made a beat you're proud of? Share the link and tag us. We feature reader projects.

Why build it yourself?

Sound from numbers, in perfect time

There are plenty of free beat makers online, but building one teaches you the thing behind all of them: making sound from numbers and keeping perfect time. It's also proof that you can build something genuinely complex by asking for it one stage at a time. That habit is what turns a first project into a hobby.

Keep going

What to build next