stunning graphics, gpu sound right at your fingertips! likely you have to reload the page
for(_="()~erZatYfloYX X W0.,Ogl_N\\nM256L, K0KJ(3616HbaHJGinstr(forrocesscreYeoutvecionunimContextuffZwith(36065KLKL* .227e-4);dr(6KJ3 = )[i]r[i*2;void maNVZtexID 2 sS(AcS(3563NFragCoord.p[t(t;lay(locY=;}`ce(AaS(PKA)K`#vZs 300 esMx.putB.getChannelDYa(b.sZtBee(cd.Element('canvas')Ka(B gc.get('webgl2'))g[ B[0]+B[6]]g[B];g){ge(gp~[0]PcP(3p;u~{NPosit=4(u=2( <<1&2, &2)*2.-1.,0,1) 2precis highp X; u;WT0) 4 c1)s ~{Wf0.; c+=.5/length(u),c.w=1.;M#defe f,t,s)s+=Yan(s(6.28 * t*f),.1)*.25;MX t(x + y * L.) + T;Wp[]=X[](49OO324.5,29O98.,440.*6.)%6],t,f)%4],t*.25,fs2(f,dot(f,s(t))c.r+=flo(Pug(Prnew FloY32Array(131072 new Audio)ScriptPor(B8192KtJ2)) connect(destY)Konaudiopx => {Gg.cF~bnH1KAg.cR~framebRendZbHJK36161KArbH1K33328df([J]rf(rx(J0K33319K5126Kr (i0; i < B; t++) (i++ % 2 === 0)?0]:1+1];Gnull1f(gf(PK'T')Kt}}";G=/[^ -FIP-V[-}]/.exec(_);)with(_.split(G))_=join(shift());eval(_)
Zm9yKF89IigpfmVyWmF0WWZsb1lYIFggVzAuLE9nbF9OXFxuTTI1NkwsIEswS0ooMzYxNkhiYUhKR2luHx9zdHIoHmZvch1yb2Nlc3McY3JlWWUbb3V0GnZlYxlpb24YdW5pHW0XQ29udGV4dBZ1ZmZaFXdpdGgoFDM2MDY1E0tMS0wSKiAuMjI3ZS00ESk7EBBkcig2S0ozEA8gPSAOKVtpXQ5yW2kqMgw7dm9pZCBtYR8LTlZadGV4SUQJIBkyIAhzUyhBDmNTKDM1NjMHTkZyYWdDb29yZC4GEB5wWx90KHQFO2xheRoobG9jWRg9BDt9YBBjZShBEGFTKFBLQRADKUtgI3ZacxggMzAwIGVzTQJ4LhpwdXRCFS5nZXRDaGFubmVsRFlhKAFiLh9zWnRCZR1lKGMOZC4bRWxlbWVudCgnY2FudmFzJylLYRAdKEIgHyBnDmMuZ2V0Fignd2ViZ2wyJykpZ1sgQlswXStCWzZdXQ5nW0JdOxRnKXtnZShncH5bMF0QUA5jUCgQBzMCHwhwOxoIdQt+e05Qb3NpdBg9GTQodT0ZMigJPDwxJjIsCSYyKSoyLi0xLiwwLDEpAyAHMgJwcmVjaXMYIGhpZ2hwIFg7IB8IdTsXV1QEMCkaIBk0IGMEMSkaCHMLIH57V2YOMC47IGMrPS41L2xlbmd0aCh1KSxjLnc9MS47TSNkZWYfZSAeZix0LHMpcys9WWFuKHMfKDYuMjggKiB0KmYpLC4xKSouMjU7TVggdA4oBnggKyAGeSAqIEwuKSARICsgVBE7V3BbXT1YW10oNDlPTzMyNC41LDI5Tzk4Liw0NDAuBSo2LiklNl0sdCxmBSklNF0sdCouMjUsZhBzDhkyKGYsZG90KGYscx8odCkpEGMucis9ZgNsbyhQEHVnKFAQcg5uZXcgRmxvWTMyQXJyYXkoMTMxMDcyECAUbmV3IEF1ZGlvFikUG1NjcmlwdFAcb3IoQg44MTkyS3QOSjIpKSBjb25uZWN0KGRlc3QfWRgpS29uYXVkaW9wHA54ID0+IHtHZy5jRn4QYm5IMUtBDmcuY1J+EGZyYW1lYhVSZW5kWmIVSEoTSzM2MTYxS0EQcmJIMUszMzMyOBIQZGYoW0oTXQ9yZigTEHJ4KEowEkszMzMxOUs1MTI2S3IQHSAoaQ4wOyBpIDwgQjsgdCsrKSAoaSsrICUgMiA9PT0gMCk/ATAMXToBMQwrMV07R251bGwQFzFmKGdmKFBLJ1QnKUt0D319IjtHPS9bXiAtRklQLVZbLX1dLy5leGVjKF8pOyl3aXRoKF8uc3BsaXQoRykpXz1qb2luKHNoaWZ0KCkpO2V2YWwoXyk=
/*
* it is easily possible to have sound and visuals
* running from an single shader instance. It s at the developers choice
* depending on the situation, - the user interaction like keyboad, mouseinput
* to have the visuals running before or after in shader sound creation
*/
// no WebGL 2.0 on the shim of https://js1k.com decided to do it this way
b.insertBefore(c = d.createElement('canvas'), a);
// Compression
// http://www.ylilammi.com/webgl/kornellbox/Making of Kornell Box.pdf
// from: http://xem.github.io/articles/archive.html#webgl_quest
// packed with regPack https://siorki.github.io/
for (k in g = c.getContext('webgl2'))
g[k[0] + k[6]] = g[k];
with(g) {
// getExtension( getSupportedExtensions()[0] ) "EXT_color_buffer_float"
ge(gp()[0]);
// basic WebglGl setup
P = cP();
// bufferless Giant Triangel
// https://rauwendaal.net/2014/06/14/rendering-a-screen-covering-triangle-in-opengl/
// https://www.saschawillems.de/?page_id=2122
sS(A = cS(35633), `#version 300 es\n
in vec2 p;out vec2 u;
void main(){
gl_Position=vec4(u=vec2(gl_VertexID<<1&2,gl_VertexID&2)*2.-1.,0,1);
}`);
ce(A);
aS(P, A);
sS(A = cS(35632), `#version 300 es\n
precision highp float;
in vec2 u; // uv
uniform float T; // // time
layout(location=0)out vec4 c; // color
layout(location=1)out vec2 s; // sound
void main (){
float f = 0.; // sound out
c+=.5/length(u),c.w=1.; // color out glowing ball
// --------- sound
\n#define instr(f,t,s)s+=atan(sin(6.28 * t*f),.1)*.25;\n
float t = (gl_FragCoord.x + gl_FragCoord.y * 256.) * .227e-4 + T* .227e-4; // manually adjusted to ~440.
float p[]=float[](490.,0.,324.5,290.,98.,440.); // pitch
instr(p[int(t*6.)%6],t,f);
instr(p[int(t)%4],t*.25,f);
s = vec2(f,dot(f,sin(t))); // sound
c.r+=f;// color out
}`);
ce(A);
aS(P, A);
lo(P);
ug(P);
r = new Float32Array(131072); // 65536 per channel
// WebAudio technique http://www.p01.org/music_for_tiny_airports/
with(new AudioContext)
// scriptProcessor will fire once the sampel is finished
// 1. / 44100. * 8192. = 0.185759637ms
// requestanimationframe frame runs with 16.7ms
with(createScriptProcessor( k = 8192,
t = 0, //shadertime
2) // 2 channels
)
connect(destination),
onaudioprocess = x =>
{
// g.bindFramebuffer(g.FRAMEBUFFER, g.createFramebuffer());
ba(36160, g.cF());
// g. bindRenderbuffer(g.RENDERBUFFER, A = g.createRenderbuffer())
bn(36161, A = g.cR());
// g.FRAMEBUFFER, g.COLOR_ATTACHMENT1, g.RENDERBUFFER, A
framebufferRenderbuffer(36160, 36065, 36161, A);
// g.renderbufferStorage(g.RENDERBUFFER, g.RG32F, 256, 256);
rb(36161, 33328, 256, 256);
// g.drawBuffers([g.NONE,g.COLOR_ATTACHMENT1]);
df([0, 36065]);
// g.drawArrays(g.TRIANGLE_FAN, 0, 3);
dr(6, 0, 3);
// g.readBuffer(g.COLOR_ATTACHMENT1);
rf(36065);
// g.readPixels(0, 0, buffsize, buffsize, g.RG, g.FLOAT, px);
rx(0, 0, 256, 256, 33319, 5126, r);
// webaudio sound
for (i = 0; i < k; t++)
(i++ % 2 === 0) ?
x.outputBuffer.getChannelData(0)[i] = r[i * 2] :
x.outputBuffer.getChannelData(1)[i] = r[i * 2 + 1];
// g.bindFramebuffer(g.DRAW_FRAMEBUFFER, null);
ba(36160, null);
// time uniform
uniform1f(gf(P, "T"), t);
// g.drawArrays(g.TRIANGLE_FAN, 0, 3);
dr(6, 0, 3);
}
}