Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
computer noise
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);
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.