VANILLAJS

MAKE SOMETHING YOU CAN HEAR

Soundtrack Lab

Turn a small mathematical pattern into a game cue. Pick a starting sound, shape it, then take the WAV into your game.

1. Shape your sound

Pitch palette · integer Hz

The pattern chooses a position in this five-note palette.

Pattern source

E8 mode reads one coordinate of each visited root and maps −1, −½, 0, ½, 1 to palette positions 1–5. Three-state mode cycles through positions 1–3.

2. Listen and export

Preparing cue…

WAV works in audio players and game tools. A recipe restores all settings here. A game score contains the frames and events accepted by createSound2D.

Source and note events
StepSourcePitchSample

3. Put it in a game

For looping four-channel scores, tick-synchronised playback and pause/resume, try SubHunt Lab and the soundtrack module guide.

Use the WAV as a short menu, victory or checkpoint cue. To render a game score in code, pass its frames and events to createSound2D. Keep playback behind a player action and stop it on pause.

Follow the game-building guide →