You are not recognized as the original poster of this topic.
var makeWave=()=>{
let h=[[1,0]];
for(let i=1;i<=16;i++){h.push([(Math.random()*2)-1,Math.random()*Math.PI*2]);}
return T=>{
let o=0;
for(let i=0;i<h.length;i++){o+=Math.sin((T*(i+1))+h[i][1])*h[i][0];}
return o;
};
};
var pl=[],tmr=[190000,0],sp=()=>{for(let i=0;i<24;i++){pl[i]=[makeWave(),500+Math.random()*750];}};
sp();
return function(t){
if(pl.length===0){sp();}
tmr[1]++;
if(tmr[1]>tmr[0]){sp();tmr[1]=0;}
let o=[0,0];
for(let i=0;i<pl.length;i++){
o[i%2]+=pl[i][0](t*pl[i][1]);
}
return[o[0]/80,o[1]/80];
};