‹ pakt25pakt27 ›

pakt26


pact26grid, 01:00, 1.84MB

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

//pakt26
let index;
let rx, ry;
let nx, ny;
let cols, rows;
function setup() {
  let div= select('#sketch');
  let cnv= createCanvas(div.width, div.height);
  cnv.parent('sketch');
  frameRate(60);
  noStroke();
  nx= 45;
  ny= 9;
  index= 0;
  rows= ny;
  ry= height/rows;
}
function draw() {
  cols= (sin(index*0.001+(sin(index*0.0001)*10))*0.445+0.5)*(nx-1);
  rx= width/cols;
  fill(color(0, 0, 0, 15));
  rect(0, 0, width, height);
  for(let x= 0; x<cols; x++) {
    for(let y= 0; y<rows; y++) {
      let c= sin((index+(x*rows)+y)*cos(index*0.0012)*(sin(index*0.00006)*0.5))*0.5+0.5;
      let g= c*(sin(index*0.002+(x/nx*TWO_PI))*cos(index*0.0018+(y/ny*TWO_PI)))*12+9;
      fill(255, c*255, c*255, c*255);
      rect(x*rx+g, y*ry+g, rx-(g*2), ry-(g*2));
    }
  }
  index++;
}

Ndef(\grid).play
(
Ndef(\grid, {var n= 8; Mix({|i|
  var t= i/n;
  var z= LeakDC.ar(VarSaw.ar(SinOsc.ar(VarSaw.ar(i+1*VarSaw.ar(0.048, 0, 0.5, 25, 150), t, 1/3, 150), VarSaw.ar(100+i, t, VarSaw.ar(0.024, t, 0.25, 0.475, 0.5))*pi, VarSaw.ar(0.012, t, 0.75, VarSaw.ar(0.064, t, 0.5, 25, 50), 200), VarSaw.ar(0.16, t, 2/3, VarSaw.ar(0.02, t, 0.5, 7.5).abs, 300)), t));
  Pan2.ar(z, VarSaw.ar(0.02, t, 0.5), 1/n);
}!n)});
)
Ndef(\grid).stop