When the MUSIC_DEFAULT flag was removed, the logic for looping music was
accidentally inverted: Instead of everything except tracks 13 and 19
defaulting to looping, now only tracks 13 and 19 would default to
looping.
See b14a2599bc (SAGA: Get rid of the MUSIC_DEFAULT flag, 2014-07-20)
This commit adds a fallback for the GOG version of I Have No Mouth... This
version is missing the AdLib instrument definition files which are necessary
to use the Miles driver. If these files are missing, the regular AdLib driver
is used, which has built-in instrument definitions. A warning is shown so the
user knows the music is inaccurate without the missing files.
Miles 2 uses the default MT-32 pitch bend range of 12 semitones for its AdLib
driver. Miles 3 switched to the default GM pitch bend range of 2 semitones for
AdLib. ScummVM would always use the Miles 2 pitch bend range, which caused
pitch bend for Miles 3 games to sound wrong on AdLib.
To fix this, a property was added to the Miles AdLib driver to specify which
Miles version to emulate. Depending on the value of this option, the correct
default pitch bend range is set.
This fixes the fade-outs in IHNM, most notably at the end of the title screen
when using GM. Fades would take 30 seconds instead of the intended 3, and the
engine did not wait for the fade to finish but immediately played the next
track, which aborted the fade.
Note that the engine still does not always wait for a fade to finish when it is
triggered from a script. For example after AM's speech when dying in
Gorrister's chapter, in the original interpreter the music fades out while the
screen fades to black. In ScummVM, the screen does not fade out, so the music
fade is immediately aborted by playing the next track.
This limits the pitch bend and sustain reset messages at the end of MIDI tracks
to I Have No Mouth, And I Must Scream. Inherit The Earth does not use sustain
and pitch bend is already reset at the start of each track. IHNM does use
sustain and does not reset pitch bend at the start of each track.
A new MidiParser object is created every time a MIDI track is played, but the
old parser would not be freed. Fixed this by first deleting the parser before
creating a new one.
This removes the MusicDriver class, which was a subclass of MidiPlayer. The
MidiPlayer relies on MidiChannel objects for some functionality and has
problems with the Miles AdLib driver and Munt.
The functionality of this class is now implemented in the Music class. Volume
management is handled by the multisource MIDI drivers themselves, and added to
the Music class for digital and PC98 music.
We had an existing driver for that, so that could be hooked up rather quickly.
I haven't targeted the non-digital sfx for now, since I haven't fully analyzed whether they are even used. And it would require the reading of static data from the executable which we'd rather avoid.
The experimental/guessed approach works fair enough, but there is a bit more to it.
I also removed the GF_ITE_PC98, since the platform is not exactly a game feature and can just as well be queried via _vm->getPlatform().
This commit doesn't fix the missing speech during the chess game sequence. Might be a resource issue. I haven't looked into it...
The PC-98 version of ITE has music in a different format I haven't
identified yet, so normal music handling code chokes on it. For now,
simply skipping all music allows the game to run.
Note that this breaks the IHNM demo, as provided on the ScummVM web
page, since it doesn't have the sample.ad and sample.opl files
needed, but I have a feeling that this is a packaging error on
our part.
I don't have the original release of ITE, so I can't test that.
It already paused the music, but any notes that were playing were
just left hanging. At least with the ALSA MIDI driver. This was
quite annoying when using the debug console.
- The logo screens of all ITE versions are shown correctly now
- Wyrmkeep versions, demo versions with scene substitutes, demos with
mono music and demo versions with LE VOX encoded voices are all found
automatically now
The regression affected AGOS and maybe some others; specifically,
the real MidiDriver would have been deleted twice -- I previously
missed that the Engine instances takes care of freeing the real
MidiDriver, not the MidiPlayer wrapping it.
This commit should clarify the ownership of the real MidiDriver for
most pseudo MidiDrivers.