home/ atoms/ punctual-combinatorial-vs-pairwise

Punctual's [...] list is combinatorial (channel-count product) while {...} is pairwise; using [...] where {...} is intended silently multiplies channels

Punctual has two multi-value constructors with very different semantics. Square brackets […] produce a combinatorial (Cartesian product) expansion: [1,2] + [10,20] yields 4 channels: [11,21,12,22]. Curly braces {…} produce pairwise element-wise operation: {1,2} + {10,20} yields 2 channels: [11,22]. The gotcha is that circle [x1,x2] [d1,d2] draws 4 circles (all x vs all d combinations), not 2. Pairwise constructs (or :-suffixed ops) are needed to pair them. Unexpected channel multiplication silently changes audio panning or video layer routing. Ranges cap at 64 values — [0..100] truncates silently.

Examples

circle [0,0.5] [0.2,0.3] >> rgb; — draws 4 circles (combinatorial). {1,2} + {10,20} — pairwise yields [11,22].

Assessment

Predict how many channels result from [1,2,3] + [10,20] in Punctual. Then rewrite it to produce only 2 channels using pairwise arithmetic.

“`[...]` is combinatorial, `{...}` is pairwise.”
context/ · L1-instruments/punctual/gotchas.md · chunk 1