OK, that makes perfect sense, thanks. But then, a second question: from looking at the sheet, how do you know when the second note in each measure should start? It needs to start in the second semiquaver, but where is that information encoded and how do you know you don't need to wait for the white to finish?
They're sort of represented as voices. The top voice has a rest for half a beat, the bottom voice starts immediately and the middle voice starts after a quarter of a beat.
Al-Khwarizmi is right, the rests are not there - yet. The rests are very tricky (see other comment) to get exactly right. I've figured out most of the note timings to be precise enough to render the score accurately but the rests do not have any representation in a midi file, so you have to make them up as you go.
There are other problems like that, such as trills and other ornamentation, which show like a bunch of note on/off pairs in a midi file but as a single note with a decorator in the score. Reversing those is non-trivial, as are grace notes.
Rests are a non-trivial problem, even though they seem to be very easy to solve. The problem stems from the fact that rests have no representation in the midi file, so you need to figure them out. Because midi files can be quite messy if not done perfectly you end up with all kind of spurious rests. So I decided to leave them out for now, but they will be added as soon as I've figured out how to do them well enough that they are not a distraction or teaching people really bad habits. The spacing of the notes should be correct.
This is the single biggest item on my todo list right now, and I wished I had more time to dedicate to this project.
I'm very much short on time at the moment, in fact, this weekend is the first time in a month that I have some time for myself but soon that will hopefully change and then I will be able to devote much more time to this project and some others that I'm tinkering with.