nycki.net/static/abc/index.html
nycki cd9373e7f6
All checks were successful
/ build (push) Successful in 44s
make firefox stop complaining about missing doctype
2025-07-05 17:06:13 -07:00

22 lines
545 B
HTML

<!doctype html>
<meta name="viewport" content="initial-scale=1.0">
<script>
var c=new AudioContext();
var m=[147, 2, 147, 2, 294, 4, 220, 6, 208, 4, 196, 4, 175, 4, 147, 2, 175, 2, 196, 2];
var r=.08;
function n(f,t,u) {
var o=c.createOscillator();
var g=c.createGain();
o.connect(g);
g.connect(c.destination);
o.frequency.value = f;
o.start(t*r);
o.stop(u*r-r);
}
function p() {
for(i=0,t=0;i<m.length;i+=2) {
n(m[i],t,t+=m[i+1]);
}
}
document.write('<button onclick="p()">play</button>');
</script>