mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
21 KiB
43 lines
21 KiB
12 years ago
|
/*
|
||
|
* (broken) cover of Chaos Theory by Mu6k, Ryg, p01 et al
|
||
|
*/
|
||
|
|
||
|
/*===
|
||
|
000102040507080a0b0d0e101113141617191a1c1d1f202223252628292b2c2e2f313233353638393b3c3e3f4142444547484a4b4d4e505153545657595a5c5d5f606263646667696a6c6d6f707273757678797b7c7e7f8182848587888a8b8d8e909193949597989a9b9d4e500103040607090a0c0d0f101213151618191b1c1e1f212224252628292b2c2e2f3132343537383a3b3d3e404143444647494a4c4d4f505253555657595a5c5d5f606263656668696b6c6e6f7172747577787a7b7d7e808183848687898a8b8d8e909193949697999a9c4d4f505203050608090b0c0e0f1112141517181a1b1c1e1f2122242527282a2b2d2e303133343637393a3c3d3f404243454648494b4c4d4f505253555658595b5c5e5f6162646567686a6b6d6e707173747677797a7c7d7e808183848687898a8c8d8f909293959698994b4c4e4f5152540507080a0b0d0e0f1112141517181a1b1d1e202123242627292a2c2d2f303233353638393b3c3e3f404243454648494b4c4e4f5152545557585a5b5d5e606163646667696a6c6d6f707273747677797a7c7d7f808283858688898b8c8e8f9192949597984a4b4d4e505153545507080a0b0d0e101113141617191a1c1d1f202223252628292b2c2e2f313234353638393b3c3e3f4142444547484a4b4d4e505153545657595a5c5d5f606263656667696a6c6d6f707273757678797b7c7e7f8182848587888a8b8d8e909193949697484a4b4d4e505153545657090a0c0d0f101213151618191b1c1e1f212224252728292b2c2e2f3132343537383a3b3d3e404143444647494a4c4d4f505253555658595b5c5d5f606263656668696b6c6e6f7172747577787a7b7d7e808183848687898a8c8d8e909193944647494a4c4d4f505253555658590b0c0e0f1112141517181a1b1d1e1f2122242527282a2b2d2e303133343637393a3c3d3f404243454648494b4c4e4f505253555658595b5c5e5f6162646567686a6b6d6e707173747677797a7c7d7f808183848687898a8c8d8f909293454648494b4c4e4f5152545557585a0b0d0e101112141517181a1b1d1e202123242627292a2c2d2f303233353638393b3c3e3f414244454648494b4c4e4f5152545557585a5b5d5e606163646667696a6c6d6f707273757677797a7c7d7f808283858688898b8c8e8f9192444547484a4b4d4e505153545657585a5b0d0e101113141617191a1c1d1f202223252628292b2c2e2f313234353738393b3c3e3f4142444547484a4b4d4e505153545657595a5c5d5f606263656668696a6c6d6f707273757678797b7c7e7f8182848587888a8b8d8e904143444647494a4b4d4e505153545657595a5c5d0f101213151618191b1c1e1f2122242527282a2b2d2e2f3132343537383a3b3d3e404143444647494a4c4d4f505253555658595b5c5e5f606263656668696b6c6e6f7172747577787a7b7d7e808183848687898a8c8d8f404143444647494a4c4d4f505253555658595b5c5e5f1112141517181a1b1d1e202122242527282a2b2d2e303133343637393a3c3d3f404243454648494b4c4e4f515253555658595b5c5e5f6162646567686a6b6d6e707173747677797a7c7d7f808283848687898a8c8d3f404243454648494b4c4e4f5152545557585a5b5d5e606113141617181a1b1d1e202123242627292a2c2d2f303233353638393b3c3e3f414244454748494b4c4e4f5152545557585a5b5d5e606163646667696a6c6d6f707273757678797a7c7d7f808283858688898b3c3e3f4142444547484a4b4d4e505153545657595a5b5d5e606163141617191a1c1d1f202223252628292b2c2e2f3132343537383a3b3c3e3f4142444547484a4b4d4e505153545657595a5c5d5f606263656668696b6c6d6f707273757678797b7c7e7f8182848587888a3b3d3e404143444647494a4c4d4f505153545657595a5c5d5f606263151618191b1c1e1f2122242527282a2b2d2e303132343537383a3b3d3e404143444647494a4c4d4f505253555658595b5c5e5f616263656668696b6c6e6f7172747577787a7b7d7e808183848687893a3c3d3f404243444647494a4c4d4f505253555658595b5c5e5f6162646517181a1b1d1e202123242527282a2b2d2e303133343637393a3c3d3f404243454648494b4c4e4f515254555658595b5c5e5f6162646567686a6b6d6e707173747677797a7c7d7f808283858638393a3c3d3f404243454648494b4c4e4f5152545557585a5b5d5e606163646667191a1b1d1e202123242627292a2c2d2f303233353638393b3c3e3f4142444547484a4b4c4e4f5152545557585a5b5d5e606163646667696a6c6d6f707273757678797b7c7d7f808283853638393b3c3e3f4142444547484a4b4d4e505153545657595a5c5d5e606163646667691a1c1d1f202223252628292b2c2e2f3132343537383a3b3d3e3f4142444547484a4b4d4e505153545657595a5c5d5f606263656668696b6c6e6f717273757678797b7c7e7f8182843537383a3b3d3e404143444647494a4c4d4f505253545657595a5c5d5f606263656668696b1c1e1f2122242527282a2b2d2e303133343537383a3b3d3e404143444647494a4c4d4f505253555658595b5c5e5f616264656668696b6c6e6f7172747577787a7b7d7e808133343637393a3c3d3f404243454647494a4c4d4f505253555658595b5c5e5f6162646567686a6b6d1e202123242627282a2b2d2e303133343637393a3c3d3f404243454648494b4c4e4f5152545557585a5b5c5e5f6162646567686a6b6d6e707173747677797a7c7d7f803233353638393b3c3d3f404243454648494b4c4e4
|
||
|
===*/
|
||
|
|
||
|
/* Comparison value computed using Rhino, V8 agrees. */
|
||
|
|
||
|
function f(t) {
|
||
|
// http://pelulamu.net/countercomplex/music_formula_collection.txt
|
||
|
// unfortunately this is broken compared to the youtube version
|
||
|
|
||
|
/*
|
||
|
// mu6k 2011-10-10 http://www.youtube.com/watch?v=tCRPUv8V22o "Long-line Theory", Chaos Theory cover, optimized by ryg, p01 et al., JS-only
|
||
|
w=t>>9,k=32,m=2048,a=1-t/m%1,d=(14*t*t^t)%m*a,y=[3,3,4.7,2][p=w/k&3]*t/4,h="IQNNNN!!]]!Q!IW]WQNN??!!W]WQNNN?".charCodeAt(w/2&15|p/3<<4)/33*t-t,s=y*.98%80+y%80+(w>>7&&a*((5*t%m*a&128)*(0x53232323>>w/4&1)+(d&127)*(0xa444c444>>w/4&1)*1.5+(d*w&1)+(h%k+h*1.99%k+h*.49%k+h*.97%k-64)*(4-a-a))),s*s>>14?127:s
|
||
|
*/
|
||
|
|
||
|
w=t>>9,k=32,m=2048,a=1-t/m%1,d=(14*t*t^t)%m*a,y=[3,3,4.7,2][p=w/k&3]*t/4,h="IQNNNN!!]]!Q!IW]WQNN??!!W]WQNNN?".charCodeAt(w/2&15|p/3<<4)/33*t-t,s=y*.98%80+y%80+(w>>7&&a*((5*t%m*a&128)*(0x53232323>>w/4&1)+(d&127)*(0xa444c444>>w/4&1)*1.5+(d*w&1)+(h%k+h*1.99%k+h*.49%k+h*.97%k-64)*(4-a-a))),s*s>>14?127:s
|
||
|
|
||
|
return s;
|
||
|
}
|
||
|
|
||
|
var digits = "0123456789abcdef";
|
||
|
var res = [];
|
||
|
|
||
|
for (var time = 0; time < 10000; time++) {
|
||
|
var sample = f(time) | 0;
|
||
|
sample = (sample < 0 ? 0 : sample);
|
||
|
sample = (sample > 255 ? 255 : sample);
|
||
|
|
||
|
res[res.length] = digits[sample >> 4];
|
||
|
res[res.length] = digits[sample & 0x0f];
|
||
|
|
||
|
if ((time % 1000) == 0) {
|
||
|
res = [ res.join('') ]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
print(res.join(''));
|
||
|
|