‹ pakt15pakt17 ›

pakt16


pact16wheel, 01:00, 1.84MB

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

//pakt16
//ok it seems
let index;
let w, h;
let radius1, radius2, radius3;
let ex1, ex2, ex3;
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;
}
function draw() {
  radius1= sin(index*0.013)*0.3+0.1;
  radius2= sin(index*0.021)*0.2+0.25;
  radius3= sin(index*0.012)*0.1+0.4;
  ex1= sin(index*0.0052)*3+3;
  ex2= sin(index*0.0061)*6+6;
  ex3= sin(index*0.0053)*2+2;
  n= sin(index*0.001)*40+50;
  background(0);
  translate(w*0.5, h*0.5);
  for (let i= 0; i<n; i++) {
    let t= (i/n)*TWO_PI;
    stroke(255, 255, 255, sin((index+(i*sin(index*0.008+(i*sin(index*0.013)*0.01))*2))*0.1)*127.5+127.5);
    let x= sin(t+ex1)*radius1*w;
    let y= cos(t+ex1)*radius1*h;
    let xx= sin(t+ex3)*radius3*w;
    let yy= cos(t+ex3)*radius3*h;
    bezier(x, y, sin(t+ex2)*radius2*w, cos(t+ex2)*radius2*h, xx, yy, xx, yy);
  }
  index++;
}
Ndef(\wheel).play
(
Ndef(\wheel, {Splay.ar(BPF.ar(PinkNoise.ar(1!3)*SinOsc.ar(VarSaw.ar(#[0.011, 0.012, 0.013], #[0, 0.1, 0.2], 0.5, VarSaw.ar(#[0.01, 0.02, 0.03], #[0, 0.1, 0.2]).exprange(5, 50), #[300, 303, 309]), CombN.ar(Saw.ar(#[3, 2.5, 1], 0.5pi).sum, 0.05, 0.05), 3), VarSaw.ar(#[0.021, 0.022, 0.023], #[0.2, 0.1, 0.3]).exprange(500, 2000), VarSaw.ar(#[0.031, 0.032, 0.033], #[0, 0.1, 0.2]).exprange(0.06, 0.6)))});
)
Ndef(\wheel).stop