about

Pass a number in, get a number back. vanilla.waves has 35 wave formulas you can use for motion, colour, shape or pattern, plus a DOM engine for HTML elements.

The math

vanilla.waves is the plain-DOM sibling of p5.waves. Look at the p5.waves source: wave(), createSampler(), the 35 formulas, the seeded shift/morph engine - all of it is pure Math.*. The only p5 touchpoint is an 8-line prototype hook at the very bottom of the file.

The port keeps the p5.waves math and exposes it through VanillaWaves. Its DOM engine can use those values to update loaders, backgrounds, text fields or meters.

Lineage. p5.waves → p5 / canvas  ·  processing.waves → Java / Processing  ·  vanilla.waves → plain DOM, zero deps. Same dialect, different runtime - processing.waves is the precedent for "same language, maintained apart."

What the port preserves

The source is JavaScript, so the port keeps the original math rather than translating the formulas. These are the parts it preserves:

Parity checks

The comparison recorded on 2026-07-16 checked the port against p5.waves v3.6.0. The current check-parity.mjs checks the generated bundles against waves-core.js, with 8,620 comparisons. These checks cover the tested inputs; they do not guarantee that future changes will agree.

MetricValue
Parity checks10,422 on 2026-07-16 (all 35 waves + morph, range, wild, samplers, shift)
Resultbit-identical - 10,422 / 10,422 pass
Baselinep5.waves v3.6.0 (commit 804f91e, 35 waves)
Drift watchDrift-watch procedure; runs while the Claude app is open

See waves.feature.md for the port-coverage and drift-watch changedoc.

35 shapes, four pools

Every wave has a character. The library splits them into four pools so you can lean into the one you want:

Choose a wave by name, let a seed choose from a group, blend two waves with mix, or enable shift to move between formulas at the interval you set.

The DOM engine

Where the components live

This repository contains the math and DOM engine. Components such as loaders, controls and draggables live in a separate package, vanilla.waves_elements, built on this engine.

License & credits

vanilla.waves is MIT, like its parent. The original p5.waves library lives at seb-prjcts-be/p5.waves. Bug reports, sketches built with the library, and pull requests are welcome on GitHub.

Maker

Contributors (wave formula dataset)