p5.js addon library · v3.0.0

p5.waves Examples

Each thumbnail is a live sketch. Click → full example for the code and full-size canvas.

Wave Lab →

All 34 waves. Morph, shift, wild mode. Try everything.

The Call

Three ways to call it. All three return a number.

Wave Shift

The wave changes automatically every few seconds. Smooth morph between random formulas. One flag, zero setup.

→ full example

Seed as Clock

A seed picks a wave formula. Change the seed over time and the wave switches automatically — no state, no timers.

Shape Controls

Amplitude = how tall. Frequency = how tight. Phase = how far shifted. Same formula, one parameter changes per row.

→ full example

Wild Mode

Left side: normal. Right side: mode: 'wild'. Adds wobble to frequency, phase, and amplitude at the same time.

→ full example

Flow Fields

Four samplers steer 100 particles. Each sampler uses a different wave. Swap the wave names and the whole flow pattern changes.

→ full example

Time is a Number

No built-in clock. Pass any number as t. Move the mouse to scrub through time. Freeze it, rewind it, speed it up.

→ full example

Color Field

Two waves sample across x and y to control hue and brightness. The result is a flowing color landscape.

→ full example

Morph Wave

Blend two wave formulas together. mix: 0 = pure A, mix: 1 = pure B. Animate it and the shape smoothly transforms.

→ full example

Wave Grid

One call fills a 2D grid. With threshold, each cell is on or off — a binary pattern that animates.

3D Wave Volume

Three samplers — one per axis — each shifting on its own cycle. Points near the surface glow.

→ full example