Examples

Examples

Deployable demos. Each one shows one cluster of the engine that's hard to explain in isolation.

Each example is a zero-build app (an index.html plus a small TypeScript module) sitting under examples/ in the repo. Where a live, playable version is hosted on this docs site, it's marked live. The full vanilla source is on GitHub.

Snapshot blend
live

A slider drives a tension Parameter, and engine.blendSnapshots(calm, combat, t) interpolates two captured mix shapes every frame.

Slot machine

Streaming music, sidechain ducking under big wins, loudness normalize on load.

live version coming soon source on github ↗
Match-3 cascade

Concurrency limits and voice stealing as cascades stack. Watch the live voice count climb and then hold.

live version coming soon source on github ↗
FPS footsteps

Spatializer (3D) live-steered from pointer position via voice.spatializer.setPosition.

live version coming soon source on github ↗
Rhythm metronome

engine.scheduleAt for tightly-scheduled clicks plus live bus.meter() + voice.level() driving a VU meter.

live version coming soon source on github ↗
Music stinger → loop → tail

engine.loadMusic({ intro, loop, outro }). The stinger plays once, the loop body runs until told otherwise, and the outro fires at the next loop boundary so the track ends on the beat.

live version coming soon source on github ↗

Running locally

Examples import the workspace zvuk package straight from src/index.ts, and reference the same audio assets the docs site ships at docs/public/audio/. Serve from the repo root with any static server:

npx serve .
# then open http://localhost:3000/examples/snapshot-blend/