Today it turns out that apart from Cal Henderson (a close friend of Tom's, who used the opportunity to take the piss a bit) nobody else contributed. How embarrassing! Nevertheless, it was an interesting diversion for a couple of hours. For an explanation of what I came up with, see Tom's analysis.
Anyway, I'll post the code here once there's a public release of Processing with which it will work. Until then, if you want to know more - or if you think I got it wrong - you can email me tom(at)tom(dash)carden(dot)co(dot)uk.