home/ atoms/ custom-shaping-function-radius

A custom pow(sin(x),n) shaping function replaces noise() to give a smooth periodic radius variation with a distinctive character

Instead of driving a circle’s radius with Processing’s built-in noise(), a hand-written shaping function can supply the variation. In ch4_1_4_CustomNoise a customNoise(value) returning pow(sin(value), 3) is fed a smoothly-advancing counter (noiseVal += 0.1) and multiplied into the radius before each polar point is emitted with curveVertex(), producing a smooth, periodic, deterministic bump pattern around the ring — sharper-peaked than a plain sine because of the cubing. Because the input advances continuously, successive samples are correlated (smooth), unlike an independent random draw. CustomNoise2 makes the exponent itself vary with a modulo counter (count = int(value % 12)), so the wave changes character cyclically across the ring. The lesson: any smooth function of a running counter is a usable ‘noise’ source for shaping geometry, and its exponent/shape controls the aesthetic.

Examples

ch4_1_4_CustomNoise.pde: float customNoise(float value){ float retValue = pow(sin(value), 3); return retValue; }, called with radVariance = 60 * customNoise(noiseVal) while noiseVal += 0.1 per angle step. ch4_1_4_CustomNoise2.pde: int count = int((value % 12)); retValue = pow(sin(value), count); cycles the exponent.

Assessment

Explain why feeding pow(sin(value),3) a slowly-advancing counter gives a smooth curve while pow(random(1),3) does not. Then predict how CustomNoise2’s contour changes as its modulo counter cycles the exponent from low to high.

“float customNoise(float value) { float retValue = pow(sin(value), 3); return retValue; }”
corpus · generative-art-code-examples-josephfiola-genart-processing-p · chunk 44
“float customNoise(float value) { int count = int((value % 12)); float retValue = pow(sin(value), count); return retValue; }”
corpus · generative-art-code-examples-josephfiola-genart-processing-p · chunk 45