As I've composed music for video games, something that has piqued my interest is the concept of randomly generating music. Not that this is a new concept, but I was curious to see what I could come up with. Go ahead and check out the RMG-2021.

Design

I love how sequencers look and feel—and there is so much variety as to how they're designed! I really wanted to recreate the vibe of using a physical sequencer, and referenced a lot of gear when designing the UI. It was a bit of a balancing act to capture the essence of a physical sequencer while adapting it to a screen.

RMG-2021 Tiny Music Sequencer

Preact

One of my goals was to get better at understanding and using React. I really just wanted to get more familiar with the basics, so I went with Preact which more or less offers the same API and low-level functionality. I'm also using HTM which provides JSX-like syntax in vanilla JavaScript.

At first, I found it really difficult to buy in to the React/JSX ecosystem, but the more I work with it, the more I appreciate it. I'm still not super fond of writing HTML in JavaScript, but I'm getting over it.

Sound

When working with audio for ONOFF, I used TinyMusic, and I'm using it here too. Is it necessarily? No, but true to it's name—it's tiny, and offers a nice API. It simplifies authoring audio sequences in JavaScript. I'm even outputting the TinyMusic sequence syntax so it can be easily reference it.

Features

This is one of those projects that I could have easily kept adding features. At some point I had to call it done and ship it. Every feature I added ended up adding more complexity to using the sequencer. The RMG allows you to specify:

  • The number of notes to use in the sequence
  • Which key the notes should be pulled from
  • A range of octaves to generate a sequence within
  • Snapping the total number of beats to an integer
  • Toggling the loop of the sequence
  • Toggling a metronome click, and adjusting various metronome settings
  • Adjusting various effects such as wave type, EQ, sweep, and decay
  • Adding a pulse effect to a sequence

On top of these features you can also easily randomize all the settings, and share a sequence via URL.

Random Sequences are Fun

I've used random sequences generated by the RMG for various things: drumming along with sequences, challenging myself to compose music around a random sequence, or even sending goofy sounds to my friends. It was a fun project, and I learned a lot.