Stories

How a forecast becomes a song

WeatherTunes · compose.js + mapping.js ·

WeatherTunes takes one day's hourly forecast and turns it into a song about 20 seconds long. Every hour from midnight to 11 pm gets two beats, so a storm that passes in an hour still gets its moment. I didn't want data beeping at random pitches, so I built it around one rule: the weather picks the musical choices, and music theory keeps them in tune.

WeatherMusic
Cloud, rain and stormsThe scale: bright Lydian on a clear, warm day, then major, Mixolydian, Dorian and minor, down to dark Phrygian in a downpour.
Air pressureThe key. Its trend over the day steers the chords: clearing days get progressions that climb, worsening days get ones that fall.
WindThe tempo, from 100 BPM in still air to 156 in a gale.
Temperature, hour by hourThe melody. The day's high is the song's highest note.
Feels-like temperatureThe melody instrument: glass bells in deep cold, then flute, soft keys, plucked strings and marimba, up to a reedy pipe in the heat.
Humidity and dew pointReverb and swing. Muggy air sounds wetter and plays lazier, and humid air under cloud crackles like vinyl.
Cloud coverTurns down the treble and steps the melody back in the mix.
Rain and snowA shuffled beat, and a noise bed that follows the hour: a faint hiss for fog, fuller noise for rain, a deep rumble for storms. Snow turns the rain into bells.
Storm fuel (CAPE)Distortion. The more energy the air holds for thunderstorms, the more grit the band picks up as the weather turns.
Calm, fog or freezing airHalf-time bass. Rough hours switch it to double time.

Then the day tells its story. Each hour gets an intensity from its rain, gusts and thunder. The song builds for a few hours before rough weather arrives, swells at the peak while a low drum grows into a roll, and releases afterward with a sparser melody and more reverb. When the sky clearly brightens or darkens, the song changes mode on the same root, so a stormy morning that clears can end in major. A calm day keeps one mood and just breathes with its own small changes.

The theory rules are short: every note stays in the scale, beats 1 and 3 land on a note of the current chord, big leaps move an octave closer, and every section ends on the root or the fifth. The chord-tone rule did the most to make it sound composed instead of random.

Three of the sample days show the range. A 47 °C July day in Phoenix plays in C Lydian on a reedy pipe, with a soft arpeggio running through the clear daylight. A drizzly London day plays in F♯ minor on plucked strings over ghostly, wordless voices, with the rain beat under every hour. An Oslo snowstorm plays in A minor on glass bells over a hushed choir, at 156 BPM because of the wind.

The hardest part was ordinary weather. Extreme days are easy to tell apart. When I listened to 89 everyday forecasts from 12 cities, too many of them sounded alike, and one organ pad played under 40% of them. So I moved the cut-offs to where everyday weather actually falls, split cloudy days into three different pads, and let calm days swell with changes measured against their own range.

The same place and day always give the same song, and the liner notes under each one explain why it sounds the way it does. Hear today's weather where you are.