home/ atoms/ p5live-noise-noize-clash

In P5LIVE with HY5 loaded, Hydra's noise() is aliased to noize() to avoid collision with p5's built-in noise()

Both p5.js and Hydra define a global function called noise(). When Hydra is loaded via HY5 or libs inside P5LIVE, the library aliases Hydra’s noise source to noize() so p5’s Perlin noise function remains accessible under its standard name. Writing noise() inside a // sandbox block will call p5’s Perlin function and produce a type error or wrong result. The correct call for a Hydra noise source in P5LIVE is noize(). This is a unique naming clash that only arises in the combined environment.

Examples

// sandbox\nnoize(4,0.1).out()\n// sandbox — correct. noise(4,0.1).out() — calls p5’s Perlin, type error.

Assessment

Explain why calling noise() inside a P5LIVE sandbox block may fail, and give the correct substitute function name.

“In a `// sandbox` write `noize()`, not `noise()`, for the Hydra source”
context/ · L1-instruments/p5live/gotchas.md · chunk 1