store midi events for each tick, not just their counts
import pprint

pprint keeps coming in handy for debugging, so we might as
well permanently import it - shouldn't do any harm.
extract tick temporary variable
extract new tickMatchesIndex() to allow more sophisticated MIDI <-> note matching
rename sync() to genVideoFrames()
rename compareIndices() to alignIndicesWithTicks()
alignIndicesWithTicks(): improve docs and comments
getNoteIndices(): fix typo in docstring
explain logic behind alignIndicesWithTicks()
fix incorrect 'isRest' variable name and finish deciphering getNotePositions
don't trap Warnings
getNotePositions(): rename note to token
getNotePositions(): return parsed tokens

This will be used to compare source notes with MIDI notes.
break long line
rename loadedProject to lySrcLines
use midi.events.NoteEvent.get_velocity()

rather than assuming knowledge of event internals
genVideoFrames(): fix docstring indentation
revamp alignIndicesWithTicks() to synchronise based on pitches

This should now handle the case where the note corresponding to a
MIDI NoteOn event is transparent (i.e. invisible) via \hideNotes
or similar, and to some extent the case where a chord appears on
a beat where there are no notated notes.
README.md: fix nested list in Requirements section