First post, by Tristan
I found a bug in the patch cache code. When changing patches in MidiChannel::SetPatch new values are written into the patch cache however currently playing partials(on the same channel) still have a pointer to these cache entries. The end result is that currently playing partials access the new data and therefore behave incorrectly.
The bug fix I have added to my code allows each partial to have its own patch cache. The partials patch cache is only used if the partial is still playing when the channels patch is changed.
Dune 2 is known to be affected especially the end-game sequence which has a howling sound as a result of the bug. The changes I made also removed a bang/pop sound from both Ultima 7 and Kings Quest 6 (the beuty and the beast music). Other, less noticable, improvements may also be introduced by these changes.
Source files affected:
Code segment at line 1700 in my source tree.
Movement of tcache to the public section.
Addition of "patchCache cachebackup" to the
The latest Linux version (includes bug fix) can be downloaded from