‹ pakt10pakt12 ›

pakt11


pact11hail, 01:00, 1.84MB

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

//pakt11
let index;
let rowsMid, colsMid, rows, cols;
let grad;
function setup() {
	let div= select('#sketch');
	let cnv= createCanvas(div.width, div.height);
	cnv.parent('sketch');
	frameRate(60);
	noStroke();
	index= 0;
	rowsMid= 22;
	colsMid= 20;
	scale(0.96, 0.96);
	translate(5.0, 5.0);
	grad= createGraphics(width, height);
	grad.noStroke();
	for(let r= width; r>0; --r) {
		grad.fill(lerpColor(color(0.6*255, 0.5*255, 0.5*255), color(0, 0, 0), r/width));
		grad.ellipse(width*0.5, height*0.5, r*2.0, r*2.0);
	}
	fill(255);
}
function draw() {
	rows= rowsMid+(sin(index*0.0015)*10);
	cols= colsMid+(sin(index*0.0024)*10);
	image(grad, 0, 0);
	let x1= 0, y1= 0, x2= 0, y2= 0;
	scale(0.96);
	translate(5, 5);
	beginShape();
	vertex(0, 0);
	for (let y= 0; y<=rows; y++) {
		for (let x= 0; x<=cols; x++) {
			x1= (x/rows*width)+sin(index+(x*y)*32);
			y1= (y/cols*height)+cos(index+(x*y)*24);
			x2= (x/cols*width)+sin(index+(x*y)*32);
			y2= (y/rows*height)+cos(index+(x*y)*24);
			vertex(x1, y1);
			vertex(x2, y2);
		}
	}
	endShape();
	index++;
}

Ndef(\hail).play
(
Ndef(\hail, {Splay.ar(Ringz.ar(SinOsc.ar(#[0.000101, 0.000202, 0.000303, 0.000404, 0.000505, 0.000606], SinOsc.ar(#[101, 202, 303, 404, 505, 606], 0, SinOsc.ar(#[0.0101, 0.0202, 0.0303, 0.0404, 0.0505, 0.0606], 0, pi)))*VarSaw.ar(#[1.01, 2.02, 3.03, 4.04, 5.05, 6.06], #[0.101, 0.202, 0.303, 0.404, 0.505, 0.606], SinOsc.ar(#[0.00101, 0.00202, 0.00303, 0.00404, 0.00505, 0.00606], 0, 0.5, 0.5)), #[1010, 2020, 3030, 4040, 5050, 6060], SinOsc.ar(#[10.1, 20.2, 30.3, 40.4, 50.5, 60.6], 0, 0.1, 0.2), 0.2))});
)
Ndef(\hail).stop