Beepbox is a free online tool for quickly generating music via sketching. It’s written in a combination of JavaScript and TypeScript with the source code available on GitHub under the very permissive MIT license. Getting started with Beepbox is as simple as going to the website and starting to lay down some notes. There are a variety of instruments available and you can layer multiple tracks of sounds to easily create music.
Perhaps coolest of all, as you create your song, the song’s data is encoded into the URL. You can simply share your songs URL and others can either open it in the player or they can open it in the editor and make changes. You can also download your song in .mid or .json formats for later updating, or you can export out into WAV format for use in your game engine of choice. In addition to BeepBox is there a modified more complex version called ModBox you can check out here. It is forked from the same source code but offers additional tools and levels of control at the cost of complexity.
You can learn more about BeepBox and see it in action in the video below.