home/ atoms/ p5-noise-hydra-noize-name-clash

p5.js claims the name noise() so Hydra's noise function must be called noize() inside P5LIVE

Both p5.js and Hydra expose a noise function. In P5LIVE’s sandbox, p5.js defines noise() as its Perlin noise implementation. Hydra’s noise function is therefore exposed as noize() (with a z) to avoid the name collision. Calling noise() in a P5LIVE sketch that also uses Hydra will return p5’s Perlin value, not the Hydra visual noise texture. This is a silent semantic bug: no exception is thrown, but the wrong function is called.

Examples

noise(x, y) in P5LIVE → p5 Perlin value (0..1). noize(scale, offset) → Hydra’s visual noise texture passed via HY5.

Assessment

In a P5LIVE sketch running alongside Hydra, why does noise(4) and noize(4) produce different results? When should each be used?

“Use **`noize()`** for Hydra's noise; `noise()` is”
context/ · L5-debug/p5live.md · chunk 1