Skip to content

Commit

Permalink
-14B: sync animation to music!
Browse files Browse the repository at this point in the history
  • Loading branch information
rmmh committed Sep 19, 2017
1 parent 0ed3096 commit 372a151
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
<a href='//candyjapan.com'>Sponsored by Candy Japan - Surprise Japanese candy boxes twice a month</a>
<img id=z>YOUR_120_BYTE_AD_HERE<img id=y>
<script>
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",k=64);
z.src=y.src=l.href,
T=t=0,
T=t=0,k=64
c=new AudioContext(),
b=c.createScriptProcessor(0,1,1),
b=c.createScriptProcessor(2048,1,1),
b.connect(c.destination),
b.onaudioprocess=function(e){
d=e.outputBuffer.getChannelData(0);
for(i=0;i<d.length;i++,t=++T*32000/c.sampleRate)
d[i]=(((3e3/(y=t&16383)&1)*35+
(x=t*'6689'[t>>16&3]/24&127)*y/4e4+
((t>>8^t>>10|t>>14|x)&63))&255)/128-1
for(n=t>>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.innerText=P
}
</script>

0 comments on commit 372a151

Please sign in to comment.