re-enabled MIDI input for dev branch
added and integrated jiAssistant.js (incomplete)
continuing work on assistant (still incomplete)

- added jiAssistant.js to assistantPerformer.html
- which should now be okay.
- jiAPControls.js: added jiAssistant namespace etc.
- jiAssistant.js: minor changes
- jiSequence.js: added pubilc functions totalMsDuration() changeSpeed()
continuing work on assistant (still incomplete)

- jiAPControls: minor changes
- jiAssistent: changes re changes to Sequence (incomplete)
- jiMIDICHord: timestamps and msPosition are now separate attributes, since
               timestamps can change dynamically during an assisted performance
               and the msPosition is always the position in the score. The name
               of the callback has changed accordingly.
- jiSequence: added public function getSubsequences(). This file is now basically
              complete, though changes relating to performance opitons are likely.
continuing work on assistant (still incomplete)

-jiAPTracksControl: added function setTrackOn(trackIndex). Used to ensure that
                    the live performer's track is switched on for an assisted
                    performance.
-jiAPControls: integrated and debugged the new function.
-jiSequence: minor bug fix.
code still incomplete, but beginning to debug program
start.

- jiAssistant: minor changes
- jiSequence: major changes. Moved all variables and code which needs to
  be local to each sequence and subsequence inside the Sequence
  constructor. Other tweeks too.
- Subsequences now seem to load correctly.
- Running marker is not moving correctly. Probably there's a bug in the
  reporting of msPositions.
bugs fixed in subsequence creation

- jiMIDIChord: msPositionInScore now set correctly
- jiScore: barlines (except the final one) are no longer created as rests
- jiTrack: restStart and chordStart now deleted correctly in addMIDIMoment
Unassisted performance working correctly again

A MIDIMoment now always has at least one MIDIMessage, since
restStart moments now contain either the final messages from
the previous chord, or an 'empty MIDIMessage'.
(See the MIDIRest constructor and Track.addMIDIMoment())
Subsequences now constructed correctly

See comment on getSubsequences in jiSequence.js
Play score/live button now recalculates sequences

The Assistant constructor consumes the (complete) sequence it is given,
so the recalculation is done when toggling between the two kinds of
performance.
Bug fix; The performance pause and stop buttons now work correctly.
MIDI input working, need to debug subsequences

The first subsequence seems correct. It is played when a noteOn is
sent from the EMU keyboard, and waits correctly for a noteOff signalling
the following rest (live player playing the top staff of Study2b3). All
three tracks are playing correctly.
But when a noteOff is sent, the rest is omitted (=bug).
Bug fixed: callback pointers now stored in Assistant

The moving cursor now updates correctly.
Temporary commit: bug which requires many changes discovered

The running cursor is only updating correctly for the first live noteOn.
The fix will be to remove the cuurent msPositionInScore attribute
altogether from the first message in subsequences, and add an
msPositionInScore attribute to ALL sequences (a single assistant-
only sequence has msPositionInScore=0), then in sequence.tick(),
report (msg.timestamp+sequence.msPositionInScore) as the new position
for the running marker.
Partial bug fix

NoteOns sent to the Assistant are now working correctly: the
subsections are performing correctly, and the cursor is updating
correctly too.
Known bugs: noteOff should trigger first rest in bar 4
noteOff not working correctly when trying to play legato.
Cursor updating correctly in non-assisted performance

NoteOn and noteOff are performing correctly, but the cursor is not
updating for the rest in bar 4 of Study 2c3.1. When continuing,
the cursor remains a position behind where it should be.
Cursor updating correctly in slow live performances

Simplified Sequence.tick(). The cursor still updates correctly
in non-assisted performances. In assisted performeances, the cursor
updates correctly for both noteOn and noteOff if the key is held
down until the subsequence completes. If a noteOff is sent before
the subsequence completes, the cursor gets out of synch with the
audio (the audio is correct).
Cursor always updating correctly - other bugs

The cursor is now updating correctly in both non-assisted and assisted
performances. If a subsequence is ended prematurely by sending a
noteOff, the cursor now moves to the correct position when a noteOn is
sent.
Known Bugs: The stop marker is not working correctly in assisted
performances. Neither is the stop button.
In non-assisted performances, both are working properly.
Comments corrected, working on stop problems

Sequence.playSpan() now requires both callbacks to be defined
Assisted performance now respects start and stop markers

The stop button is also working correctly for both types of performance.
Reorganised how the input device is disconnected when an assisted
performance is stopped or paused.
Known bugs: 1. Performance controls need to work slightly differently for
assisted performances (no pause).
2. The live/score performance button should look different.
Assisted performances can no longer be paused.

Performance controls updated.
Bug fixed: the running cursor always returns to the start marker at the
end of assisted performances.
TODO: change the appearance of the live/score performance button.