SCI: MIDI glitches on unpause/load
|Reported by:||lordhoto||Owned by:||bluegr|
|Cc:||Game:||King's Quest 6|
ScummVM trunk r52567 Linux/amd64 g++ 4.4.4
Happens with: King's Quest 6 German Floppy "1.000" (according to VERSION file) King's Quest 6 CD "1.000.00G" (according to VERSION file) King's Quest 5 CD "1.036" (according to VERSION file) I suspect it happens with all SCI games though.
After a song is unpaused there are many MIDI events, including note on/off events, pumped through to the MIDI synth. That results in ugly sound output and sometimes delays. I can reproduce that with both my sound card's wavetable synth and my MT-32.
I attached some savegames to reproduce this (be sure to select a MIDI synth!):
1) kq5cd.000: Just load the save game and you will hear some strange notes directly.
2) kq6ger.005 / kq6cd.015 Use the flute on the flowers. After some seconds of music playback (5 should be enough) move the mouse to the interface at the top, wait a second and move the mouse into the game screen again. You will hear some strange sounds now too. (For some more award sound just move the mouse cursor to the interface and back quite a few times in a row after the music played a bit)
3) kq6cd.003 Just load the game. You will hear around 9 seconds of strange music and after that the music is distorted (just leave and enter the scene again, it will sound differently). Note aside: I was not able to reproduce a savegame which is broken like this. Also when you load it with AdLib it will be approximately the same delay but without any sound output.
Another way to reproduce this is to walk into a scene where music is playing. Wait a bit so the tune is not near the beginning anymore. Then open the menu and either open up the save or load dialog, which will pause the music, and close those again. There will always be a few notes being turned on and off again. This makes it look like we do output all notes while seeking through the MIDI data, but that's just a guess from my side.
I could not reproduce any of this behavior with KQ6 German under DOSBox. It might also effect AdLib, but since there is no sound output for the problematic parts, I am not sure.
Ticket imported from: #3059948. Ticket imported from: bugs/5337.