Added serial interface over USB.

Squashed commit of the following:

commit f749a2b05fbb89c4bb2cdcb456aa781680d4eee2
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 18:56:44 2012 +0100

    I should do this in a separate branch.

    Revert "Started work on refactoring comments."

    This reverts commit 1f5f41140c4a1e3f2234050234a0df9159d261a6.

commit a7ab98c8432f94dea6327db6eaee53c3f313b4e8
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 18:49:03 2012 +0100

    Cranked up the speed.

    It turns out it works just fine at 115200 baud.

commit 35d59f24c42f373365cdce9c2c3e2403d20e0f56
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 18:47:05 2012 +0100

    Consistent constant naming.

commit bf44fcfc7aae6b9443b31bda268c7783c681ff0a
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 18:38:12 2012 +0100

    Updated byte positions in documentation; removed to-do list.

    The only other item was to fix the run/stop display, and I've realised
    it's not really broken so much as lagging.  It doesn't show the
    latest information the same way that the cursor (highlighted row)
    doesn't sweep down automatically.

commit 01d500eb11217dab9d5f12f2d1cfe38511e82bc9
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 18:33:21 2012 +0100

    Added to-do list.

commit 711a9a9bf6dd1a8ccd09a3f65bfb11bd73adeba2
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 18:31:16 2012 +0100

    Pitch fix.

commit b233a9d70f85336577e750fe2244f5b801c17aad
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 18:27:02 2012 +0100

    Hex fix.

commit 58bba9a4daeb16e39cd096773f0aacbb43f386b3
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 15:16:11 2012 +0100

    More visible improvement!

    You can now see the whole pattern on the screen.

commit def66bee44730fe0ed7453b0d3090665603813d7
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 15:13:19 2012 +0100

    Progress!

    It's definitely closer to working now, with decent
    not-quite-error-checking.

commit 6016fc792eb096fe96344516d59bd1c12fc447ae
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 14:50:13 2012 +0100

    Improved serial interface app's serial input.

    Still not seeing it working yet though in terms of updating what's
    on the screen.

commit d633c892db5342cb3de65d9c262202e03c89f29d
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 12:59:28 2012 +0100

    Further refined/tidied Stepper Acid's serial output.

commit 634c6ba62b3a6697f0a8f1ead34304885b1c3b59
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Fri Aug 17 12:42:38 2012 +0100

    Tidied up Stepper Acid's serial output slightly.

    I could probably do with prefixing each line with "GLOBAL " and "ROW
    01 ", so that the serial interface application wouldn't need to wait
    until it found another HEAD line to get its bearings.  That may even
    make the HEAD and FOOT lines entirely obsolete.

commit 10ed83a51f0514ffac49c34222f7f690023ee8c5
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 16 21:02:30 2012 +0100

    Trying out something else with the serial app.

    The main issue is that I'm reading a line at a time, whereas Stepper
    Acid's sending seventeen lines at a time.  This attempt at a fix is
    obviously quite bad and inelegant, likely missing lots of data and
    getting trapped for a while in conditions that won't be met.  I'll
    look into readlines() over at http://pyserial.sourceforge.net/ next,
    as that sounds like something I might be interested in.

commit 4e1643b5ab28e4996c4af7a75e953848a2632321
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 16 20:49:29 2012 +0100

    Revert "Getting Stepper Acid to talk more."

    This reverts commit ed78a20540e5ae5011c7d6cfc35ba5e6aa83bd67.

commit ed78a20540e5ae5011c7d6cfc35ba5e6aa83bd67
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 16 20:48:13 2012 +0100

    Getting Stepper Acid to talk more.

    It now outputs to the terminal every time the pattern loops.  It
    turns out this slows it down noticably, which is obviously very bad,
    and it still isn't helping out the terminal app, so let's revert
    this.

commit e12e7fe98a79da968fd483bfaa41f6de041d89f7
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 16 20:34:57 2012 +0100

    Making Python serial interface app more robust.

commit b86c6b12740945c8a0a163a9b40c690eab70ffcc
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 16 20:10:41 2012 +0100

    Fixed Python code.

    At least, I believe I have.  I need to fix more of the C code before
    I can test this bit.

commit a890f0386aec48ec238e3a1274b600abc0021c07
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 16 20:02:07 2012 +0100

    Fixed terminal output.

    It was missing the "row number" part, "RNxx", causing all the variables
    thereafter to be four characters out in their placement.  Or, rather,
    the variable placement was fine and the information surrounding them
    was out.

commit e18c156ba9846526d9bc332aaa290855dd807738
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 16 10:26:19 2012 +0100

    No longer treating pointers as arrays.

    As you can see, I'm very much still learning about arrays and pointers
    in C.

    Update: I figured this out after reading the examples in K&R ANSI C
    chapter 5.5, and was rather astonished to since find the exact same
    advice in chapter 5.3.  That'll teach me to skip ahead, but it's
    nicer to work things out for myself than have them explained to me
    first.

commit c79f581058118fd364e1d35ac179765363efc2b6
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 16 09:58:20 2012 +0100

    Forced two digit hex values.

commit 393e2bd2f9e932762373e251244dc26541ea15eb
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 16 09:05:16 2012 +0100

    Updated all remaining commands in serial interface.

    Note that a lot of the work has been removed from the application,
    as Stepper Acid is doing most of the hard work now that the two are
    segregated.

commit 63ef18f27c387eac036e800d946863009a3758a7
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 16 08:45:41 2012 +0100

    Implementing various commands.

    I can now use the Python serial interface to control the tempo of
    Stepper Acid's clock.  Probably other things too, but I haven't yet
    got the display part of the application working, so that's all I can
    tell from looking at the blinking light.

    Note that for changing the pattern, Stepper Acid, not the Python
    script, works out whether it should change the current or queued
    pattern.

commit 09f1c23a0fce17172a0cd7ccd20480b9a1a05b88
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 15 23:04:21 2012 +0100

    Removed redundant program.

commit 69f8412403a86c9798a6359f7e640fbe2e1f4650
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 15 22:54:09 2012 +0100

    Python command sending bugfix.

    It's now possible to start and stop the sequencer, at least.  Neat!
    :D

commit 75cc8cc27ab589bb0e7034cd9e0e88c607938612
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 15 22:50:06 2012 +0100

    Brought Python code in line with C code.

    In some respects, at least.

commit 811d39bfbf23648734fc887c3e49d963c57f297b
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 15 22:40:03 2012 +0100

    Revert "Revert "Updated documentation to match C code...""

    This reverts commit b2325ab27c3e653cf67f1f7a04d65e8273854b93.

    It definity should be this way around, and I remember why now!  It's
    not about making it easy to use (or at any rate, possible) from a
    dumb terminal, so much as it's about making it possible for the
    software to work out where the stream starts and ends, in case it's
    continuous.  Hence "HEAD", which can't naturally occur anywhere
    except the actual head of a burst of information.

commit b2325ab27c3e653cf67f1f7a04d65e8273854b93
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 15 22:39:15 2012 +0100

    Revert "Updated documentation to match C code..."

    This reverts commit ae85f670d96e2dc60654d840e44846d1466159d2.

commit ae85f670d96e2dc60654d840e44846d1466159d2
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 15 22:38:40 2012 +0100

    Updated documentation to match C code...

    but should it be the other way around?  The Python code matches the
    old documentation...

commit c60d354fcef8b13d8f3f6ed7b5294e1d0e7a28a9
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 15 22:17:28 2012 +0100

    Stepper Acid now compiles again.

commit 8d1b479545bcb67fa7145e06b0922021aae6269c
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Tue Aug 14 20:56:26 2012 +0100

    Fixed array of chars/pointer distinction.

    Now I'm making (slight) progress (I hope)!

    I think I'm still a bit hazy on when to have an array of characters,
    and when to use pointers.  In this instance, I only need to declare
    the whole thing once at startup, then I only need to change individual
    characters, and it never varies in size, so I believe I'm now going
    about it the right way.

commit 1f5f41140c4a1e3f2234050234a0df9159d261a6
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Tue Aug 14 20:37:56 2012 +0100

    Started work on refactoring comments.

    I might as well use my current confusion as a source of improvement.

commit db1b4e9e1d62645deb01431fe0633ef8a22cdd6d
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sun Aug 12 11:17:48 2012 +0100

    Removed ord()s.

    It looks like the string already consists of ints, not chars, for
    some reason I can't quite work out.

commit 86f2162cce005c583f5ddbd2fdf33eca6f596128
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Aug 11 21:47:35 2012 +0100

    Automated Stepper finding.

    I still haven't learnt yet that Python's always easier than I'm
    expecting...

    Never put off until tomorrow what you can do in Python.

commit 6b5b455af1fdb6f2415882bddd94f170875c10d8
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Aug 11 21:39:47 2012 +0100

    Still getting my bearings back...

    At least I can now get the device talking to my computer again.  It's
    plugged into a different arbitrary USB port now, due to me getting
    a new USB hub, hence the number change.  Eventually I'll automate
    the computer software finding the Arduino device.

commit 239010414aef02b9e0673b40f408399a9727931c
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 23 14:41:42 2012 +0100

    Bugfix.

    Not sure what I was thinking before.  All these things are one char
    long, not two.

commit 8a1f72c170b9b97070c4a02ba22f23a176f2e811
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 23 13:45:58 2012 +0100

    Getting my bearings.

    It's been three weeks since I've worked on this project, and I've
    completely lost my bearings.  Let's override what appears to have
    been a previous decision to show the pattern number, pattern length
    and tempo all at once, to bring this more in line with the prototype
    software and to make my life easier for the moment, not trying to
    do too much at once.

commit 6864c142255fffd65ab095ebb2314f2d1632c687
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 23 13:33:10 2012 +0100

    Added note to that effect.

commit 8d0b261b6c1ee7192fce600da44c091c33f6dec5
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 23 13:31:28 2012 +0100

    Plugging Stepper into a different USB port.

    Obviously, this should eventually be automated or at least let you
    specify the port on the command line.

commit 2e007eb7b31833db94b66b74ef1a621b6e7caac5
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 17:58:53 2012 +0100

    Settled upon a perhaps slightly more sensible, and certainly more terse, format.

commit 43c586c0455020d542e073c7e9165da29328cd2f
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 17:51:50 2012 +0100

    Started reworking Stepper Acid's serial protocol.

    By using the more long winded ASCII spelling out of things, we lose
    speed, but gain human legibility and, most importantly, the ability
    to tell if we're looking at the start of a cycle of information or
    not.

commit b5cf29fbf0cd290916d42acf015ed0fddf0dfc12
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 17:10:41 2012 +0100

    Trying to get it to do something.

    Other than crash.

commit 4ba84441db589c371d859593cf33c7f3ff5c7038
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 17:04:34 2012 +0100

    Progress!

commit e0c640976791d7234810cfc54d9217e663db5735
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 16:57:14 2012 +0100

    Renaming variables from Python versions to C versions.

commit d571b6ffa029799524cf69f9e5c74d1d0c7111e8
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 16:56:41 2012 +0100

    Ditto.

commit 461e739af4dc395e5c7a6b248a065edca7ab5844
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 16:55:06 2012 +0100

    Ditto.

commit db87024e819cd587694801c7555bd44a43f0b6e8
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 16:46:02 2012 +0100

    More work on serial interface client

commit a07eddc6686d491a01d4f523cdee8eba0395341c
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 09:47:04 2012 +0100

    Dispense with the pleasantries.

    Now we're outputting real information, let's forego the informal
    introductions.

commit 91b6ce1e7638c42534fae4a9423ec8599947a4d3
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 09:45:35 2012 +0100

    Exiting gracefully.

commit 742531f3e2d7ec3550f272062c08f17c4b8496ee
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 09:20:33 2012 +0100

    Bugfix: character encoding.

    Ah, this makes sense now.  Note to future self getting the '\xc2'
    error message: when you press #, which involves pressing the "alt"
    key on a UK keyboard, you sometimes accidentally press "alt-space"
    instead of just "space" afterwards.  This apparently makes a
    non-breaking space that looks identical to the regular one, except
    that it's non-ASCII-standard and breaks scripts.

commit 85f1268b0347e3cfc012c1a083f421ae46e3e205
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Sat Jun 2 02:27:10 2012 +0100

    Can't sleep.  Added serial output.

    It's completely untested on account of being in someone else's house.
    I also renamed an unrelated variable for consistency.

commit 07f1e121dbd3615af9f13bff22543c711d86fdff
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu May 31 20:29:42 2012 +0100

    Made programs friendlier.

    Although we're far from plain sailing as far as a remote interface goes.

commit a93839f7d69baa651a2fe1c8570c163d18aa3ea0
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu May 31 19:34:25 2012 +0100

    Added speculation of Stepper Drum commands.

commit e0b74c8577b22dcae802ba1d94251fd3bf752887
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu May 31 19:31:34 2012 +0100

    Added serial interface chart.

commit 5e7e51be34f9ba8c5c8485420efb191de18ec740
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu May 31 19:14:28 2012 +0100

    Make it possible to receive run/stop commands from the serial interface.

commit 39c8a5bb9060ace8f50c29f7fcdf7cceaf6313bc
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu May 31 19:08:42 2012 +0100

    Better.

commit 403c46da0f5ad9d5f33259952ac8d5274a0c96f3
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu May 31 19:04:46 2012 +0100

    Started work on simpler intermediate script.

commit 2f0e49c25e49bd7c5445dd408c2a1dbaa240ef95
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu May 31 18:59:47 2012 +0100

    Starting work on serial interface.

    It's a bit daunting though.  Let's try a simple intermediate step
    first.

commit 682bd5bddfa104e3ff87af2469ef03c65a10eb79
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu May 31 08:28:13 2012 +0100

    Started work on serial interface.

commit 40adce37806389dcdc2f7cc60319c59193fe2a00
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu May 31 08:18:30 2012 +0100

    Added magic maths.

commit 7dec38c61d88e2c3491d0b746e13e5553aeb6d6d
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu May 31 00:19:34 2012 +0100

    Organising input commands.

    Using more constants, and using a switch instead of many else-ifs.

    Bear in mind that both the physical buttons and the serial connection
    should be allowed to perform all the same tasks, so the intermediate
    step of translating the input into a constant number makes sense.