pakt08
Built with p5.js and SuperCollider. See /f0blog/pact-februari/
//pakt08 not the exact correct filling rule
let n
let d, speed, spread, theta
const pnts = []
function setup() {
const div = select('#sketch')
const cnv = createCanvas(div.width, div.height)
cnv.parent('sketch')
frameRate(60)
n = 25
d = 0.0001
speed = 0.00002
spread = 2
theta = 0
for (let i = 0; i < n; i++) {
pnts[i] = []
pnts[i][0] = width * 0.5
pnts[i][1] = height * 0.5
}
fill(255, 0, 0)
blendMode(DIFFERENCE)
noStroke()
}
function draw() {
clear()
background(0)
let xx = width * 0.5,
yy = height * 0.5
beginShape()
for (let i = 0; i < n; i++) {
const c = cos(theta + i * d)
const s = sin(theta + i * d)
const x = (pnts[i][0] / width) * 2 - 1
const y = (pnts[i][1] / height) * 2 - 1
const vx = ((c * x - s * y) * 0.5 + 0.5) * width + spread
const vy = ((c * y + s * x) * 0.5 + 0.5) * height + spread
pnts[i][0] = vx
pnts[i][1] = vy
vertex(xx, yy)
xx = vx
yy = vy
theta = theta + speed
}
endShape()
}
Ndef(\redqueen3).play
(
Ndef(\redqueen3, {GVerb.ar(LeakDC.ar(
Saw.ar(
Saw.ar([100, 101]+Saw.ar([102, 103], Saw.ar([4, 5], Saw.ar([1, 2], 6, 7).sum).sum).sum).exprange(Saw.ar(1/12, 4, 50), Saw.ar(1/8, 3, Saw.ar(1/16, 4, 65))),
Saw.ar([21, 20], Saw.ar([40, 41], 0, 0.1), 0.2)
)), 60, 4, 0.5, 0.5, 5, 0.5, 0.5, 0.75)});
)
Ndef(\redqueen3).stop