‹ pakt05pakt07 ›

pakt06


pact06redqueen, 01:00, 1.84MB

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

//pakt06
let n
let theta, speed, spread
const pnts = []
function setup() {
  const div = select('#sketch')
  const cnv = createCanvas(div.width, div.height)
  cnv.parent('sketch')
  frameRate(60)
  noFill()
  strokeWeight(1)
  n = 50
  theta = 0
  speed = 0.00002
  spread = 1
  for (let i = 0; i < n; i++) {
    pnts[i] = []
    pnts[i][0] = width * 0.5
    pnts[i][1] = height * 0.5
  }
  //stroke(255, 0, 0);
  //fill(255, 255, 255);
  stroke(255, 255, 255)
  fill(255, 0, 0)
}
function draw() {
  background(0)
  for (let i = 0; i < n; i++) {
    const x = (pnts[i][0] / width) * 2 - 1
    const y = (pnts[i][1] / height) * 2 - 1
    const vx = ((cos(theta) * x - sin(theta) * y) * 0.5 + 0.5) * width + spread
    const vy = ((cos(theta) * y + sin(theta) * x) * 0.5 + 0.5) * height + spread
    pnts[i][0] = vx
    pnts[i][1] = vy
    ellipse(vx, vy, 50 * 2, 50 * 2)
    theta = theta + speed
  }
}

Ndef(\redqueen).play
(
Ndef(\redqueen, {GVerb.ar(LeakDC.ar(SinOsc.ar(SinOsc.ar([1/16, 1/12], 0, 5), SinOsc.ar(0, SinOsc.ar([SinOsc.ar(3, 0, 5, 12), SinOsc.ar(4, 0, 4, 16)], SinOsc.ar([SinOsc.ar(1/64, SinOsc.ar(0.5, 0, pi)).exprange(1, 30), SinOsc.ar(1/48, SinOsc.ar(0.75, 0, pi)).exprange(1, 30)], SinOsc.ar(SinOsc.ar(1/32, 0, 4), 0, 2pi), SinOsc.ar([1/6, 1/8], 0, 0.5pi, 2pi)), SinOsc.ar([1/3, 2/3], 0, 0.5pi, SinOsc.ar(1/8, 0, 0.5pi, 2pi))), SinOsc.ar([4/3, 3/4], 0, 0.5pi, SinOsc.ar([SinOsc.ar(1/256).exprange(80, 800), SinOsc.ar(1/256).exprange(80.8, 808)], 0, 0.5pi, 2pi)))))*0.05, 10, 3, 0.5, 0.5)});
)
Ndef(\redqueen).stop