Skip to content
Example project for dynamic webaudio music with hot-reloaded modules
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
docs
src
.gitignore
README.md
package-lock.json
package.json

README.md

webaudio-music

Example project for real-time dynamic webaudio music.


This is a baseline project demonstrating my setup for working with real-time procedural music in Web Audio. The main feature is that the musical logic is isolated into small modules that are hot-reloadable, so one can hack on the algorithms in realtime while the music plays.

Live demo ← what it sounds like out of the box.

Usage

This project is meant to be forked and modified, not used as a dependency.

# (clone the repo)
cd webaudio-music
npm install
npm start

Now view the demo at localhost:8080 or thereabouts, and start hacking.

Overview

The key moving parts are:

  • src/index: basic audio engine - does scheduling (bpm, look-ahead, etc), and manages an audio chain (master volume and compressor)
  • demo/lib/*: rigging to manage audio nodes, hot-reloading, etc.
  • demo/song/*: song modules that decide what notes to play

The song modules are the bits that get hot-reloaded, so they can be hacked on in realtime as the music plays.


Made with 🍺 by Andy Hall.

License is ISC.

You can’t perform that action at this time.