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 — 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

Slider drives a tension Parameter — engine.blendSnapshots(calm, combat, t) interpolates two captured mix shapes per frame.

Slot machine

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

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

Concurrency limits + voice stealing as cascades stack — watch the live voice count climb.

live: coming soon source on github ↗
FPS footsteps

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

live: coming soon source on github ↗
Rhythm metronome

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

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

engine.loadMusic({ intro, loop, outro }) — stinger plays once, loop body runs forever, outro fires at the next loop boundary so the music ends musically.

live: 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/