Today I'm releasing Starboard, a fun demo I made to recreate the sound of Bag Raiders' sleeper internet hit Shooting Stars using Web Audio.

This was an interesting one to make, because the code was actually not that difficult, but trying to recreate a specific synth sound turned out to be way beyond my expertise. I originally intended it to be a 1-day project but it took a whole week to finish, of which around one day was spent writing most of the code, another papering over gaps in the Web Audio API, and one more making it work in Safari. The rest of my time was just fiddling with parameters over and over again trying to get it to sound right.

I tried a bunch of different effects, filters, EQ, compression, etc, but in the end the thing that sounded the best was just the basic synth, a bit of vibrato, and some reverb. It still doesn't quite have the thin cheesy sound of the original, but that may actually be for the best; a couple of times I had something that sounded close when I played it with the real track, but when I listened to it without any of the bass or backing synths it just came out hollow. In the end, I think just focusing it on making it sound good and letting go of exact reproduction was what I needed to do to get a sound I was happy with.

Most of the internals proceeded fairly normally, though this was the first time I'd had to write an actual sequencer (as opposed to, say, the node-based scheduling code in Markov Technology). I just used timeouts, which was basically fine, except that the scheduler loses time under heavy CPU load, which can happen pretty easily on mobile. I was, however, really pleased with how I represented notes internally; I'd previously used frequencies or scientific pitch notation (like A4), but this time I used MIDI numbers and everything suddenly became way easier.

But the one thing I think I'm most proud of is the way I did the starfield animation. In Markov Contact I started trying something I think of as deterministic animation, where every frame is a pure function of time and a (usually random) initial state. I cheated for a few of the animations back then, but this time I really nailed it. The code is super small, loops seamlessly and, even better, if you hide and show the starfield (like I do a bunch), the stars "keep moving" even when the animation isn't running.

So all up, this was a bit of fun, and a good chance to refine some existing audio & animation techniques and re-remind myself of how hard audio production is. If you'd like to check out the code, it's on GitHub.