You are not recognized as the original poster of this topic.
let mod=(n,m)=>(n%m+m)%m,
arr0=l=>new Array(l).fill(0),
FIR=(c=[1])=>{
let l=c.length,a=arr0(l);
return{
p:x=>{ //process
let o=0;
a.unshift(x);a.pop();
for(let i=0;i<l;i++){o+=c[i]*a[i];}
return o;
},
c:c //array itself
};
},pwm=(a,t)=>mod(t,1)>=a?1:-1,
cho=t=>(pwm(.3+(sin(t)*.2),t*340)+
pwm(.5+(sin(t*2.2)*.4),t*338)+
pwm(.3+(sin(t/2)*.2),t*265)-
pwm(.5+(sin(t*2.2)*.4),t*268)-
pwm(.3+(sin(t/3)*.2),t*257)-
pwm(.5+(sin(t*2.2)*.4),t*256)+
pwm(.3+(sin(t/2)*.2),t*230)+
pwm(.5+(sin(t*2.2)*.4),t*228)+
pwm(.3+(sin(t)*.2),t*180)+
pwm(.6+(sin(t*2.2)*.4),t*178)-
pwm(.3+(sin(t)*.2),t*170)-
pwm(.7+(sin(t*2.2)*.4),t*169)+
sin(t*PI*818)-sin(t*PI*1370))/8,
fc=(fun,cd=32e3)=>{
let fa=[],f,ct=0;
for(let l=64,i=0;i<l;i++)
fa.push((sin((i/l)*PI)**3)/30);
f=FIR(fa);
return t=>{
let o=f.p(fun(t));
ct++;if(ct>=cd){
let n=1+random()*20;
for(let l=fa.length,i=0;i<l;i++){
f.c[i]=(sin((i/l)*PI)**n)/30;
}
ct=0;
}
return o;
};
},fca=[[fc(cho),1],[fc(cho,8e3),1.5],[fc(cho,16e3),2.25]];
return t=>{
let o=0;
for(let i=0;i<fca.length;i++){
o+=fca[i][0](t*fca[i][1]);
}
return o/2;
};