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.
WebAssembly music engine
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.
Length uses MM:SS, for example 02:30. The link remembers the seed, style, and mood.
A seed and a profile always produce the same notes. Give each level its own seed and every player hears the same soundtrack.
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.
Every beat, bar, and section change is reported to your code, so lights, enemies, and camera shakes can land on the beat.
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.
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.
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