How to write a simple drum machine that runs in the browser.
Below is just a screenshot of the drum machine. The code doesn't work in mobile browsers. To play with the demo, visit this site on a deskop or laptop computer.
Click the buttons to turn the beats on or off.
The heavily annotated source code is 114 lines long.
$ git clone firstname.lastname@example.org:maryrosecook/drum-machine.git
The code is open source, under the MIT licence.