‹ pakt14pakt16 ›

pakt15


pact15spin, 01:00, 1.84MB

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

//pakt15
let index
let speed
let n
function setup() {
  const div = select('#sketch')
  const cnv = createCanvas(div.width, div.height)
  cnv.parent('sketch')
  frameRate(60)
  noFill()
  index = 0
  n = 80
  speed = 0.005
}
function draw() {
  background(0)
  translate(width * 0.5, height * 0.5)
  for (let i = 0; i <= n; i++) {
    stroke(255, sin((index + i) * 0.1) * 127.5 + 127.5, 255, 127.5)
    rotate((i / n) * TWO_PI + index * sin(index * speed) * 0.0001)
    const x0 = sin(index * 0.1 + i * 0.3) * (height * 0.3)
    const y0 = 0.0
    const x1 = width * (sin((index + i) * 0.0144) * 0.03 + 0.26)
    const y1 = height * (cos((index + i) * 0.0126) * 0.03 + 0.26)
    const x2 = width * (sin((index + i) * 0.0244) * 0.02 + 0.07)
    const y2 = height * (cos((index + i) * 0.0226) * 0.02 + 0.07)
    line(x0, y0, x1, y1)
    line(x1, y1, x2, y2)
  }
  index++
}

Ndef(\spin).play
(
Ndef(\spin, {GVerb.ar(Mix(Pan2.ar(Formlet.ar(LPF.ar(Saw.ar((5..1)*LFPulse.ar(SinOsc.ar(0.1, 0, 0.5, 1), 0.5, 0.5, 10, 50)+SinOsc.ar((6..2)*0.05).exprange(0.05, 50), 0.3), 300)+Impulse.ar((0..4)+SinOsc.ar((4..8)*0.02).exprange(0.3, 300)), (1..5)*SinOsc.ar((5..9)*0.05).exprange(200, 2000)*SinOsc.ar(SinOsc.ar((2..6)*0.1, 0, 0.1), 0, 0.1, 1), 0.001, 0.0015), SinOsc.ar(SinOsc.ar((3..7)*0.1, 0, 0.1)))))});
)
Ndef(\spin).stop