‹ pakt07pakt09 ›

pakt08


pact08redqueen3, 01:00, 1.84MB

Built with p5.js and SuperCollider. See /f0blog/pact-februari/

//pakt08 not the exact correct filling rule
let n;
let d, speed, spread, theta;
let pnts= [];
function setup() {
  let div= select('#sketch');
  let 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++) {
    let c= cos(theta+(i*d));
    let s= sin(theta+(i*d));
    let x= (pnts[i][0]/width)*2-1;
    let y= (pnts[i][1]/height)*2-1;
    let vx= (((c*x)-(s*y))*0.5+0.5)*width+spread;
    let 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