I’ve had some fun over the last few days putting together a little toy called Musicle. It helps you understand a bit about how the Western musical scale is put together and why the notes are the way they are, using something called an Euler lattice.

Musicle gives you a screen with middle C in the middle and a grid of notes around it. Notes to the left and right are separated by a perfect fifth (frequency ratio 3/2), and notes above and below are separated by a major third (frequency ratio 5/4). Believe it or not, the usual Western scales and notes are generated simply by powers of 3 and 5 (and 2, for the octave).

Musicle lets you play the notes, on their own or in combination, by clicking on them. Hold Ctrl if you want to play several notes together.

One of the things that becomes apparent when you start exploring is that the notes don’t quite line up with each other the way your musical theory might have led you to expect. Musicle shows the nearest note name to each pitch, but it also shows the distance of that pitch from the “normal” even-tempered pitch, in cents (100ths of a semitone).

To make it easy to explore without odd jumps, I’ve used Shepard tones.  You can turn this off at the bottom if you like, and you can also choose one of a very small number of instruments.

Musicle is mastered on github.

If you want to learn more about all this, take a look at xenharmonic or Kyle Gann or search for Just Intonation.

Comments welcome!

Twenty years ago today!

It’s a pretty big day for me today – in 1997, a brave kid headed out into the unknown and landed on the other side of the world. I left on 6 September, and arrived twenty years ago today with 91kg of luggage and a plan to do a PhD. It’s been a huge and eventful couple of decades and I had no idea of any of it back then!

Thinking back my main memories are people: my friends all gathered in Auckland airport singing “The Lord bless you and keep you” to send me off, my distant relative who helped me with my luggage and found a train that went direct from Haywards Heath to Glasgow without a change in London, my flatmates in Glasgow who knocked off my rough corners and taught me to be a better person. And of course everyone on both sides of the world and in between who has loved me and looked after me and helped me grow over the years. He tangata, he tangata, he tangata.

I found some embarrassing pictures in the attic which you might enjoy. If you want to know how different I was back then (hint: not very!), read my “blog” KeithNet (they hadn’t been named back then, but it was) And if you’d rather remember other things, there’s always Diana, Mother Teresa, and Cassini.

Thank you so much to all of you!

(originally posted on Facebook – now shared here)

“The Lord bless you and keep you…” Friends farewelling me at Auckland Airport.

Me with mum, dad, and Heather just before I left.

Me with Heather before I left.

Too much luggage! 91kg, if I recall rightly. It was quite a challenge lugging it on my own.

Me in my room in Glasgow (a few weeks later, after my shipping cartons had arrived).

ASCII Knitting

Inspired by Carolyn knitting another decoder hat like the one she made me, I’ve put together a little web app which lets you turn a message into a knitting pattern ready to be decoded by your geek friend! The instructions in the pattern for how to encode the message are quite involved, and I figured the whole process would be much easier if the computer helped out a bit more – after all, what knows codes better than a computer?

Various people have done something similar, often referring to the old essay HEX and BIN meet my friends Knit & Purl (which I had to recover from the Wayback machine!), but I haven’t seen anything that goes quite as far as this.

Enjoy – and share it around if you find it useful!


Along with Carolyn I was recently asked to become an elder of our local church, Brightons Parish Church, Falkirk. We were ordained as elders on 23rd October. We were asked to write a mini-biography to introduce ourselves to the church – obviously most of them know us quite well but it was good to be able to speak and reflect a bit more deeply about why we’re here. My article is reproduced below.

Keith Wansbrough – Bright Lights Nov 2016

Trust in the Lord with all your heart, and lean not on your own understanding; in all your ways submit to him, and he will make your paths straight. (Prov 3.5-6, NIV)

I was born in Auckland, New Zealand, and I grew up in a Christian family. I was always aware of God and learned lots about him and the Bible in Sunday School. As a teenager I attended the Auckland Baptist Tabernacle (founded by C. H. Spurgeon’s son Thomas), and after a summer camp when I was sixteen I realised I couldn’t just rely on my parents’ faith, I had to make a decision myself. I made a public confession of faith (through adult baptism) at that point, and have been trying to follow Christ ever since.

In 1997 I left home for the first time and flew to Glasgow to study for a PhD in Computer Science. It was a huge transition and I was very aware of God going before me and providing for me. It was during my time in Glasgow that I met Carolyn (at Queen’s Park Baptist). In 1998 my supervisor moved to Cambridge and I followed him there; Carolyn and I commenced a long-distance relationship which taught us a lot about communication. In Cambridge I helped with the church youth group and attended an intense and rewarding multicultural Bible study group for graduates.

In 2000 we were married and Carolyn moved down to join me. We spent five years in Cambridge, during which time Aidan was born, but when Megan was on her way we decided to move back to Scotland to be close to family. Throughout our lives both of us had mostly attended city churches, but when we arrived in the Braes we were determined to join a local church and be part of a local community. Carolyn has told the story of how we were welcomed into Brightons when Megan was just six days old, and we’ve been here ever since! We transferred our membership, and Aidan and Megan were baptized here.

Over the last 11 years what I’ve most valued about Brightons Church is the sense of community, being part of God’s people working together where he has placed us. He has confirmed more than once that this is where he wants us to be and to serve.

One strand of this has been youth work: many years ago I was asked to help with the Junior Sunday School, and from there I progressed to Triple S, until soon after FLAIM was formed we were asked to join them. Working with the S1-S3 age group is so rewarding, as the young people are beginning to ask questions and develop a faith of their own. We’ve also been involved in the Holiday Club committee for several years. Our church is blessed with so many young people, and we have such a responsibility to teach them about Jesus and lead them to him; yet in doing this we find God speaking to us and blessing us also.

The opportunity to dig deep into God’s word with friends and talk and pray together in the fellowship group I lead on alternate Monday nights has been another strand – wherever two or three are gathered in Jesus’ name, he is there with us. More informally our friends in the congregation over the years have been a mutual support and encouragement.

Serving the church as a deacon, and now as an elder and Up and Coming convenor, is a third strand. I’m excited to have been asked to serve the congregation in this way, and I look forward to finding out what God is planning for us as a church. To God be the glory.

Police Bravery Award

We were quite amazed to get a Police Bravery award on Wednesday. The AP wrote a lovely story about what happened, which was taken up by the Edinburgh Evening News and several other Scottish papers. A snippet of it even made the print edition!

Story, archived version, archived/printable PDF. (The story is correct, but the headline incorrectly says he was on the A720 – he was on the M8 just after Hermiston Gait.)

The awards ceremony was quite an honour – red carpet, police horses, piped into the auditorium along with 58 other recipients, and a certificate and handshake from the Chief Constable of Police Scotland. So many amazing and inspiring stories.

We wish the man involved well.

Facebook threads: Keith, Carolyn.

Other articles: BBC, Police Scotland website / Twitter (intro arriving 1 2 3 4 everyone) / Facebook, Police Professional, Metaswitch newsletter, a friend’s FB post.