Trivial optimisation.
Factory reset related bugfix.

The factory reset adding commit
(1dae338314fcb4bc602ca7b0ad012920ba9561e8) introduced a bug which
caused Stepper Acid to constantly output its status over the serial
interface.  This fixes that issue.

Now that the input variable is a signed int, it is large enough to
spot any genuine input in the range of 0 to 255, and on top of that
also accept -2 and -1 as examples of things that can't possibly exist
as real input bytes, the same way the EOF signal in <stdio.h> works.
Added DIN Sync (AKA Sync24) support.

There may be one or two timing issues.  It should be easier to verify
and fix them once we remove the serial interface later on, which is
causing its own timing issues.  In spite of apparent intermittent
issues, both the internal and external clock sources seem to work
OK once they get going.  If these turn out to be real clock issues,
we can fix them in the main branch later.

IMPORTANT NOTE: there has been a hardware change during the addition
of this feature.  The gate and accent outputs are now on different
pins.  Do not use previous versions of this software with the new
hardware, or vice versa.

Squashed commit of the following:

commit 6c71629a4a6a58fc95509fd4d68d1b291fd7f6bb
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 29 10:38:06 2012 +0100

    Fixed clock revamp.

    It's a compromise type fix: to circumnavigate the issue of the
    sequencer's position in the pattern glitching when the tempo's
    changed, the tempo change request is noted but only acted upon at
    the beginning of the bar, just like the pattern change request.

    This is less flexible, but it works, and overall this version of the
    internal clock is still a more elegant solution than the version
    that lets you change the tempo instantly at will.  In all likelihood,
    any mid-pattern tempo changing shenanigans (Belfast style) will
    likely be synced to an external clock, which works just fine.

    I've also changed the numbers output to the display to the requested
    pattern number and tempo, not the live ones, so that people playing
    the device live aren't flying blind.

commit 53605f11d91dfb7238e386ec7d6193082d4ea351
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 29 10:04:09 2012 +0100

    Note regarding the external clock:

    It turns out the "maybe 10BPM too slow" external clock issue was an
    issue with the clock itself, not Stepper Acid's interpretation of
    it.  So it appears that the external DIN Sync / Sync24 input is now
    working nearly flawlessly (it should be flawless once we add pull-down
    resistors).  I just need to fix the internal clock so that it works
    while changing BPM, and then I can merge this branch into the master
    branch.

commit 12a28895adc4add46417580ab6aeca56f5dd5c83
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Mon Aug 27 21:50:25 2012 +0100

    Spotted flaw with radical rewrite.

commit 5da2928a915c633f624e015fae2d3bc4568d952e
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Mon Aug 27 21:07:39 2012 +0100

    Note regarding the sequencer resetting:

    I believe commit 25c9364c91605ef851786245d0bdec8976461158 was
    successful after all.  It doesn't always sound it due to the last
    note staying on, and the new note linking to it, but I think it
    really is working.  I could fix this perception of it not working
    by forcing the gate off when the sequencer stops, but then I quite
    like the slow decay of the last note, and could see other musicians
    liking it too.

commit 0df4a01d1c44247aeff0adf88184d59cf519bb16
Merge: 25c9364 11159eb
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Mon Aug 27 20:29:18 2012 +0100

    Merge branch 'master' into sync24b

commit 25c9364c91605ef851786245d0bdec8976461158
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Mon Aug 27 16:40:02 2012 +0100

    Theoretically, fixed issue with the sequencer not resetting properly.

    In practice, I didn't.  Plus my Doepfer A-100 now won't turn on...
    -.-

    Update: phew, I've just blown a fuse.

commit cac2ba0a3bdb20434fdf8ead4627d8d4b4de71ad
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Mon Aug 27 16:14:48 2012 +0100

    Radical reworking of clocks.

    Also, as Stepper Acid's sequencer is only ever a slave to its own
    internal clock or an external clock, never feeding its clock to any
    other device, we probably don't need to differentiate between a
    request to run and actually running.

    Update: now the sequencer doesn't reset, as the clock doesn't reset.
    I'll have to reset the clock pulse count each time the sequencer
    goes from stopping to running.

    Update 2: when running, the sequencer is still constantly outputting
    information, which it shouldn't be doing.  So that wasn't caused by
    the timer interrupts (in the other sub-branch (twig?) of the sync24
    branch) after all.

    The timing's still unstable too, but that may well be due to the
    constant outputting.

commit a12a0af7b44de8603abead5215d12ff10ebc440a
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 23 21:30:08 2012 +0100

    External clock timing bugfix.

    Properly took advantage of interrupt, letting incrementClockPulseCount()
    finally live up to its name.

    Update: it now sounds like it's roughly the right speed, but still
    unstable.

    Second update: somewhere along the lines, the internal clock has
    stopped working too...  but only on certain rows, in patterns of
    certain lengths.  For example, if the pattern is 8 rows long, the
    internal clock pauses on rows 1 and 6.

commit 4e1e6746a3c6d9e4a1e411a7ad74fafc5f6eb79a
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 23 21:22:15 2012 +0100

    No change.  Testing note.

    Further testing with a fixed external clock to test with shows that
    Stepper Acid now receives the clock signal just fine until it gets
    to roughly 70BPM (give or take about 10BPM), then it doesn't get any
    faster, and starts to wobble slightly timing wise.  More than likely,
    the clock input is happening faster than the code can keep up with,
    and it starts to miss clock pulses.

commit 6a0fe9e76a329725f8f025a00b57c8680cf311e9
Merge: 163e834 1f481ca
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 23 18:29:49 2012 +0100

    Merge branch 'master' into sync24

commit 163e83450aaa50751fde06931e5fb8293584d5e9
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 23 11:27:36 2012 +0100

    Using an external interrupt for the external clock pulse signal.

    Still no joy, it's still playing very slowly.

commit 208b71fdb6f8372e303a112f78aea8df6bec1670
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 23 10:45:56 2012 +0100

    Bugfix.

    Ahem.  As well as moving one set of things towards a place, I need
    to move the other set of things away from it.

commit 571fece2ed466b5f4548aace3e93424fa66ae886
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Thu Aug 23 09:55:04 2012 +0100

    Hardware change!

    We're moving the gate and accent outputs from pins 2 and 3 to 4 and
    5, so that 2 and 3 are free for the external clock inputs.  Due to
    timing issues, we need to use attachInterrupt() to read the external
    clock, and that only works with pins 2 and 3.

commit 420bb0dfb480615931e1510b1003916849fb864c
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 22 21:31:24 2012 +0100

    Specifying the pin modes.

commit 383a87fbfafa5c42b47ef083880628237e91395f
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 22 21:27:09 2012 +0100

    Fixed comment.

commit 629f54ac9c1b691ba5f78cb1c2c56f8921d5e1fb
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 22 21:24:54 2012 +0100

    Wrote first draft of external clock reading code.

    Nina's building a test clock as we speak, so I'll hopefully get to
    test it later tonight.

commit cfd6e15b096ec8ee3236f58415c2184501d2ce42
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 22 21:09:07 2012 +0100

    Moving things, ready to accommodate external clocking.

commit c824b6991d95a8ea99e81c6c684daf5401862b18
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 22 21:01:27 2012 +0100

    Replaced comments with constants.

    New "digital pin" constants.

commit fb512d09f0ed0719385d98dcb1ed0404c2da9da5
Author: Zoë Blade <zoe@bytenoise.co.uk>
Date:   Wed Aug 22 20:59:09 2012 +0100

    Tidying comments, ready for more.