Opened 9 years ago

Closed 9 years ago

#5524 closed defect

Hanging notes in KQ4 SCI with MT-32 (patch inside)

Reported by: SF/sven3000 Owned by: bluegr
Priority: normal Component: Engine: SCI
Keywords: Cc:
Game: King's Quest 4

Description

In King's Quest 4 SCI, if the music played when the unicorn is interrupted prematurely some notes can hang. This was observed with a real Roland MT-32 connected via USB MIDI cable, and with the built-in MT-32 emulator.

This is caused because a MIDI sustain controller message is sent on the channel in question (in this case channel 4; the MIDI data is B4 40 7F) to turn the sustain on full. The sustain message is not cancelled when the music is interrupted; only an "all notes off" message (Bn 7B 00; where n in the channel) is sent on all channels.

The issue could occur in any SCI game with a music track containing sustain messages, and probably also with other MIDI devices than the MT-32. I have only observed it in this specific scenario so far, however.

Since this issue did not occur with DOSBox, I captured the MIDI data it sent to the MT-32 by DOSBox. I observed that it paired a sustain off (Bn 40 00) message with each all notes off message.

Attached is a patch that modifies the MidiParser_SCI::allNotesOff function to send a sustain off message on all channels. This appears to fix the issue, but further testing may be needed to see if this doesn't have any side-effects.

This issue was observed on ScummVM 1.2 and 1.3svn54422 on Windows 7 x64, with game versions 1.000.111 and 1.006.004.

Ticket imported from: #3116608. Ticket imported from: bugs/5524.

Attachments (1)

midi_sustain.patch (487 bytes ) - added by SF/sven3000 9 years ago.
Patch to disable sustain in allNotesOff function

Download all attachments as: .zip

Change History (4)

by SF/sven3000, 9 years ago

Attachment: midi_sustain.patch added

Patch to disable sustain in allNotesOff function

comment:1 by SF/sven3000, 9 years ago

Component: Engine: SCI
Game: King's Quest 4

comment:2 by bluegr, 9 years ago

Thanks! Patch added in rev #54429

comment:3 by bluegr, 9 years ago

Owner: set to bluegr
Status: newclosed
Note: See TracTickets for help on using tickets.