These are the code examples that go along with the multipart blog post series on how to create a synthesizer with JavaScript and the Web Audio API: https://www.russellgood.com/build-virtual-synthesizer-javascript-web-audio-api/
See a working example at: https://www.russellgood.com/audio-tools/js-synthesizer/