Commit Graph

607 Commits

Author SHA1 Message Date
NMIError
a24e3b2a4f MIDI: Add constant for number of tracks 2020-06-12 13:46:27 -05:00
NMIError
f497753b21 MIDI: Add support for XMIDI sequence branch indexes
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.
2020-06-12 13:46:27 -05:00
Lothar Serra Mari
b0b0e573fb MT32: Add missing default switch cases
See 4d911012e2 for reference.
2020-06-07 00:55:45 +02:00
Lothar Serra Mari
d831c5984e MT32: Fix MSVC warning
see 369ba0c4b7 for reference.
2020-06-07 00:55:45 +02:00
Lothar Serra Mari
cc5299961e MT32: Update to libmt32emu 2.4.0 2020-06-07 00:55:45 +02:00
Eric Fry
66f880812a AUDIO: Fixed formatting for sf loader functions.
Don't include sf loader support if compiling with fluidsynth 1.x
2020-06-05 20:57:54 +10:00
Eric Fry
d18f9734a1 AUDIO: Add ability for engine to supply its own soundfont data.
Add MDT_PREFER_FLUID to allow engines to indicate they prefer the fluidsynth driver.
2020-06-05 20:57:54 +10:00
NMIError
62387f8d38
MIDI/KYRA: Miles channel locking and GM support (#2273)
* 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
2020-05-29 17:50:14 +02:00
Matthew Duggan
a98617a843 AUDIO: Correct small errors in AMF loader
Crusader menu music now plays correctly, woo.
2020-05-03 22:52:45 +09:00
Matthew Duggan
a64462a60f AUDIO: Add support for loading Crusader AMF files 2020-05-02 20:09:23 +02:00
Matthew Duggan
79f151c6aa AUDIO: Import small fix from latest micromod/ibxm
Specifically, 9ff030a (Fix set panning command.)
2020-05-02 17:07:54 +09:00
Thierry Crozat
03cf6531a5 AUDIO: Fix mismatching malloc/delete[] 2020-04-27 23:06:15 +01:00
Matthew Duggan
07d734edf7 AUDIO: Small const correctness improvement 2020-04-17 15:02:11 +09:00
sluicebox
92b28e00ad AUDIO: Fix compiler warning 2020-04-11 03:30:35 -07:00
sluicebox
4ce7ae7bf5 AUDIO: Fix seeking past end of AIFF streams
Fixes audio in Mac versions of GK2 and PHANTASMAGORIA1
2020-04-11 03:06:41 -07:00
athrxx
5991e8cc07 AUDIO: fix compiler warning
(also remove translation for debug message, since we don't translate this kind of output)
2020-03-20 00:27:52 +01:00
Filippos Karapetis
121fb4798b MIDI: Added sysEx function to Miles MT-32 driver
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
2020-03-16 01:45:13 +02:00
Eugene Sandulenko
4da444f238 AUDIO: Added override keywords 2020-03-09 16:08:19 +01:00
Zvika Haramaty
3b4810aab4 AUDIO: Added dump-midi mechanism
This mechanism is enabled by '--dump-midi' command line parameter.
The midi events are printed to screen, and dumped to 'dump.mid' file.
2020-02-28 08:27:12 +02:00
NMIError
b2468d9442 SCI/MIDI: GS drumkits - comments and re-usability
- Move the GS drumkit fallback map to generic audio code for re-use
- Added comments and debug message
2020-02-16 13:33:45 +02:00
Paul Gilbert
1e2caf872b AUDIO: Ignore optional RBRN chunks in XMIDI files 2020-02-01 13:13:51 -08:00
athrxx
8014f12df3 AUDIO: (FLUIDSYNTH) - limit config.h include to builds that need it
makes life a bit more convenient for some MSVC users (or at least for me)
2019-12-20 15:30:48 +01:00
athrxx
6193b6ce22 AUDIO: fix AmigaOS build 2019-12-18 21:40:03 +01:00
athrxx
21b5f9262c AUDIO: (FM-TOWNS/PC-98) - fix regression from 0e734722
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.
2019-12-18 20:50:39 +01:00
athrxx
1083b94cbf AUDIO: (FM-TOWNS/PC-98) - set enum members to fixed values 2019-12-18 20:50:39 +01:00
athrxx
900dcc4de5 AUDIO: (FM-TOWNS/PC-98) - improve timer flags handling
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.
2019-12-18 20:50:39 +01:00
athrxx
711034b74d AUDIO: (FM-TOWNS/PC-98) - improve sound quality
- 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.
2019-12-18 20:50:39 +01:00
D G Turner
68758a879e AUDIO: Really Fix Compilation Against Fluidsynth v2.1+
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.
2019-12-17 04:21:04 +00:00
D G Turner
8593a9e1e4 AUDIO: Fix Compilation Against Fluidsynth v2.1+
This is as reported by eriktorbjorn.
2019-12-15 22:22:20 +00:00
Cameron Cawley
2048c9cc78 AUDIO: Remove unused parameter from the MixerImpl constructor 2019-11-30 17:47:34 +02:00
D G Turner
3959797b85 AUDIO: Fix Remaining Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-11-28 14:38:43 +00:00
Cameron Cawley
f2b9f7bb76 BACKENDS: Remove the Windows CE port 2019-11-17 22:33:56 +01:00
D G Turner
28287d70b6 AUDIO: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-11-17 08:20:01 +00:00
D G Turner
4d911012e2 MT32: Add Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-10-04 03:51:40 +01:00
athrxx
d097768e1f AUDIO: (FM-Towns/PC-98) - deconstructor/race condition fix
(move mixer calls before mutex lock, since the mixer has a mutex of its own)
2019-08-25 11:58:19 +02:00
James Ye
8170166d36 AUDIO: (opl2lpt) add OPL3LPT support
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.
2019-08-23 14:34:44 +03:00
athrxx
0e73472207 AUDIO: (FM-Towns/PC98) - cleanup mutex handling 2019-08-07 16:43:06 +02:00
D G Turner
a769bace7f AUDIO: (FM-TOWNS) Fix GCC Compiler Warning with Copy Assignment 2019-08-03 16:09:17 +01:00
athrxx
01f99f1a0a SCUMM: imuse driver directory cleanup
- 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.)
2019-07-14 21:45:43 +02:00
athrxx
9afdde2601 SCUMM: add Amiga iMuse sound driver
(applies to MI2 and INDY4)
2019-07-14 20:56:27 +02:00
Sven Hesse
b49c7fa644 AUDIO: Implement low-pass filtering for Paula
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.
2019-06-20 16:00:59 +02:00
SupSuper
8d17b6c48a AUDIO: Fix MSVC warnings
Fixes warning C4245: signed/unsigned mismatch
(seems in line with other decoders)
2019-05-09 18:13:10 +10:00
SupSuper
369ba0c4b7 AUDIO: Fix MSVC warnings
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
2019-05-09 18:13:10 +10:00
D G Turner
3de51cefd7 AUDIO: Fix GCC Compiler Warning in FM-TOWNS PC-98 Soft Synth
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.
2019-05-07 22:41:42 +01:00
D G Turner
21450facee MT32: Fix GCC Compiler Warning regarding memset usage 2019-05-07 01:39:12 +01:00
athrxx
1cfa6c087a AUDIO: (FM-TOWNS/PC-98) - silence some compiler warnings 2019-03-22 21:03:54 +01:00
athrxx
73678257b9 AUDIO: (FM-TOWNS) - turn warning into debug message
(no need to bother users with something that is actually intended behavior)
2019-03-22 21:03:53 +01:00
athrxx
b388f6d454 AUDIO: (FM-TOWNS/PC-98) - really fix NDS port build 2019-03-08 00:33:36 +01:00
athrxx
5e04dbcc6b AUDIO: (FM-TOWNS/PC-98) - hopefully fix NDS port 2019-03-08 00:18:14 +01:00
athrxx
8d4418fa36 AUDIO: (FM-TOWNS) - cleanup 2019-03-07 21:28:49 +01:00