Final Project - Turing Machine
Working with Ruth Sergel on this project, an interactive documentary about Alan Turing built using the Processing programming environment.
Alan Turing was one of the pioneers of computer science, hence using a computer program to tell his (tragic) story is particularly appropriate. However, writing a computer program to tell story is quite awkward, compared to editing a video or using an authoring environment, so it makes sense to make the most of the limitations.
Therefore, the project makes ample reference to concepts of code and encryption, the underlying algorithms are a simple Turing Machine, and even the source code is displayed and used to share facts about Turing.
The physical interface, which Ruth is working on, uses a partially dismantled typewriter. The idea is to provide something of the look and feel of the Enigma encryption machines, whose codes were cracked by Turing.
Read past the link for more info on implementation...
This was a complicated project!
Processing is not really suited for interactive storytelling, with distinct "scenes". We ended up controlling program flow with a main case-switch, keeping track of which scene is active in a single variable.
Most of the debugging effort went into two areas:
1) The Sonia sound libraries
2) Dealing with the effects of interrupt-driven background routines
The Sonia libraries eventually turned out to be quite easy to work with, but there were a couple of major trouble areas. One is that you cannot create any of the Sonia classes until the Sonia library is actually started. It's not enough to load the library, the library has to actually be running for you to create audio classes. The error message returned is something really weird about file names. The second area of trouble was with playing multiple consecutive sounds, ie. stopping the currently playing sound before playing the next. This required very elaborate tracking of play states, in order to recall which is currently playing in order to stop it.
The second trouble area was that we were using movie playback and video capture routines, both of which rely on a background event handler. However, some of the major flow control variables were affected by these, which meant that the program could change states unexpectedly. It was very difficult to trace this back to the continuing execution of the background routines.
The short-term solution was to make sure that any background routines were stopped when not needed. The longer term solution is to ensure that all the major flow-control events happen in the main loop, not in background routines.
I suspect the program could be simplified further by making better use of object-oriented programming.

Comments
Random bit of national pride.
The cracking of the enigma was actually started by polish mathematicians, they had in fact a very very early electronic device to help with the cracking of messages.
When the war broke out the team moved to France, then onto England.
http://en.wikipedia.org/wiki/Bomba_%28cryptography%29
Posted by: Victor Vorski | December 12, 2006 07:18 PM