‹ pakt24pakt26 ›

pakt25


pact25wobble, 01:00, 1.84MB

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

//pakt25
let index
let n
function setup() {
  const div = select('#sketch')
  const cnv = createCanvas(div.width, div.height)
  cnv.parent('sketch')
  frameRate(60)
  strokeWeight(0.5)
  index = 0
  background(0)
}
function draw() {
  n = sin(index * 0.0006) * 15 + 20

  noStroke()
  fill(color(0, 0, 0, 5))
  rect(0, 0, width, height)

  noFill()
  stroke(255, 255)
  beginShape()
  vertex(0, height * 0.5)
  for (let i = 0; i < n; i++) {
    const t = i / (n - 1)
    quadraticVertex(
      (t - 0.5 / n) * width,
      height * (sin(index * (sin(index * 0.006) * 0.02) + t) * 0.5 + 0.5),
      t * width,
      height * (cos(index * (sin(index * 0.002) * 0.02) + t) * 0.5 + 0.5)
    )
  }
  endShape()
  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