JSFiddle - React, Tailwind, and code Playground
HTML
<button onclick="o.stop()">Stop</button>
JavaScript
c=new AudioContext
o=c.createOscillator()
v=c.createGain()
v.connect(c.destination)
o.type='square'
o.start()
o.connect(v)
document.onmousemove=e=>{o.frequency.value=9/innerWidth*e.x**2
v.gain.value=1-e.y/innerHeight}