This adds support for the "sequence branch index" feature of the XMIDI format.
These "branches" (positions in the MIDI bytestream) are defined in the track
header. I've added two generic methods to the MidiParser interface to set the
current parsing position to one of these positions, or to check for the
existence of a position with a certain number (this is needed for Ultima 8).
Additionally, I've added an option to the MIDI parser to prevent the parser
from starting playback immediately after parsing, so that a starting position
(or a track) can be selected first. Playback can then be started with the new
startPlaying method.
* MIDI/KYRA: Add channel locking and GM to XMIDI
This improves support for XMIDI channel locking and moves it from the KYRA
engine to the generic Miles MIDI driver. To support this, a source parameter
is added to the XMIDI parser and Miles driver so the driver can distinguish
several XMIDI parser instances sending MIDI events. I've also added GM support
to the generic Miles MIDI driver.
The previous implementation of channel locking did not always track and restore
controller values properly when unlocking a channel. Specifically, at the start
of Legend of Kyrandia, when Brandon talks to the tree, the tree "creaking"
sound effect uses some channels from the background music. The volume of the
music channels was not correctly restored, resulting in some instruments being
much louder then others.
Another issue was that volume was not always properly set when locking a
channel. In the Legend of Kyrandia intro, when Brandon is lifted up to the
house, some sound effects were missing because MIDI channel volume was 0.
This new implementation fixes these issues.
* MIDI: Suppress Miles controller warnings
Several Miles controller MIDI messages generate warnings in the XMIDI parser,
even though they are handled by the Miles drivers. I've removed these.
* MIDI: Fix Codacy issues
The Miles MT-32 MIDI driver extends MidiDriver_BASE, but does not
override its sysEx method, which does nothing by default. This
resulted in a few initialization sysex messages for The 7th Guest
not being sent.
I've added an implementation for this method.
Adapted from 3657db3a7b7bf640edb768f6ffc37df9d5073d22
My commit 0e734722 causes lockups in SCUMM (sometimes) and SCI (very often). I didn't like the way I had fixed this before, but in the end I now had to do it in a similar way.
Timers should be reset only the first time the enable flag is sent. This also requires some updates to drivers which didn't send these flags accurately.
- Increase internal sample rate to dividers of the actual chip clocks and fix other related things. This seems to improve certain sfx/noise generator like sounds. The performance still seems to be okay.
- Fix feedback glitch that caused some noise with certain instrument patches when playing short notes.
- Fix squarewave sound glitch (mute channels when volume is zero; this could also cause unnecessary noise).
- Some cleanup.
The previous fix did not work as the forbidden exception had no effect
since scummsys.h and thus forbidden.h had already been included prior
to the fluidsynth header being included. This also meant that undefining
the exception define after the header would have had no effect anyway.
This new solution was suggest by eriktorbjorn on bug #11278 and should
avoid the need to add an exception which would persist over the entire
source file.
The OPL3LPT is like the OPL2LPT with an OPL3 chip. Add OPL3 support to
the existing OPL2LPT driver.
There is no auto-detection of OPL3 capability. The user is required to
explicitly select OPL3LPT as their OPL device.
Tested with Sam & Max Hit the Road.
- move mac, pc speaker and fm-towns ims sound drivers into separate directory
(AdLib and MT32/GM drivers are still too entangled with common code to be moved so easily, especially MT32/GM. It would require lots of changes to the common code and possibly to all engines using the MidiDriver class. So I leave that for now.)
Paula low-pass filtering, as implemented by UAE.
The Amiga has two filtering circuits: a static RC filter
(only) on the A500, and an LED filter that can be enabled
or disabled dynamically.
By default, the Paula now doesn't apply the static RC
filter, but allows for enabling the LED filter (with
setAudioFilter()).
NOTE: At the moment, this code still uses floating point
arithmetics! It also calls tan() three times per
instantiation.
Fixes warning C4530: C++ exception handler used, but unwind semantics are not enabled
by disabling exceptions in the STL since ScummVM doesn't support them
This is another warning of the use of memset to clear a non-trivial
structure / class. This can be removed since the structure is cleared by
the constructor which will be called by the "new" so clearing this again
is redundant.