for(_='on@()$uncti@V(fV${Udiv(Q),PQx,iPE[i]DnD`~~(`/_(o,y)^for(Z){ZYi<CXaddLsubK++Jnerein.jo("Array(Pc.f@t="=num(Px.value=.lengthturn atan(mul(&&(990,+=c.fill",Text(,Style= n,tYi==a.ceMh.pow(.slice(0.c@ct(in[i-1]}fV (C-1;i--;)(`fV num${w Flo64C)K-=tD)<0-=1P`A)LtD)>A_A)P`%=A)Q0;X;iJ)d=_tPX-1n[i+1](`-d*t)*AP`=di,nYb=i);--n;)L(i,b)iYo[0]=1,Ei*=i,M=s=-1;+x");)Qy=xPM2PE(s=!s)?K^:L^;o}ZA=1G=6PC=26a=5P4PK(a,239)Pa,4PI=a[0]+".",i=0;JX;)IG-(""+aD)+1)0")+aD;F=I,a=w AudioC@text,gGa(Pg.ga.02,ga.desti@PRect(W=rWidth,H=rHeighttransle(W/2,H/2px serif" "#fff"\\u03C0",-25,2520px arial",i=j=m=setIntervalUif((j1/9)<F)ZmJ%9==0setTimeoutUthis.stop$}.bd(oOscillor$Pm%2?9:Po.fquency440*2,[2,4,5,7,9,11,12][(+I[~~j]||0)%8]/12PogPo.start$PM=+i==F;M<2;MJ)c.save(rote(.08*(l=M?~~j:iJ)Ps=(F-l)/F M?"#0ff":"rgba(,,,"+s*s+")I[l],-C*ssto$},16);';g=/[-J-LX-Z^-`DEPQUV$@]/.exec(_);)with(_.split(g))_=join(shift());eval(_)
// π/4 = 4*atan(1/5)-atan(1/239) | John Machin, 1706
B = Math.pow(10,N=6); // base
D = 260; // digits
function num(){return new Float64Array(D)}
function sub(a,b){for(i=D-1;i--;)(a[i]-=b[i])<0&&(i&&(a[i-1]-=1),a[i]+=B)}
function add(a,b){for(i=D-1;i--;)(a[i]+=b[i])>B&&(i&&(a[i-1]+=~~(a[i]/B)),a[i]%=B)}
function div(a,b){for(i=0;i<D;i++)d=~~(a[i]/b),i<D-1&&(a[i+1]+=(a[i]-d*b)*B),a[i]=d}
function mul(a,n){b=a.slice(0);while(--n)add(a,b)}
function atan(n)
{
o = num(), x = num(), x[0] = 1,
div(x,n), n *= n, k = s = -1;
while(+x.join(""))
div(y=x.slice(0),k+=2), div(x,n),
(s=!s) ? sub(o,y) : add(o,y);
return o;
}
// calculate pi
mul(a=atan(5),4);
sub(a,atan(239));
mul(a,4);
// pad digits with zeros, stringify
for(P=a[0]+".",i=0;++i<D;)P+=Array(N-(""+a[i]).length+1).join("0")+a[i];
L=P.length;
a = new AudioContext();
g = a.createGain();
g.gain.value = 0.02;
g.connect(a.destination);
c.fillRect(0,0,W=innerWidth,H=innerHeight);
c.translate(W/2,H/2);
c.font="99px serif";
c.fillStyle = "#fff";
c.fillText("\u03C0",-25,25);
c.font="20px arial";
// 2212221 major => [0,2,4,5,7,9,11,12][n%8]
// 2122122 minor => [0,2,3,5,7,8,10,12][n%8]
i = j = m = 0;
setInterval(function()
{
if((j+=1/9)<L)
{
if(m++%9==0)
setTimeout(function(){this.stop()}.bind(o=a.createOscillator()),m%2?999:99),
o.frequency.value = 440*Math.pow(2,[0,2,4,5,7,9,11,12][(+P[~~j]||0)%8]/12),
o.connect(g),
o.start();
for(k=+i==L;k<2;k++)
c.save(),
c.rotate((l=k?~~j:i++)*0.08),
s=(L-l)/L,
c.fillStyle=k?"#0ff":"rgba(99,99,99,"+s*s+")",
c.fillText(P[l],0,-D*s),
c.restore()
}
},16)