‹ pakt21 pakt23 ›

pakt22


pact22blob, 01:00, 1.84MB

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

//pakt22 missing a little bit of alpha background
let index
let theta
let rows, cols
function setup() {
  const div = select('#sketch')
  const cnv = createCanvas(div.width, div.height)
  cnv.parent('sketch')
  frameRate(60)
  noStroke()
  index = 0
  cols = 10
  rows = 14
  blendMode(DIFFERENCE)
}
function draw() {
  clear()
  background(0)
  fill(color(255, 0, 0))
  theta = sin(index * 0.0004) * 0.1 + sin(index * 0.004) * (sin(index * 0.00004) * 6)
  const rc = (sin(index * 0.051) * 0.01 + 1) / cols
  const rr = (cos(index * 0.062) * 0.01 + 1) / rows
  for (let x = 0; x < cols; x++) {
    const rw = sin((x / cols) * PI * sin(index * 0.0032) + theta) * cols * 5
    for (let y = 0; y < rows; y++) {
      const rh = cos((y / rows) * PI * cos(index * 0.0034) + theta) * rows * 5
      if (y % 2 == 0) {
        ellipse(rc * x * width + rw * 0.5, rr * y * height + rw * 0.5, rw * 2, rw * 2)
      } else {
        ellipse(rc * x * width + rh * 0.5, rr * y * height + rh * 0.5, rh * 2, rh * 2)
      }
    }
  }
  index++
}

Ndef(\blob).play
(
Ndef(\blob, {var n= 33; Mix({|i|
  var t= i/n*2pi;
  Pan2.ar(
    LeakDC.ar(SinOsc.ar(Pulse.ar(0.0625, 2/3).range(0.0625, 0.125), SinOsc.ar(Pulse.ar(i+1, Pulse.ar(i+1*0.125, 0.4, 1/3, 0.5), i+1*n, i+1*n*2), t, SinOsc.ar(SinOsc.ar(0.0625, t), t, 2pi)), SinOsc.ar(i+1*0.125, t, i.linexp(0, n-1, 3/n, 0.001)))),
    SinOsc.ar(0.125, t, i.linlin(0, n-1, 0, 0.95))
  )
}!n)});
)
Ndef(\blob).stop