OUTSIDE PARTIES horror scavenger hunt across a 1.5-gigapixel HDR image

I’ll be posting some footage with audio soon. It’s coming along nicely, really feeling like the image, the sounds, and the text ticker are all ONE thing. I hope!

For now, I’ll share how I am generating procedural music...


Interval Signals

The game is partly inspired by numbers stations so I felt I HAD to build my own actual numbers stations into it. Complete with voices speaking code... and—very occasionally—”interval signals”: vaguely spooky bits of music that play between transmissions.

You won’t hear them often, and you will NEVER hear the same tune twice.

Real interval signals are often bits of folk music of various nationalities. So I programmed a system to write widely-varied snippets of folk music.

Most of the randomizations are weighted: I always like my randomness to feel “uneven,” with some events being much more rare than others.

Here’s how it works:

• Random choice of 3|4 or 4|4 time.

• Random span of 1 (usually) or 2 octaves to draw notes from. Never super high or low.

• Random selection of four scales I put in a table: Dorian C, Mixolydian C, Aeolian C, and Aeolian Dominant C.

• Random tempo.

• Random overall volume.

• Random choice of 6 sample-based instruments: Organ, Flute, Chorus, Bells, Out-of-Tune Piano, and the creepiest of all instruments: the dreaded Toy Piano.

• Random choice of 5 ADSR schemes I made (“Soft,” “Staccato,” Woodwind,” “Woodwind/long release,” “Full + fade-off”) that give those instruments different characters.

• Random bitcrusher amount with random undersampling, for a nice radio distortion that varies. At the extremes, the instruments can sound quite strange.

With those factors decided, it’s time for the Playdate to get to composing....


Procedural Music

Each snippet of music is 8 measures long. Usually it loops twice, since repetition adds structure and feels more “musical.” But when the random tempo is slow, it only plays once. I didn’t want the tunes running long.

• Measures are generated in pairs: a random rhythm is built from half-notes, quarter-notes, and rests, then used for two consecutive measures (of 3 or 4 beats each).

• The process has a little guidance against certain unwanted weird outcomes. For instance, the music never starts with a rest.

• The rhythm contains no pitches, but it has both durations and random velocities (note volumes). The velocity variation helps the music feel more “alive.”

• Random pitches from the chosen scale are assigned to all the resulting notes. Each note in the rhythm table has a 50% chance of being the same for both measures. That means the second measure of the pair feels like a variation on the first.

• The final measure is different: it copies nothing from the preceding measure, but is always a single note of random length, always at least a half note, and it can be longer than the other notes ever get—up to the full measure. This long note (or if short, followed by a long rest) is like a period on the end of the musical “sentence.”

• To time the sequence I use this formula: loops * musicSequence:getLength() / tempo. But if my piece ends with rests (which have no meaning in a sound.track, they’re just unused time) the timing will be wrong. So in the final measure, I use note(s) with velocity 0 to fill the time of any final rest.

The result often sounds, to my untrained ear, like real music! And when it doesn’t quite, it’s still a fine “musical signal.”

I then use a low-frequency oscillator modified to ramp the volume gently up from zero and back down again in a sine curve, like a distant signal coming and going. (Most of the sounds in the game do that to some degree.) Occasionally the two-loop tunes will forgo that and play full-volume start-to-finish. But the one-time tunes (less common) never do: they already feel more like pieces taken from the middle of something, not as much like music that stands alone.

The “data stream” (text ticker) at the bottom of the screen always reflects whatever the audio is doing (which makes an audio-heavy game playable with the sound off). In this case, the text flickers a mix of “INTERVAL SIGNAL” and question marks. (As well as the ever-present occasional flashes of brief creepy messages from Out There.)

Stay tuned for some recordings!

5 Likes