You are not recognized as the original poster of this topic.
let notes="C,Db,D,Eb,E,F,Gb,G,Ab,A,Bb,B".split(",").reduce((o,k,i)=>(o[k]=i,o),{}),noteHz=n=>Math.pow(2,(n-49)/12)*440,read=note=>{
if(note.includes("-"))return note.split("-").map(read);
let n=40;
while(note.startsWith("_")){n-=12;note=note.replace("_","");}
while(note.startsWith("^")){n+=12;note=note.replace("^","");}
return n+notes[note];
},melody=`\
D Gb _B D
E G _A Db
Gb A _B D
E G _A Gb-E
D-_A Gb-G _B-_G Db-D
E-_A A-G Gb-_B Gb-A
_E-_G _B-Db _A-D E-^A
_Gb-_A Db-E Gb-_A Gb-E`.trim().split(/\s+/gm).map(read),tempo=160/60;
return t=>{
let at=(t*tempo)%melody.length,
e=melody[floor(at)],
swing=.66,
f=(typeof e==="number"?noteHz(e):noteHz(e[+(at%1>swing)]))-4.5; //I like to detune
return(((t*(f*(at%1<=swing?.25:.5))*1.002%1>at%1)+(t*f%1))-1)*(.3-((at%1<=swing?at%1:(at%1)-swing)**.3)*.38)*2;
};