‹ pakt24pakt26 ›

pakt25


pact25wobble, 01:00, 1.84MB

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

//pakt25
//ok i think
let index;
let w, h;
let n;
function setup() {
  let div= select('#sketch');
  let cnv= createCanvas(div.width, div.height);
  cnv.parent('sketch');
  noFill();
  index= 0;
  w= width;
  h= height;
  stroke(255);
  background(0);
}
function draw() {
  n= sin(index*0.0006)*15+20;
  fill(color(0, 0, 0, 5));
  rect(0, 0, width, height);
  let x= 0, y= h*0.5;
  let xx, yy;
  for(let i= 0; i<n; i++) {
    let t= i/(n-1);
    xx= t*w;
    yy= h*(cos(index*(sin(index*0.002)*0.02)+t)*0.5+0.5);
    bezier(x, y, (t-(0.5/n))*w, h*(sin(index*(sin(index*0.006)*0.02)+t)*0.5+0.5), xx, yy, xx, yy);
    x= xx;
    y= yy;
  }
  index++;
}
Ndef(\wobble).play
(
Ndef(\wobble, {var n= 5; Mix({|i|
  var z= SinOsc.ar(0, SinOsc.ar(60+(i*SinOsc.ar(0.004, 0, 0.8, 1)), i/n*2pi, SinOsc.ar(0, SinOsc.ar(1, 0, 2pi), SinOsc.ar(0.006), 2pi)), 1/n);
  Pan2.ar(z, z);
}!n)});
)
Ndef(\wobble).stop