WebAssembly music engine

Endless music from a single number.

AlgoWASM composes and plays a full track in your browser, live, from one seed. No samples, no dependencies, and the same seed always plays the same song.

Player

Section
intro
Bar
0
Tempo
-
Time
00:00 / 02:00
Press Play to load the engine.
Style
Mood

Length uses MM:SS, for example 02:30. The link remembers the seed, style, and mood.

Built for games and interactive pages

The same song every time

A seed and a profile always produce the same notes. Give each level its own seed and every player hears the same soundtrack.

Music that follows the action

Turn energy and intensity up as things heat up, change the mood, or mute a track. The music responds without a pause or a reload.

Beat-accurate events

Every beat, bar, and section change is reported to your code, so lights, enemies, and camera shakes can land on the beat.

Nothing to download but the engine

Every sound is synthesised live. There are no audio files to licence, host, or stream, and the whole engine is smaller than one short sample.

Three steps to music

import { AlgoWasmPlayer, builtInProfiles } from '@algo-wasm/algo-wasm';

const player = await AlgoWasmPlayer.create({
  wasmUrl: '/algo_wasm.wasm',
  workletUrl: '/algo-worklet.js',
  profile: builtInProfiles.dubstep(),
  seed: 1995n
});

// Browsers only allow audio after a click, tap, or key press.
button.addEventListener('click', () => player.start());

player.on('beat', event => flashTheLights(event.beat));
player.setEnergy(0.9);

Making a game? The game guide shows complete set-ups for LittleJS and three.js.

Like what you hear?

AlgoWASM is free and open source. A star on GitHub costs nothing, helps other developers find it, and tells us it is worth improving.

Star AlgoWASM on GitHub