I've managed to get midi resources working in SCI1 for the most part. There is definitely some strange behavior:
- After the program change at the beginning of a channel's data, there must be a volume event, followed by a pan event. Otherwise, the first several seconds of music won't play. If it's a pan followed by volume (instead of volume followed by pan), the music will play, but everything will be panned to one side (despite the pan event).
- If channel 15 is present (this is where cue points and the loop point are specified), it must have (at time 0) a reverb event, followed by a pan event. Otherwise, the interpreter will hang shortly before the first "real" cue event, or shortly after the music starts if there is no "real" cue event.
- If channel 15 has any cue events (instead of just a loop point), then it *must* begin with a cue event (at time 0) with cue value set to 0 (otherwise it is subject to the hang described above)
This all seems very tenuous! ScummVM doesn't have any of these requirements, the sounds play fine without the specific events needed at the beginnings of channels.
Another thing that tripped me up was the loop value on the Sound object. You can't give the sound a number of times to loop. It's either infinity times (-1), or it plays just once (any value other than -1). I should have looked at the ScummVM source code before to see that this was the case.