public
Created

digital hell at 25%

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
var tau = Math.PI * 2;
var baudio = require('baudio');
 
var music = [ 1, 2, 2, 1, 5, 7, 1, 4, 1, 6, 2 ];
 
var memory = [];
var t0 = Date.now();
 
var b = baudio(function (t_) {
var t = offset(t_) / (Math.ceil((Date.now() - t0) / 1000) % 10 * 4);
var n = Math.pow(2, Math.floor(t * 6 % 6) / (t % 4 + 0.25));
var m = Math.pow(2, music[Math.floor(t % music.length)] / 5);
var x = Math.pow(2, music[Math.floor(t % music.length)] / 11);
var res = Math.sin(t * tau * 100 * m * n)
* Math.sin(tau * t * music[0] * 100 * m)
* Math.sin(tau * t * 150 * x)
* 0.5
+ Math.sin(tau * t * Math.floor(Math.atan(t) * 2 % 4 * 1600)) * 0.5
* Math.sin(tau * t * 4)
;
memory.unshift(res);
memory.splice(64);
for (var i = 0; i < memory.length; i++) {
memory[i] *= Math.sqrt(memory[i+1] || 1);
}
if (t_ >= 60) b.end();
return memory[0] * 0.5 + memory[4] * 0.25
+ memory[5] * 0.125 + memory[8] * 0.125
;
});
b.play();
 
var offset = Number;
var iv = setInterval(function () {
var r = Math.random() * ((Date.now() / 1000) % 10 / 10);
offset = function (t) { return (t / r) % Math.ceil(32 * r) };
console.error(r);
}, 1000);

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.