Commit Graph

829 Commits

Author SHA1 Message Date
Coen Rampen
d8491ecea4 AUDIO: Add default for OPL channel volume
This adds an option to the AdLib multisource driver to set the MIDI channel
volume that will be used to initialize to OPL 4x registers.
2021-10-09 16:59:44 +02:00
Coen Rampen
111b237e02 AUDIO: Fix Roland GS emulation not using MT-32 drumkit
The Roland GS MT-32 emulation option would not select the MT-32 drumkit on the
GS device, because the drumkit change was filtered out in the MT32GM driver.
This commit fixes this by adding an exception for this drumkit change when GS
MT-32 emulation is active.
2021-10-09 16:59:44 +02:00
Coen Rampen
2661548758 AUDIO: Fix stray ; and some warnings 2021-09-27 23:40:54 +02:00
Coen Rampen
5362b1b302 AUDIO: Add command queue to PC speaker emulator
This adds a command queue to the PC speaker emulator for PWM-style sounds that
need timing of less than a millisecond. The play method only supports
milliseconds and requires real time control, which is difficult to achieve with
microsecond timings.
The new playQueue method allows you to queue up playback instructions with
microsecond timing, which are executed when audio samples need to be generated.
2021-09-27 21:45:40 +02:00
Cameron Cawley
c2bbccd1db AUDIO: Support using .wav files for extracted Audio CD tracks 2021-09-07 14:35:43 +03:00
Eugene Sandulenko
198975a007
AUDIO: Fix message format 2021-08-23 16:26:31 +02:00
Coen Rampen
c0388b833c AUDIO/MIDI: Fix OPL empty instrument check
The empty OPL instrument check would check only the ADSR envelope fields for 0,
assuming this would mean the instrument would produce no sound. However, some
of these fields are flipped, i.e. max value would produce no sound. So this
shortcut was invalid. It is replaced by checking all fields for 0.
2021-08-14 21:48:10 +02:00
Coen Rampen
1b6b124c57 AUDIO/MIDI: Clear timer registers in OPL driver init 2021-08-14 21:48:10 +02:00
djsrv
22775dff7e AUDIO: Create Mixer::loopChannel() 2021-08-12 13:18:27 -04:00
Coen Rampen
dfb8db2ae2 AUDIO/MIDI: Add dual OPL2 support to Miles AdLib driver
This adds support for the dual OPL2 chip configuration to the Miles AdLib MIDI
driver.
2021-08-12 14:30:52 +02:00
Coen Rampen
0245ae15b0 AUDIO/MIDI: Add reset source volume to multisource drivers
This adds a convenience function to reset the source volume to the source
neutral volume.
2021-08-08 22:12:06 +02:00
Coen Rampen
7fb83e71b5 AUDIO/MIDI: Add timer proc to null multisource driver
This adds a timer proc to the null multisource MIDI driver to drive the fading
process. The null driver does not have any audio to fade, but without this the
fades will just hang and isFading will remain true. The fades are now
effectively timers so game behavior will remain consistent whether MIDI is
turned on or off.
2021-08-08 22:12:06 +02:00
Coen Rampen
994609e91c AUDIO/MIDI: Make Miles pitch bend range v3 specific
Miles version 3 introduced support for the MIDI pitch bend range RPN using the
data entry MSB controller. The ScummVM implementation would also process this
controller for Miles version 2 games. This caused a problem in Ultima 8, which
used Miles 2 and which had MIDI data that contained some (probably leftover)
data entry MSB events. These had no effect in the original interpreter, but in
ScummVM they caused the pitch bend range to change, resulting in incorrect
playback.

This is fixed by only processing the data entry MSB controller events when
Miles version is set to 3.
2021-08-08 22:12:06 +02:00
Max Horn
1d7d03bd6e AUDIO: fix global constructor warnings 2021-08-07 10:46:14 +02:00
Coen Rampen
d65edaa6b3 AUDIO/MIDI: Fix Miles default source volume
The default source neutral volume for the Miles MIDI driver is set at 256.
However, the default source volume was the same as that of the regular MT-32/GM
driver: 255. This would cause a small volume decrease if a game did not set
source volume.

This commit fixes this issue by setting the default source volume for the Miles
MIDI driver at 256.
2021-08-06 21:01:09 +02:00
Coen Rampen
54663b953a AUDIO/MIDI: Fix Miles AdLib initialization
The ScummVM Miles AdLib driver would write some different initialization values
to the OPL registers than the original Miles drivers did. The most significant
difference was the amplitude and vibrato depth.

This commit changes the Miles AdLib driver to set the same values as the
original drivers. It also adds support for initializing a dual OPL2
configuration.
2021-08-06 21:01:09 +02:00
Coen Rampen
d73b19b9b3 AUDIO/MIDI: Fix Miles 3 AdLib pitch bend range
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.
2021-08-06 21:01:08 +02:00
Max Horn
34523aba7e JANITORIAL: Fix some typos 2021-08-04 15:43:15 +02:00
Coen Rampen
2edc3773bc AUDIO/MIDI: Fix Miles AdLib fades
This fixes some issues which caused the fades in the Miles AdLib driver to not
work properly:
- _timerRate was not set
- end of track meta event was not handled, so active fades were not aborted by
deinitializing the source on end of track
The timerProc fields and onTimer function were removed because they duplicate
functionality from the MidiDriver_Multisource base class.
2021-07-29 20:24:42 +02:00
Coen Rampen
aae00f50b1 AUDIO/MIDI: Added support for Miles v3 initialization
This adds a MidiDriver property which controls the Miles AIL/MSS version to
emulate. This controls the initialization of MT-32 and GM devices. MSS v3 added
GM support, which caused some differences between v2 and v3 in how MIDI devices
are initialized. Some games might rely on certain default settings for correct
playback.
2021-07-29 20:24:42 +02:00
Coen Rampen
e63b556015 SAGA: Add ITE MT-32 display message
This adds the message that the DOS version of Inherit The Earth displays on the
MT-32 when quitting the game.
2021-07-29 20:24:42 +02:00
Coen Rampen
55fadd03a1 AUDIO/MIDI: Change Miles AdLib creation type to multisource
This changes the return type of the Miles AdLib MIDI driver factory function to
the recently introduced superclass MidiDriver_Multisource, which allows for
easier use of multisource functionality for consumers of the factory function.
2021-07-13 22:11:58 +02:00
Coen Rampen
780d8d187a AUDIO/MIDI: Fix volume changes not applied by Miles driver
This adds applying source volume for all sources to the Miles MIDI driver. This
was missing and caused changes to user volume not to be applied for some games.
2021-07-10 20:33:35 +02:00
Cameron Cawley
674094016a AUDIO: Fix missing include 2021-07-09 17:09:32 +01:00
Coen Rampen
5c287139b3 AUDIO/MIDI: Add partial multisource support to Miles AdLib driver
Adds an implementation of the multisource interface to the Miles AdLib driver.
This partial implementation only supports the volume management functions and
the use of a single source (0), which is sufficient for most games (that only
use MIDI for background music). Full multisource support will be added later.
2021-07-09 15:20:50 +02:00
Coen Rampen
3c16991c05 AUDIO/MIDI: Add multisource support to QuickTime MIDI parser
Adds support for passing a source number to the MIDI driver to the QuickTime
MIDI parser.
2021-07-09 15:20:50 +02:00
Coen Rampen
9f96a86fec AUDIO/MIDI: Add multisource NULL MIDI driver
Adds a noop MIDI driver implementing the multisource interface.
2021-07-09 15:20:50 +02:00
D G Turner
99a1a90e76 AUDIO: Fix for GCC Warnings from 64-bit Stream API Changes 2021-07-09 04:23:10 +01:00
Paul Gilbert
005561d305 COMMON: Increase Stream pos, seek, size from int32 to int64 2021-07-08 18:24:28 -07:00
athrxx
8e0092c5d2 AUDIO: (Amiga) - adapt mutex handling to latest mixer code changes 2021-07-04 18:05:00 +02:00
Lothar Serra Mari
9dd2070243 AUDIO: MT32: Bump MT32 emulation code to libmt32emu 2.5.1 2021-07-04 16:28:57 +02:00
Coen Rampen
d897fe590e AUDIO: Fix struct and const init, add missing breaks 2021-07-02 15:40:13 +02:00
Coen Rampen
f660238ab5 AUDIO: Move MIDI multisource to base class
This moves the multisource functionality from the MT-32/GM MIDI driver to a new
base class so it can be reused by future multisource drivers.
2021-07-02 14:16:50 +02:00
Coen Rampen
d8c3e22a54 AUDIO/MIDI: Add multisource AdLib MIDI driver.
This adds a MIDI driver for AdLib / OPL2 and OPL3 with support for multiple
simultaneous sources of MIDI data. Additionally, it is easier to subclass the
driver and customize its behavior than the existing AdLib MIDI driver. The
standard behavior matches the Windows 95 SB16 driver.
2021-07-02 14:16:50 +02:00
Fiodar Stryzhniou
9bb3547dd1 AUDIO: SOUNDFONT: Fix warnings for header search failure.
WARNING: Can't find following headers in User or System Include Paths "vgmitem.h" "sf2file.h" "common.h" "vgmitem.h" "common.h"
2021-06-26 08:41:04 +03:00
athrxx
a370d45d98 AUDIO: (FM-TOWNS/PC-98) - adapt mutex handling to latest mixer code changes 2021-06-25 00:07:47 +02:00
Torbjörn Andersson
1bd7028c31 AUDIO: Added mutex() method to return the mixer's internal mutex.
This is so that individual audio players can share the same mutex as the
mixer. When they have their own, it's apparently quite easy to
accidentally introduce deadlocks. Particularly when the audio player is
shut down.
2021-06-24 20:38:38 +02:00
Torbjörn Andersson
ac596de969 AUDIO: Add missing mutex lock to isReady()
At least it seems to me that the way e.g. Lure of the Temptress calls
isReady() to see if the driver has finished processing all the custom
sounds, _sysExQueue can be accessed by two threads simultaneously.

Which seems like a bad thing to me!
2021-06-19 14:19:09 +02:00
Torbjörn Andersson
f7b96c57f7 MT32: Don't show LCD messages on-screen if they contain only spaces
E.g. the first message in Operation Stealth. It just looks like
something went wrong.
2021-06-12 13:14:51 +02:00
SupSuper
df4bf9d557 SCI: Fix audio resources being freed too early
Copy audio resource buffers as we don't have control over the lifetime of the resource.
2021-06-03 23:27:46 +01:00
Eugene Sandulenko
346dd65927
AUDIO: Do not crash on ImpulseTracker modules 2021-05-30 11:40:37 +02:00
Strangerke
e26e78f968 TRECISION: Update comment in wave decoder to mention trecision 2021-05-29 21:24:38 +01:00
SupSuper
e1e57e31ce AUDIO: Add PCM Mu-law and A-law decoders
Used by Nightlong engine
2021-05-29 21:23:01 +01:00
Matthew Duggan
0fb60cb3c0 AUDIO: Fix typo (missing comma) 2021-05-19 17:27:29 +09:00
Matthew Duggan
3f451c876e AUDIO: Use initializer list to ensure buffers are valid or null
Identified by coverity - if the module load fails, _mixBufferSamples could be
left as an invalid pointer, which would cause a problem in the destructor.

Moved most things to initailizer list to avoid the problem.

Coverity still identifies a lot of uninitialized members, but they should all
get initialized when playback starts and have less chance of causing real bugs.
2021-05-19 17:18:21 +09:00
Eugene Sandulenko
da75beb668
AUDIO: Added possibility to start MOD playback from a given pattern 2021-05-14 01:01:58 +02:00
Eugene Sandulenko
a332688ae6
AUDIO: Fix Mod sound looping 2021-05-13 15:35:40 +02:00
Eugene Sandulenko
2b29bcd1af
AUDIO: Make ModPlayer rewindable 2021-05-13 02:09:48 +02:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Filippos Karapetis
99e5de932e AUDIO: Remove the broken ARM audio rate converter
This code has been broken and unmaintained for at least 7 years now,
and had been disabled. This also removes the associated define
USE_ARM_SOUND_ASM
2021-05-04 01:16:14 +03:00