two createSampler() calls
Binary Field
A 2D pattern from two samplers. Each cell asks one question: is rowSampler(row) + colSampler(col) > 0? The library ships no grid wrapper. The nested loop is the recipe. With shift: true on both samplers, the field's character keeps evolving. Sometimes interference, sometimes stripes, sometimes checker. The label at the top names the current wave-pair.
Core snippet
const rowS = Waves.createSampler({
shift: true, shiftInterval: 4, shiftDuration: 1,
range: [-1, 1], seed: 1
});
const colS = Waves.createSampler({
shift: true, shiftInterval: 4.5, shiftDuration: 1.2,
range: [-1, 1], seed: 2
});
// In draw - sum, threshold, fill:
const t = millis() / 1000;
const offset = t * 0.4;
for (let row = 0; row < ROWS; row++) {
const rv = rowS.sample(row * 5 + offset, t);
for (let col = 0; col < COLS; col++) {
const cv = colS.sample(col * 2.5 - offset, t);
fill((rv + cv) > 0 ? 15 : 230);
rect(col * cw, row * ch, cw, ch);
}
}