home/ atoms/ punctual-wrong-domain-yields-zero

Using an audio-only function in a visual context (or vice versa) in Punctual silently returns 0 rather than an error

Punctual is an audio-visual unified language but many functions are domain-specific. Audio-only functions (lpf, hpf, bpf, delay, rnd, audioin) yield constant 0 when used in a visual (>> rgb) context, causing a black output with no warning. Conversely, graphics-only functions (fx, fy, fr, circle, fb, time, spin) yield 0 in an audio (>> audio) context, causing silence. This silent failure makes debugging harder: the program runs without error but does nothing visible or audible. Additionally, coherent spatial noise functions (Perlin/simplex) are not implemented in WebGL — rnd is audio white-noise only, not a spatial noise field.

Examples

lpf 1000 1 (osc 220) >> rgb; — outputs black (lpf is audio-only). circle [0,0] 0.3 >> audio; — outputs silence (circle is graphics-only).

Assessment

A Punctual program outputs a black screen despite containing lpf 500 0.5 (osc 2) >> rgb;. Explain the bug and rewrite to produce a visible result driven by a slow oscillator.

“**Wrong-domain functions return constant 0, not an error.**”
context/ · L1-instruments/punctual/gotchas.md · chunk 1