Mimu

Milk Music: Demos and Library

The Demos

What is this?

This is a small collection of programmatically-generated music / audio demos. All of the audio processing of these demos takes place inside the web browser; there is no server code involved at all.

The code here is meant to serve as straightforward examples of how to do script-based audio generation and analysis using the JavaScript Web Audio API. Most of the code is in library form, ready for importation into other projects. Please use it!

See the source. If you're specifically looking for the Web Audio code, find it in the MusicControl class.

Items of note

As of this writing, the per-demo controls do not seem to work consistently when using Safari. This is because Safari — sometimes! — doesn't seem to promptly pass messages from the main browser thread to the AudioWorkletProcessor which generates the raw samples. It is unclear why this is(n't) happening.

The original version of this code was written in 2015, using browser and JavaScript features which were still new and/or experimental at the time. As such, this project inevitably suffered code rot, and it had stopped working sometime around 2019. In 2023, I did a chunk of work to get things working again. That said, I have yet to fully clean up the code such that it is up to arguably-modern standards.

One final word

Enjoy!