‹ pakt15pakt17 ›

pakt16


pact16wheel, 01:00, 1.84MB

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

//pakt16
let index
let radius1, radius2, radius3
let ex1, ex2, ex3
let n
function setup() {
  const div = select('#sketch')
  const cnv = createCanvas(div.width, div.height)
  cnv.parent('sketch')
  frameRate(60)
  noFill()
  index = 0
}
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(width * 0.5, height * 0.5)
  for (let i = 0; i < n; i++) {
    const 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,
    )
    const x = sin(t + ex1) * radius1 * width
    const y = cos(t + ex1) * radius1 * height
    const xx = sin(t + ex3) * radius3 * width
    const yy = cos(t + ex3) * radius3 * height
    bezier(x, y, sin(t + ex2) * radius2 * width, cos(t + ex2) * radius2 * height, 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