‹ pakt23pakt25 ›

pakt24


pact24swoop, 01:00, 1.84MB

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

//pakt24
//ok - patterns not exactly the same, line width
let index;
let w, h;
let n;
function setup() {
  let div= select('#sketch');
  let cnv= createCanvas(div.width, div.height);
  cnv.parent('sketch');
  noFill();
  strokeWeight(0.1);
  index= 0;
  w= width;
  h= height;
  n= 80;
  background(255);
  stroke(0);
}
function draw() {
  let rx= sin(index*0.0012);
  let ry= sin(index*0.0022+1);
  let tx= sin(index*0.0032+2)+rx;
  let ty= sin(index*0.0042+3)+ry;
  fill(color(255, 255, 255, 5));
  rect(0, 0, width, height);
  let x= 0, y= 0;
  for(let i= 0; i<n; i++) {
    let t= i/n*TWO_PI;
    if(i==0) {
      x= (cos((-1.0/n*TWO_PI)+rx+tx)*0.49+0.5)*w;
      y= (sin((-1.0/n*TWO_PI)+ry+ty)*0.49+0.5)*h;
    }
    let xx= (cos(t+rx+tx)*0.49+0.5)*w;
    let yy= (sin(t+ry+ty)*0.49+0.5)*h;
    bezier(x, y, (sin(t+rx+tx)*0.49+0.5)*w, (cos(t+ry+ty)*0.49+0.5)*h, xx, yy, xx, yy);
    x= xx;
    y= yy;
  }
  index++;
}
Ndef(\swoop).play
(
Ndef(\swoop, {var n= 24; Mix({|i|
  var t= i/n;
  var f= SinOsc.ar(0.01, t*0.5pi).exprange(i*22+100, i*44+1000);
  var a= SinOsc.ar(0.05*t, t*2pi, 0.15).max(0);
  var z= RLPF.ar(GrayNoise.ar(a), f*(a+1), 1.4-a-t);
  Pan2.ar(z, LFTri.ar(0.05, t*4, 0.95));
}!n)});
)
Ndef(\swoop).stop