You are not recognized as the original poster of this topic.
SR=32000; //sample rate
SRi=1/SR;
makeRatios=n=>{
let a=[];
for(let i=1;i<n;i++)
a.push(i/n);
return a;
};
a=[0,...[2,3,5,7/*prime numbers*/].flatMap(makeRatios),1].sort((a,b)=>a-b);
//return t=>((t*440*a[Math.floor(t*20)%a.length])%1)-.5;
st=0;
return t=>{
//let f=600*a[Math.floor(t*10)%a.length];
let f=220+220*a[Math.floor(t*10)%a.length]; //I'm pretty sure you're not supposed to multiply it like that if it's non-linear?
//f=440;
st=(st+f*SRi)%1;
//return Math.sin(t*f*Math.PI*2)*.5;
return(Math.sin(st*Math.PI*2)**5)*.75;
};