nycki.net/static/qrplay/min.html
nycki 142746c3a4
All checks were successful
/ build (push) Successful in 36s
hotfix: off by one error affecting whole notes
2025-07-07 10:24:15 -07:00

1 line
No EOL
747 B
HTML

<meta name="viewport" content="width=device-width initial-scale=1.0"><textarea id=f></textarea><br><button onclick='/*qrplay v1, nycki & SArpnt, 2025*/v=f.value;T=[];Z=0;f.A=A=f.A||new AudioContext;B=new GainNode(A,{gain:0.4});B.connect(A.destination);for(i=o=k=t=0,l=1;c=v[i++],d=v[i],c;z<0?0:z>29?k=1:z>28?k=0:k?0:z>27?(T[Z]=t,Z=+v.slice(i,i+=2),t=T[Z]||0):z>17?t+=l:z<3?z?o+=g:(o=0,l=1/8):(console.log(z),z)&1?console.log(l=g):(a=new OscillatorNode(A,{type:`square`,detune:100*(g+o+(d==`#`)-(d==`!`))}),a.connect(B),a.start(t*.4),t+=l,a.stop(t*.4)))g=[,-12,12,4,-9,2,-7,1,-5,.5,-4,.25,-2,1/8,0,l/3,2,l*1.5][z=`@-+wchdqeifsgta3b.x012456789z\npovukr\x27`.indexOf(c.toLowerCase())]'>#play</button><button onclick='f.A.close();f.A=0'>#stop</button>