Five bells, no recordings: how Horologe's bells are computed

None of Horologe's five bells is a recording. Each strike is computed the moment it sounds, from a table of the bell's own partials: the frequencies a real bronze bell rings at, how loud each one starts, and how long each one takes to die. The whole app, four faces and five bells, weighs about three and a half megabytes. A single recorded bell, done properly, weighs more than that.

This is the post about how that works. It's a bit longer than the others, and there are two bells partway down that you can strike yourself.

A bell isn't a note

Press a piano key and you get one pitch and its harmonics: two times, three times, four times the fundamental, all lined up. A bell refuses to line up. Strike a tuned English bell and you hear, at the same time, a hum at half the strike note, the prime at the strike note, a tierce a flat minor third above it, a quint, and the nominal an octave up, which is the loudest of the lot. The minor third is why church bells sound sad. It's cast into the shape.

Above those five come the ones a campanologist can still name, and above those a dense family nobody names: in our Westminster voice, twenty-five more modes between three and a half and forty-one times the prime. That family is the clang. It's loud for a tenth of a second and then, because those modes radiate badly, it fades slowly and leaves a bright shimmer over the ring for a second and a half. Leave it out and you don't get a bell. You get an organ pedal.

So the table for one bell is thirty-three rows. Each row is a ratio, a starting level, and a time to silence. The hum in Westminster takes nine seconds to fall sixty decibels. The nominal takes about two and a half. The highest mode is gone in a fifth of a second. Mix them and you have most of a bell. Most, not all.

What makes it bronze rather than a synthesiser

Adding sines to a table is the easy part, and it's where nearly every synthesised bell stops, which is why nearly every synthesised bell sounds like a doorbell. Five things in ours are there to stop that.

After that, the sum runs into a soft-knee limiter that only touches the transient peak, the same trade every microphone preamp that has ever recorded a bell makes. Below the knee the signal path is linear. Put the output through a spectrum analyser and you see exactly the partials the table asked for, and nothing else.

Strike one

These two are the Westminster hour bell, the big one an octave below the quarters, and the Grandfather, which isn't a bell at all but the chime rods of a longcase clock, struck by a felted hammer. They're rendered in your browser from the same tables the app uses, ported to JavaScript, and they're dry: no room around them. The app and the front page put each in one. Turn it up, and press a button twice. The second blow isn't the first one played again.

E, about 165 Hz. Thirty-three modes, hum nine seconds.

C, about 262 Hz. A rod, not a bell: fewer modes, and the fundamental is the loud one.

Why not just record one

Because a recorded bell is a hundred takes, several hundred megabytes, a licence agreement, and the same tenth stroke forever. Loop it and there's a seam. Play it twelve times and it's the same blow twelve times. The other reason is smaller and we like it more: a computed bell can be struck at any pitch. The four notes of the Westminster quarters are one casting, scaled. That's how a real founder would do it too.

The honest cost is on our side of the counter. A new bell isn't a recording session, it's a tuning problem: the ratios and the decay rates have to be found and argued over until the thing rings true, and most attempts along the way sound like a doorbell. Five voices ship. Westminster and Whittington are tower bells in the minor-third family, one on E and one on G. Ship's Bell is small brass, high and short. Temple Bowl is a struck standing bowl on G, one note that takes a long time leaving. Grandfather is the rods.

If you'd rather hear them in a room, the front page strikes three. If you'd rather have one on your desk, it's $5.99, paid once, on the Mac App Store. And if you'd like to know what to do with the thing once it's there, start with the hour strike only.

Read next: How to make your Mac chime on the hour