yan ๐Ÿ‡ is a user on mastodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
yan ๐Ÿ‡ @bcrypt

For the SF Stupid Ideas hackathon this weekend, eV and I built an HTML5 audio-visual experience using a single TCP packet: packet.city

List of optimizations: github.com/diracdeltas/Fastest

Music & visualization code:
c=new AudioContext;n=setInterval("for(n+=7,i=k,P='\u25b2.\\n';i-=1/k;P+=P[i%2?(i%2*j-j+n/k^j)&1:2])j=k/i;p.innerHTML=P;o=c.createOscillator();o.frequency.value=200*(j+n/k^j);o.connect(c.destination);o.start();o.stop(n/k)",k=64)

ยท Web ยท 11 ยท 17

@bcrypt Great single-packet website but the audio woke up my dog :)

@krellan my bunny hated me while i was composing it :)

@bcrypt also, ow that sound. Can you put a frequency cap on it?

@icefox though if you multiply the frequency in each iteration by a random factor like (1-0.02*Math.random()), it converges to a crash cymbal-y sound instead of a high pitched sine wave

@bcrypt http2 may shave some additional bytes since pre-shared dictionary

@uxcn it requires TLS in major browsers which adds more than saved AFAICT

@bcrypt good point... by a few thousand bytes at least probably