‹ pakt06pakt08 ›

pakt07


pact07redqueen2, 01:00, 1.84MB

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

//pakt07
let n;
let theta, speed, spread;
let pnts= [];
function setup() {
  let div= select('#sketch');
  let cnv= createCanvas(div.width, div.height);
  cnv.parent('sketch');
  frameRate(60);
  n= 30;
  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;
  }
  fill(255, 0, 0);
  blendMode(DIFFERENCE);
  noStroke();
}
function draw() {
  clear();
  background(0);
  for(let i= 0; i<n; i++) {
    let x= (pnts[i][0]/width)*2-1;
    let y= (pnts[i][1]/height)*2-1;
    let vx= (((cos(theta+(i*0.001))*x)-(sin(theta+(i*0.001))*y))*0.5+0.5)*width+spread;
    let vy= (((cos(theta+(i*0.001))*y)+(sin(theta+(i*0.001))*x))*0.5+0.5)*height+spread;
    pnts[i][0]= vx;
    pnts[i][1]= vy;
    ellipse(vx, vy, 50*2, 50*2);
    theta= theta+speed;
  }
}

Ndef(\redqueen2).play
(
Ndef(\redqueen2, {GVerb.ar(LeakDC.ar(
  SinOsc.ar(
    SinOsc.ar(
      SinOsc.ar(
        SinOsc.ar(
          SinOsc.ar(
            SinOsc.ar(
              SinOsc.ar(
                1,
                0,
                2,
                SinOsc.ar(1/2).exprange(1, 2)
              ),
              0,
              8,
              SinOsc.ar(1/4).exprange(4, 8)
            ),
            0,
            32,
            SinOsc.ar(1/8).exprange(16, 32)
          ),
          0,
          128,
          SinOsc.ar(1/16).exprange(64, 128)
        ),
        0,
        512,
        SinOsc.ar(1/32).exprange(256, 512)
      ),
      0,
      2048,
      SinOsc.ar(1/64).exprange(1024, 2048)
  ), 0, 0.1)
), 16, 8, 0.75, 0.5)});
)
Ndef(\redqueen2).stop