‹ pakt16pakt18 ›

pakt17


pact17shades, 01:00, 1.84MB

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

//pakt17
//ok but not 100% correct rect size
let index;
let w, h;
let a, b, c, d;
let speed;
let n;
function setup() {
  let div= select('#sketch');
  let cnv= createCanvas(div.width, div.height);
  cnv.parent('sketch');
  noStroke();
  index= 0;
  w= width;
  h= height;
  n= 45;
}
function draw() {
  spread= sin(index*0.004)*5+6;
  background(0);
  for (let i= 0; i<n; i++) {
    a= sin(((i*spread)+index)*sin(index*0.0050+(sin(index*0.0074+1.0)+1.0))*0.0075+1)*0.25+0.5;
    b= sin(((i*spread)+index)*sin(index*0.0051+(sin(index*0.0073+2.0)+2.0))*0.0075+2)*0.25+0.5;
    c= sin(((i*spread)+index)*sin(index*0.0052+(sin(index*0.0072+3.0)+3.0))*0.0075+3)*0.25+0.5;
    d= sin(((i*spread)+index)*sin(index*0.0053+(sin(index*0.0071+4.0)+4.0))*0.0075+4)*0.25+0.5;
    fill(a*255, b*255, c*255, d*255);
    rect(a*w, b*h, c*(w*0.5), d*(h*0.5));
  }
  index++;
}
Ndef(\shades).play
(
Ndef(\shades, {Mix({|i|
  var x= SinOsc.ar(0, SinOsc.ar(0.01*i+0.03, i, 2pi));
  var y= SelectX.ar(x.range(0, 4), [WhiteNoise.ar, GrayNoise.ar, PinkNoise.ar, BrownNoise.ar]);
  var z= Pan2.ar(y, x*0.4);
  BPF.ar(Rotate2.ar(z[0], z[1], i/3*2-1), i+1*500, SinOsc.kr(0, SinOsc.ar(i*0.02+0.01, i, pi)).range(1, 10), 0.3);
}!4)});
)
Ndef(\shades).stop