Beats in the Browser: Coding Music with JavaScript

Can your own heartbeat set the tempo for your music? See how JavaScript and the Web Bluetooth API can power a drum machine in the browser.

Beats in the Browser: Coding Music with JavaScript
#1about 7 minutes

The history and influence of Roland drum machines

Roland's TR-808 and TR-909 drum machines were commercial failures that later became iconic in hip hop and house music.

#2about 3 minutes

Creating basic sounds with the Web Audio API

The Web Audio API allows sound generation in the browser using an AudioContext and an oscillator node to create specific frequencies and waveforms.

#3about 3 minutes

Simplifying audio playback with Tone.js and WAV files

Instead of complex Web Audio API code, the Tone.js library provides a simple abstraction for loading and playing audio files like WAVs.

#4about 6 minutes

Triggering browser audio with the Web MIDI API

The Web MIDI API enables connecting hardware controllers to a web application by requesting access and listening for MIDI messages to trigger events.

#5about 7 minutes

Building a step sequencer using Tone.js for looping beats

Create a looping drum pattern by building a step sequencer that uses the Tone.js transport scheduler to repeatedly trigger sounds based on user input.

#6about 4 minutes

Using the Web Bluetooth API to control music tempo

The Web Bluetooth API can connect to low-energy devices like a heart rate monitor to dynamically control application parameters, such as music tempo.

#7about 2 minutes

Combining a drum machine with karaoke for a live performance

A live demonstration showcases the creative possibilities of browser-based music tools by combining the custom drum machine with a karaoke performance.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

Related Articles

View all articles
Daniel Cranney, Chris Heilmann
Dev Digest 215: Agent Memory, JS2026, Googlebot Analysis & Canvas❤️HTML
Inside last week’s Dev Digest 215 . 🗿 Make AI talk like a caveman 🧠 A guide to context engineering for LLMs 🤖 Simon Willison on agentic engineering 🔐 Axios supply chain attack post mortem 🛡️ Designing AI agents to resist prompt injection 🎨 HTML in c...
Dev Digest 215: Agent Memory, JS2026, Googlebot Analysis & Canvas❤️HTML
Daniel Cranney
HTML Media Elements and How to Use Them: <video> and <audio>
If you’ve read the WeAreDevelopers Magazine before, you’ll know we’re vocal supporters of the web platform, and of sharing the power of native HTML elements. This time, we’re taking a closer look at media elements like <video> and <audio>, and how to...
HTML Media Elements and How to Use Them: <video> and <audio>
Daniel Cranney
Dev Digest 198: 30 years of JS, In-Browser AI, How Attackers Abuse GenAI
Inside last week’s Dev Digest 198 . 🎂 30 years of JavaScript ⏰ How long is a JavaScript second 💻 Clean code in Angular 🤦‍♂️ AI makes different mistakes than humans 👨‍💻 In-browser and offline AI 🟠 Undocumented Hacker News features 🐋 DeepSeek censored...
Dev Digest 198: 30 years of JS, In-Browser AI, How Attackers Abuse GenAI
Daniel Cranney
Dev Digest 184: Happy Agents, Vibe Hacking & You Don't Need JavaScript!
Inside last week’s Dev Digest 184 . 😀 “Agents for the sake of Happiness” Keynote video of the WeAreDevelopers World Congress 😅 Is AI sycophancy a “dark pattern”? 🤖 Claude Code AI best practices 🦠 AgentHopper - the first AI Virus ⚡ Hidden prompt gave...
Dev Digest 184: Happy Agents, Vibe Hacking & You Don't Need JavaScript!

From learning to earning

Jobs that call for the skills explored in this talk.