Noise & Random#
Cheap, deterministic, seedable randomness — the hand-drawn wobble on balloons and the meander on rivers all come from here. Because everything is seeded, a given seed always redraws the exact same shape, which is what makes sketches reproducible.
H.noise(seed)#
Returns a 1D value-noise function. Call it with a coordinate to get a smooth
value in [-1, 1]. Nearby inputs give nearby outputs (unlike random),
which is what makes it read as organic jitter rather than static.
H.noise2D(seed)#
The 2D counterpart — a value in [-1, 1] that varies smoothly across the
plane. This is the field H.river.flow walks.
H.random(seed)#
A seeded PRNG (mulberry32). Returns a function you call with no arguments for
the next float in [0, 1). Unlike noise, successive values are
uncorrelated — use it for shuffles and discrete choices.
Why seeded?#
All of humument's wobble/meander/shuffle is driven by these three, so
passing the same seed to selectChunks,
balloon, or
channel reproduces the identical result —
essential for iterating on a composition, saving a sketch, or rendering the same
frame twice.