Category Archives: Computing

StellarSynth Image

StellarSynth / Timbre Of Starlight

This is a fun one, a bit of art-meets-science, which I’m finding myself doing more and more of these days, seemingly by accident.

A chat on twitter with an online friend about aurora on other planets spiraled a little, and now there’s two different projects on the go, from literally opposite ends of a spectrum.

Gahlord Dewald is a Hawaii based experimental musician, mainly double bass and old-school (literally circuit-design) electronics driven. In his own words, he “operates along several axis: improvised to composed, acoustic to electronic, beat structure to chaos”.

I can play the bass intro to “Little Green Bag” on a guitar. Badly.

Gahlord’s “Timbre Of Starlight”

Geoff’s “StellarSynth”


But we both love a bit of starlight (Scotland and Hawaii both have that in abundance), and starlight is really interesting to compare to music. Everyone is familiar with a rainbow? A nice continuous spectrum of the visible frequencies of light, from violet through blues, greens, orange and red…some people can even detect slightly further, for example into the UV…if you’ve ever thought flowers at dusk looked brighter than they should, you might have been picking up the ultraviolet they reflect.

But the light from the Sun isn’t that perfectly continuous spectrum, it has very particular gaps, which appear as black lines….like this

A spectrum with various lines missing

Public domain, via Wikimedia Commons user

So we have a spectrum, measured in nanometers (a billionth of a metre) with particular lines missing. These lines occur because of the way individual atoms absorb and emit light, and it’s not just limited to the Sun. All stars do this…and clouds of interstellar gas, and the atmospheres of planets, and, in principle, the accretion disks around black holes.

Most modern astronomy is built on this idea: we can work out how abundant various elements are in anything we can see a bright light from. It’s incredibly useful.

But music…have a look at those wavelengths, in nanometers, again. Convert the nanometers to Hertz (“cycles per second”) and it’s bang in the middle of the human hearing range. So you can, mostly unscientifically, just “play” a spectrum. And it turns out to sound….interesting.

Gahlord is working on his own version from a very musical angle, with the beautiful name “Timbre Of Starlight“. I’m being far less artistic, and trying to stick to the raw data as much as possible, with a “playable keyboard” of the stellar elements. It reminds me of the Edinburgh University Design Informatics “Space And Satellites” art/science crossover project I was recently involved in, where we had a constant battle between “pretty” art and ensuring the originating data was justifiably represented (something the other artists, weavers, glassworkers etc also struggled with).

More to follow, both works very much in the initial stages


Gahlord’s “Timbre Of Starlight”

Geoff’s “StellarSynth”


Exoplanet Hunting (With Help From Tia)

As part of a course for work I’ve been tasked with completing a small project using one of a range of pieces of physics software. I picked one called Tracker, which allows you to track various physical properties in a video – including movement, acceleration, and light intensity.


Being able to track light intensity means we can simulate the “transit photometry” technique for detecting exoplanets – observe a distant star and look for periodic dips in the brightness as an exoplanet travels between us and the star, blocking some of the light.


To simulate this I used a spherical table lamp and a ball on a string hanging from the ceiling.  Note that the exposure setting on the camera is changed half-way through – the 50Hz flicker in the lamp due to the mains AC cycle is more obvious and produces more noise at lower exposure settings. Also note the upward spikes in luminosity just after the “planet” transits – this is due to the auto-exposure on the camera overcompensating, fixed exposure should ideally be used for this demonstration.



Because a ball on a string is effectively a pendulum, and because all “orbits” (including a pendulum) have the same period regardless of eccentricity (see tweet below), we can use a simple pendulum equation to get a good estimate of the period: T = 2Pi sqrt(L/g) , where L is the length of the string and g is local gravity.



With a string length of 1.63m we predict a period of 2.56s


Taking measurements of the minimal luminosity points on the right hand half of the graph we get the following periods:


2.49 , 2.53 , 2.53 , 2.53 , 2.53 , 2.53


Remarkably consistent, and taking an average of 2.52s it varies from our pendulum estimate by 0.04s, or 1.6% out.


Our main sources of experimental error are the 50Hz flicker on the lamp, the frame rate on the camera not necessarily catching the moments of maximal luminosity, and the autoexposure on the camera providing biased data. These could all be minimised by using a smoothing circuit or DC lamp for the flicker, and by using a high frame-rate camera with fixed exposure.  The latter solution could also reveal the characteristic details of the light curve that allow calculation of semi-major axis, star mass, star radius, planet radius, eccentricity, and inclination of orbit.


Note: The official installer for Tracker fails on an Ubuntu 20.04 system (previous versions on 18.04 worked), but it can be installed using the .deb file located here. I can’t guarantee unofficial sources, but are usually reliable.

The PiSBN Project

The PiSBN Project

In 2010 I was working in a bookshop and teaching myself the web scripting language PHP. A good way to learn a language is to find problems you can solve with it, and as I had recently been working with ISBNs, the identifying numbers given to printed books, I decided to write a program to search Pi for them.

I found the first three books in Pi. Then, a few years later, it got picked up by a few popular Twitter accounts and went viral, including a write-up in the science page of Der Spiegel.

What’s the point? There isn’t, other than a programming exercise and the pleasure of finding things out. But it does raise a few interesting things:

Is Pi “normal”?

Normal in this sense means “does it have the same numbers of each digit, 0-9?”
If Pi is normal then you’d expect every possible number sequence to appear in it. If it’s not (say, if you get to a certain point and then there’s never a 9 again) then it won’t. It’s generally thought that Pi is normal, but it’s still an open question in mathematics.

How does it fare with the old 10 digit ISBN?

As you’d expect, there’s about a thousand times more ISBNs if you search for the 10 digit version, as it’s a shorter string and more likely to appear in any random set of digits. Some ISBN-10s end in an X, which obviously doesn’t appear in Pi, but that can be ignored, we’re just messing about here. David J Fianders went to the effort of tracking down ISBN-10s.

It’s now out of date!

ISBNs are constantly being added for new publications, so it may well be that “my” first three books have been superseded. Feel free to try searching for new ones!