Hi Alex,
> Thanks Pizza! So if there is a MIDI command with a > 0 delta time, does the song
> have to wait for this command to be sent before it can continue?
Yes. Think of a single MIDI track (which is what we have there) as a
single-threaded program in an imperative programming language where each
line has to look like this:
delay(<X>); <cmd>(<channel>, <parameters>);
or this:
delay(<X>); repeat(<parameters>);
and <X>, <cmd>, <channel> and <parameters> are the only things you can
modify.
Example:
delay(0); SET_INSTRUMENT(0, PIANO);
delay(0); PLAY(0,G);
delay(40); STOP(0,G);
delay(0); PLAY(0,F);
delay(40); STOP(0,F);
delay(0); PLAY(0,B_flat);
delay(40); STOP(0,B_flat);
delay(0); PLAY(0,c);
delay(20); STOP(0,c);
delay(0); PLAY(0,g);
delay(20); STOP(0,g);
delay(0); PLAY(0,e);
delay(40); STOP(0,e);
delay(0); PLAY(0,d);
delay(20); STOP(0,d);
delay(0); PLAY(0,g);
delay(20); STOP(0,g);
delay(0); PLAY(0,e);
delay(40); STOP(0,e);
delay(0); PLAY(0,B_flat);
delay(40); STOP(0,B_flat);
delay(0); PLAY(0,c);
delay(40); STOP(0,c);
delay(0); PLAY(0,G);
delay(40); STOP(0,G);
delay(0); PLAY(0,F);
delay(40); STOP(0,F);
delay(0); PLAY(0,G);
delay(0); repeat(D);
delay(0); repeat(B_flat);
...
(That's the beginning of the (well-known) piece I'd personally like to be
the background music of the game selection screen, once we have it. Since
it's transcribed from memory, it may be partially (or completely)
incorrect.)
Anyway, this is what a single track in an SMF (Standard MIDI File) looks
like, and SCI0 (unlike SCI01 and later) uses only one of these. Only later
on we'll have to worry about mixing several tracks (please correct me if
I'm wrong there).
llap,
Christoph