Tone.js is a powerful JavaScript library for creating interactive music and sound in the browser. It gives you a high-level API built on top of the Web Audio API, making it easier to build synthesizers, sequencers, effects, and complete audio applications using JavaScript.
The Web Audio API is awesome, but it's low-level and verbose. Tone.js gives you easier tools for creating musical timing, instruments, and audio scheduling — perfect for games, web synths, beat makers, and audio visualizers.
<script src="https://unpkg.com/tone"></script>
const synth = new Tone.Synth().toDestination(); synth.triggerAttackRelease("C4", "8n");
This snippet creates a simple synthesizer and plays a middle C note for an eighth note duration.