Channel 03 / Class is in session

Data to sound

A phrase is just data. So is a column of numbers. Here is exactly how both become notes, with two live labs so you can break it and watch it recover.

Audio desk volume

Starts at 30 of 100. Both labs below share this fader. Nothing plays until you press a Play button.

CH 01

The one-minute idea

Sonification means showing information with sound instead of pictures. You already know a few. A Geiger counter clicks faster as the reading climbs. A parking sensor beeps faster as the bumper closes in. A kettle whistles when it is ready. In each case a number changed and your ears noticed before your eyes did.

Sound gives you three main dials to map data onto: pitch (how high), time (when, and how fast) and loudness (how strong). Timbre, the character of the sound, is a fourth. Aux Cord uses pitch and time, holds loudness steady so your ears stay safe, and lets you pick the timbre yourself.

The studio measures a phrase. The data lab on this page measures any list of numbers you give it. The recipe is the same: shrink the data into something small and exact, then spend that small thing on musical choices.

CH 02

From words to a number

Computers cannot play a sentence, but they can do arithmetic on one. First the text is normalised: lower-cased, trimmed, runs of spaces squashed to one. Then it is turned into UTF-8 bytes, the standard way text is stored as numbers between 0 and 255. Finally the bytes go through a hash function, which grinds any amount of input into one fixed-size number.

Aux Cord uses FNV-1a with 32 bits. It starts from a fixed offset and, for every byte, mixes the byte in with XOR and then multiplies by a fixed prime:

hash = 2166136261   then for each byte b:   hash = ((hash XOR b) × 16777619) mod 232

Three properties matter. It is deterministic: the same phrase always gives the same number. It is sensitive: changing one letter usually produces a wildly different number. And it is lossy: with only about 4.3 billion possible seeds, different phrases can occasionally share a tune. FNV-1a is not a cryptographic hash, so do not use it to protect anything. It is here because it is tiny and steady.

Hash lab
Tempo

Fixed at 110 BPM in the lab. Use the studio for the knob.

Normalised
--
UTF-8 bytes
--
Seed
--
FNV-1a, byte by byte (first six bytes)
#ByteAfter XORAfter multiply
Sixteen steps rolled from the seed
StepGate rollSounds?Move rollMoveDegreeNote
Open in studio
CH 03

From a number to a melody

One number is not a tune. So the seed feeds a small pseudo-random generator, mulberry32, which turns it into an endless but repeatable stream of values between 0 and 1. "Random" is a polite word here: start from the same seed and you get the same stream, in the same order, every time. That is the whole trick.

Aux Cord reads the stream like a script. One value picks the starting note. Then for each of the sixteen steps it takes two more:

  • The gate roll decides if the step sounds. On the four main beats (steps 1, 5, 9 and 13) it sounds if the roll is under 0.92. Everywhere else the bar is 0.62. Step 1 always sounds, so a loop never begins in silence.
  • The move roll decides where the melody goes next, from three degrees down to three degrees up the scale. Hit the top or bottom of the two-octave range and the walk bounces back.

A degree is a position in the scale. Degree 0 is the root, degree 1 the next scale note, and so on, wrapping into the next octave. Each degree maps to a MIDI note number, and each note number maps to a frequency using equal temperament:

frequency = 440 × 2(note − 69) / 12   Hz   (note 69 is A4)

Using a random walk instead of independent random notes is a musical choice. Neighbouring notes stay close, so the line sounds like a tune rather than static. Run the hash lab above and watch the move column: most steps nudge by one or two degrees, and the occasional jump of three feels like a leap.

CH 04

Any data, same trick

Phrases are a party trick. Real sonification maps measurements to pitch. The method is a straight line: find the smallest and largest value, squeeze every value into a 0-to-1 range, then stretch that range across the notes you want.

t = (value − min) / (max − min)   →   note = lowest note + t × range

Then you choose how strict to be. Snap to scale rounds every value to the nearest allowed note, so any data sounds musical, at the cost of hiding small differences. Smooth glide keeps the exact pitch, so small differences survive, but the result can sound out of tune. Try both in the lab below.

Snap to scale

Friendly and tidy. Two values that differ slightly may land on the same note, so subtle trends can flatten.

Smooth glide

Faithful to the data. Every value gets its own pitch, even when that pitch is between the keys of a piano.

Data lab

Separate with commas, spaces or new lines. The starting list is an illustrative example, not real data. Replace it with anything: sixty-four values at most, each between minus and plus one trillion.

Line chart of your numbers
What each value became
#ValueScaled 0 to 1Note
CH 05

Why scales keep it musical

A piano octave has twelve different notes. A scale is a hand-picked handful of them, described by how many semitones (piano keys) each sits above the root. Fixing the allowed notes is what makes random-ish melodies sound intentional. Below are the eleven scales the studio offers. Numbers are semitones above the root.

The studio's eleven scales
ScaleNotesSemitones above root
Major70 2 4 5 7 9 11
Natural minor70 2 3 5 7 8 10
Dorian70 2 3 5 7 9 10
Phrygian70 1 3 5 7 8 10
Lydian70 2 4 6 7 9 11
Mixolydian70 2 4 5 7 9 10
Major pentatonic50 2 4 7 9
Minor pentatonic50 3 5 7 10
Blues60 3 5 6 7 10
Harmonic minor70 2 3 5 7 8 11
Whole tone60 2 4 6 8 10

Fewer notes means safer. Pentatonic scales have five, and their notes rarely clash, so they are the best choice when you want any phrase to sound pleasant. Seven-note scales give richer, riskier tunes. Whole tone has evenly spaced notes and no obvious home, which is why it drifts. How a scale feels is partly culture and partly taste, so treat the moods in this guide as suggestions, not laws.

CH 06

Honest limits

  • The tune does not mean anything. A hash scrambles meaning on purpose. A cheerful phrase is not more likely to sound cheerful.
  • Ears are better at shape than at numbers. You will hear rising, falling and repeating long before you can name a value. Pair sound with a table or chart when exact values matter.
  • The mapping is a decision. Choosing the range, the scale and the direction (does bigger mean higher?) shapes what listeners notice. Say what you chose.
  • Outliers squash the rest. One huge value stretches the range, and everything else huddles at the bottom. Trim or transform first if that is not what you want.
  • Sound is not for everyone either. Sonification can open data to people who cannot see a chart, but it should never be the only way in for people who cannot hear.
  • Bad input never plays. Empty lists, single values, text, or numbers beyond a trillion are explained in plain words instead of being forced into noise. Identical values are allowed and play as one repeated pitch.

Try it yourself: put a rising list like 1, 2, 3, 4, 5, 6, 7, 8 into the data lab and listen to a staircase. Then try 1, 100, 1, 100 to hear a jump, and finally 5, 5, 5, 5 to hear what flat data sounds like.