‹ pakt19pakt21 ›

pakt20


pact20veil, 01:00, 1.84MB

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

//pakt20
let index, n
let spread
function setup() {
  const div = select('#sketch')
  const cnv = createCanvas(div.width, div.height)
  cnv.parent('sketch')
  frameRate(60)
  background(0)
  index = 0
  n = 150
}
function draw() {
  spread = sin(index * 0.002)
  for (let i = 0; i < n; i++) {
    const tx = sin(0.012 * (index + i * spread))
    const ty = sin(0.014 * (index + i * spread))
    const tz = sin(0.016 * (index + i * spread)) * 127.5 + 127.5
    stroke(tz, tz * 0.9, tz, 13)
    line(
      sin(tx + sin(index * 0.001)) * (sin(tx) * 0.001 + 1.0) * width * 0.46 + width * 0.5,
      sin(ty + cos(index * 0.001 * i)) * (cos(ty) * 0.001 + 1.0) * height * 0.46 + height * 0.5,
      cos(ty + sin(index * 0.001)) * (sin(tx) * 0.001 + 1.0) * width * 0.36 + width * 0.5,
      sin(tx + cos(index * 0.001 * i)) * (cos(ty) * 0.001 + 1.0) * height * 0.36 + height * 0.5)
  }
  index++
}

Ndef(\veil).play
(
Ndef(\veil, {var n= 15; GVerb.ar(Mix({|i|
  var t= i/n*2pi;
  var f= SinOsc.ar(SinOsc.ar(i*0.015+0.015, t), t);
  var a= SinOsc.ar(f*SinOsc.ar(i*0.15+0.15, t, 0.15, 0.3), t, 150, 300);
  var b= SinOsc.ar(f*SinOsc.ar(i*0.15+0.15, t, 0.15, 0.5), t, 1500, 3000);
  Pan2.ar(
    BPF.ar(
      Saw.ar(SinOsc.ar(f, t).exprange(a, b), SinOsc.ar(f, t, SinOsc.ar(0.015*t+0.15, t, 0.15).max(0))),
      a+b*0.5,
      0.15
    ),
    i/(n-1)*2-1
  );
}!n), 15, 1.5, 0.15)});
)
Ndef(\veil).stop