‹ pakt05pakt07 ›

pakt06


pact06redqueen, 01:00, 1.84MB

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

//pakt06
//ok
let n;
let w, h;
let theta, speed, spread;
let pnts= [];
function setup() {
  let div= select('#sketch');
  let cnv= createCanvas(div.width, div.height);
  cnv.parent('sketch');
  noFill();
  strokeWeight(1);
  n= 50;
  theta= 0;
  speed= 0.00002;
  spread= 1;
  for(let i= 0; i<n; i++) {
    pnts[i]= [];
    pnts[i][0]= width*0.5;
    pnts[i][1]= height*0.5;
  }
  w= width;
  h= height;
  //stroke(255, 0, 0);
  //fill(255, 255, 255);
  stroke(255, 255, 255);
  fill(255, 0, 0);
}
function draw() {
  background(0);
  for(let i= 0; i<n; i++) {
    let x= (pnts[i][0]/w)*2-1;
    let y= (pnts[i][1]/h)*2-1;
    let vx= (((cos(theta)*x)-(sin(theta)*y))*0.5+0.5)*w+spread;
    let vy= (((cos(theta)*y)+(sin(theta)*x))*0.5+0.5)*h+spread;
    pnts[i][0]= vx;
    pnts[i][1]= vy;
    ellipse(vx, vy, 50*2, 50*2);
    theta= theta+speed;
  }
}
Ndef(\redqueen).play
(
Ndef(\redqueen, {GVerb.ar(LeakDC.ar(SinOsc.ar(SinOsc.ar([1/16, 1/12], 0, 5), SinOsc.ar(0, SinOsc.ar([SinOsc.ar(3, 0, 5, 12), SinOsc.ar(4, 0, 4, 16)], SinOsc.ar([SinOsc.ar(1/64, SinOsc.ar(0.5, 0, pi)).exprange(1, 30), SinOsc.ar(1/48, SinOsc.ar(0.75, 0, pi)).exprange(1, 30)], SinOsc.ar(SinOsc.ar(1/32, 0, 4), 0, 2pi), SinOsc.ar([1/6, 1/8], 0, 0.5pi, 2pi)), SinOsc.ar([1/3, 2/3], 0, 0.5pi, SinOsc.ar(1/8, 0, 0.5pi, 2pi))), SinOsc.ar([4/3, 3/4], 0, 0.5pi, SinOsc.ar([SinOsc.ar(1/256).exprange(80, 800), SinOsc.ar(1/256).exprange(80.8, 808)], 0, 0.5pi, 2pi)))))*0.05, 10, 3, 0.5, 0.5)});
)
Ndef(\redqueen).stop