Clocks

Having built a switch its a very simple step to build a ticking clock. If you haven't looked at the previous switch example I suggest you go back and read that section. The only significant difference between the single switch sound and something that approximates a ticking clock is the complexity of the control code, the tunings of out metal click noises and the shape and size of the body object. Again we will build a metal click sound based upon filtered noise. We will then arrange those clicks into more complex patterns.

What is a mechanical clock?

Before digital watches a clock or watch worked using "clockworks". Clockwork just means an arrangement of real mechanical cogs, levers and springs. The main mechanical component of a clock is the escapement. Instead of an electrical battery the energy to work a clock was stored in a tightly wound spring or weights on strings, but to get the potential energy stored in the source to escape evenly, at a constant rate, a pendulum was needed. Huygens and Galileo are generally considered the inventors of the mechanical clock, having worked out that a pendulum in a constant gravitational field will always swing at rate determined only by its length. An escapement couples a pendulum to a circular cog so that the cog advances only one tooth of rotation for each swing of the pendulum. That turns a constant reciprocating motion into a constant rotational motion. There are many ingenious mechanical solutions to the escapement, including the Verge escapement, the Anchor escapement and the gravity escapement, each making a slightly different sound because of the way its parts collide and interact. Watches didn't really get going until John Harrison invented an alternative to the pendulum using counter balanced reciprocating wheels compensated for temperature and acceleration. This exceptional piece of engineering was done to claim a $20,000 prize offered by the British government since the realisation of a highly accurate chronometer revolutionised navigation and naval practice. For two centuries watches and clocks were based on Harrisons reciprocating wheel, the sound of which is what most people think of when they imagine a ticking watch. In case you are thinking clockwork is a dead art think again. Precision military timers still use clockwork since it cannot be destroyed by the EMP from a nuclear discharge, and radios for use in remote regions where there is nowhere to buy batteries also use the technology.

Materials and scale

Again we will be using mostly metal formants in the 4000-9000Hz range. Most of the parts in a clock are small, just a few millimeters or centimeters in diameter. However we can always build in ratio based scaling functions so that our clock can be scaled up from a small wristwatch to a mighty Big Ben or church clock.

Control code

The key to making a clock is in the control code. A clock is a deterministic chain of events, each one causing another. That is where the expression "working like clockwork" comes from, it is an allusion to the regularity and certainty with which an event will cause another to occur. Each operation, we assume, causes some kind of sound, a tick or a tock, a clunk or a click. The best way to model this seems to be with our old friend the delay chain. We will start with a regular metronome and feed each bang into a series of short delays to get a very fine grained sequence of control events. Most importantly this keeps everything synchronous. We don't have parts of a clock sound shifting around in phase, that sounds completely wrong, each tiny detail has to appear in its correct place on each tick.

Ticks and tocks

If you sample a real clock and slow it right down you will hear something interesting. Each tick is actually a fine microstructure, always the same, sometimes consisting of dozens of distinguishable events. What are these "tocks" that make up each tick? They are the movements of cog teeth against other cog teeth, of levers against ratchets and of the hands on the clock face moving and bouncing. To emulate this we will create little clusters of metal click events and call them "tocks" and then arrange these into "ticks".

Design

Okay, no time to lose, let's get to work. To keep with the work we developed in the last exercise I'll use the same code as the before to create a metal click. Here's the basic structure once more.

clock1

There is a slightly more efficient way of getting metalic sounding textures that we will look at soon, but for here it suits us to stick with the noise and filter based method as used before. Setting the [ead~] attack to one instead of zero stops us getting too much of a spike. (on some systems a zero attack for an exponential curve causes a floating point error, so be aware of that and careful if you are writing the algorithm as C code, thankfully this Puredata unit and many others wipe our ass for us and ignore divide by zeros)

Audio .mp3

Puredata file .pd

clock2

I've put three of those little cog chappies in one subpatch here, each with a slightly different tone. They are selected by a message [1, 2 or 3( which activates whichever one we want via the same inlet. A delay chain set to a unit time of 2ms fires off a little sequence of three clicks to make a "tock"

Audio .mp3

Puredata file .pd

clock3

Now we go up one level abstraction in the control code, by adding another timer and selector, this time using a metronome and [sel] unit to fire off tock1 then tock2. The two tocks are shown in the opened windows to the right in the above image, notice that they are slightly different in the sequence of clicks each makes.

Audio .mp3

Puredata file .pd

clock4

The escapement ratchet is the fast high ticking sound we hear in a clock or watch. If you like it is the master clock of the whole device so it operates at a multiple of the other cogs movements. Instead of using filtered noise for the escapement ratchet I've used a tiny blast of a sinewave at about 9kHz. Our ears aren't so good at detecting the subtlety of tone at such a high frequency, and the escapement wheel is often only about 5mm in diameter. Most of the high ticking sound comes from the little compensator spring attached to it which rings with a fairly pure bell-like tone at 9-10kHz. Lastly a delay based body resonator is added. Just like the switch it is intended to give some character to the sound. I chose some values that make it sound like a big plastic Mickey Mouse clock, an alarm clock.

Audio .mp3

Puredata file .pd

Links

Chronometer http://en.wikipedia.org/wiki/Chronometer

Longitude http://news.bbc.co.uk/1/hi/sci/tech/241228.stm

Clockwork radio http://www.enginuity.org.uk/enginuity/behind/clocside.htm

Next next tutorial

Top tutorials list

* number of ephemeris seconds in one tropical Earth year and the number of electronic ground state transitions of Ce133 in one SI second