Commit graph

100 commits

Author SHA1 Message Date
Wohlstand
51079ac0cb libADLMIDI & libOPNMIDI: Apply the important fix
Fixed an incorrect timer processing when using a real-time interface.
This bug does directly affect the case of ZMusic which does use of RealTime API of both libraries.
2020-10-11 10:28:35 +02:00
Vitaly Novichkov
daf6321dbc ADLMIDI: Set the different gain per volume model
Different volume models were means louder or quiter sounding of the rest of notes in the song. And to avoid the mess between volume models, let's use different gain factor for each volume model?
2020-10-04 12:50:28 +02:00
Wohlstand
d4bd1a369f ADL & OPN: Added SysEx calls
They are supported by those engines and needed for XG and GS specific controls: GS custom drums are working and supported!
2020-10-04 12:50:26 +02:00
Wohlstand
3b37bcf684 ADLMIDI: Don't even try to load custom bank if disabled 2020-10-04 12:50:24 +02:00
Wohlstand
a574025373 OPNMIDI: Fixed an inability to load a custom bank 2020-10-04 12:50:22 +02:00
Wohlstand
b00f8c5431 ADL & OPN MIDI: Fixed some MSVC warnings 2020-10-04 12:50:20 +02:00
Wohlstand
0458a02d9f OPNMIDI: Try to remive the unistd header at PMDWin emulator
Seems it doesn't required here...
2020-10-04 12:50:18 +02:00
Wohlstand
115388800f Use the "Auto" volume model by default at libADLMIDI
After a small set of tests, it's fine to use the "AUTO" volume model by default.
Every embedded bank and every WOPL file has a setting of a volume model that matches to the behavior of the original OPL2/3 driver of each volume model.
2020-10-04 12:50:17 +02:00
Wohlstand
243aa96931 Update default bank and some settings of libADLMIDI 2020-10-04 12:50:14 +02:00
Christoph Oelckers
e504b2682e - embedded the default OPN bank directly in the binary so that it works, even if no custom bank is set. 2020-10-04 12:50:12 +02:00
Wohlstand
87d46ddd11 Update libOPNMIDI library to 1.5.0
## 1.5.0   2020-09-28
 * Drum note length expanding is now supported in real-time mode (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Added support for OPNA chip with Neko Project II Kai YM2602 emulator usage (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Added VGM file dumper which allows to output OPN2 commands into VGM file. (A new MIDI to VGM tool is now created with basing on libOPNMIDI)
 * Fixed an incorrect work of CC-121 (See https://github.com/Wohlstand/libADLMIDI/issues/227 for details)
 * Internality has been refactored and improved
2020-10-04 12:50:10 +02:00
Wohlstand
e6ce41bdde Update libADLMIDI up to 1.5.0
## 1.5.0   2020-09-28
 * Drum note length expanding is now supported in real-time mode (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Channels manager has been improved (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Nuked OPL3 1.8 emulator got some optimizations ported from 1.7 where they are was applied previously (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Reworked rhythm-mode percussions system, WOPL banks with rhythm-mode percussions
 * Added Public Domain Opal OPL3 emulator made by Reality (a team who originally made the Reality Adlib Tracker) (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Added LGPL licensed JavaOPL3 emulator made by Robson Cozendey in Java and later rewritten into C++ for GZDoom (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Fully rewritten an embedded bank database format, embedded banks now supports a wider set (more than 127:127 instruments in one bank)
 * Improved accuracy of the DMX volume model, include the buggy AM interpretation
 * Improved accuracy of Apogee volume model, include the bug of AM instruments
 * Improved accuracy of the Win9X volume model
 * Removed C++ extras. C++-bounded instruments tester is useless since a real-time MIDI API can completely replace it
 * Added AIL volume model
 * Added Generic FM variant of Win9X volume model
 * Fixed an incorrect work of CC-121 (See https://github.com/Wohlstand/libADLMIDI/issues/227 for details)
 * Added HMI volume model (Thanks to [Alexey Khokholov](https://github.com/nukeykt) for help with research!)
 * Added frequency models, assigned to every volume model: AIL, HMI, DMX, Apogee, 9X, and the Generic formula

# Conflicts:
#	libraries/adlmidi/adldata.cpp
#	libraries/adlmidi/adldata.hh
#	libraries/adlmidi/adlmidi.hpp
2020-10-04 12:50:08 +02:00
alexey.lysiuk
479f421007 - fixed event processing in XMI reader
Event pointer was moved forward twice leaving arbitrary garbage data in the stream

https://forum.zdoom.org/viewtopic.php?t=69631
2020-08-22 13:07:43 +02:00
alexey.lysiuk
f30265849f - timidity++: better handling of soundfont terminal preset record 2020-06-08 14:42:24 +02:00
alexey.lysiuk
bbf72c2891 - fixed switching of subsong for already playing GME song
https://forum.zdoom.org/viewtopic.php?t=67564
2020-02-26 12:49:23 +01:00
Christoph Oelckers
c57e16edf8 - use C++11 features to delete unwanted methods. 2020-02-26 12:49:21 +01:00
Christoph Oelckers
08f5a941c5 - fixed: StreamSong did not flag itself as stopped when non-looping playback ended. 2020-02-26 12:49:20 +01:00
Christoph Oelckers
6a2b4c5bef - fixed uninitialized variables in decoders. 2020-02-26 12:49:18 +01:00
alexey.lysiuk
42f732798d - fixed uninitialized variable in OPL song
Mono streams could be erroneously treated as stereo, doubling their playback speed

https://forum.zdoom.org/viewtopic.php?t=66939
2020-01-12 18:08:47 +01:00
drfrag
cb48b796a8 - Fixed compilation with MinGW. 2020-01-10 01:11:54 +01:00
Petr Mrázek
848438839b - Run the Alsa MIDI thread every 40ms or so, use non-blocking sequencer 2020-01-07 19:55:55 +01:00
Christoph Oelckers
1cf5ce6bab - fixed warnings. 2020-01-07 18:37:01 +01:00
Rachael Alexanderson
a085088893 - add EnumerateDevices for alsa per suggestion of the original author 2020-01-07 18:36:59 +01:00
Rachael Alexanderson
f67b217415 - fix compiler error with Alsa enumeration 2020-01-07 18:36:58 +01:00
Christoph Oelckers
ff3606e44e - refactored the MIDI list code.
Let's hope nothing got broken on the Linux side, the recent submission's code was not usable.

# Conflicts:
#	libraries/zmusic/zmusic/configuration.cpp
#	src/sound/music/i_music.cpp
#	src/sound/music/music_midi_base.cpp
2020-01-07 18:36:55 +01:00
Christoph Oelckers
dee8af1902 - made the sound decoding interface DLL friendly and added compile switches to the MIDI players so that different licenses can be uses as compile target.
# Conflicts:
#	src/sound/backend/i_sound.h

# Conflicts:
#	libraries/zmusic/mididevices/music_timiditypp_mididevice.cpp
2020-01-07 18:22:15 +01:00
Christoph Oelckers
b6577d9f55 - forgot to save this one. 2020-01-07 18:07:28 +01:00
Christoph Oelckers
e89cc73f80 - rewrote the ZMusic interface so that it is free of C++ constructs.
Now it is ready to put in a DLL.

# Conflicts:
#	libraries/zmusic/zmusic/mididefs.h
#	libraries/zmusic/zmusic/zmusic.h
2020-01-07 18:07:26 +01:00
Christoph Oelckers
f2a3a70aec - replaced the C++ based file access wrapper in ZMusic with a C compatible version. 2020-01-07 18:07:23 +01:00
Christoph Oelckers
7e01b19753 - there's no need to let the XM Vorbis decoder run through the client - all related functionality is part of ZMusic itself. 2020-01-07 18:07:21 +01:00
Christoph Oelckers
e5faff8cbb - made adjustments to the remaining parts of the function interface. 2020-01-07 18:07:19 +01:00
Christoph Oelckers
4e8359100f - made the ZMusic interface more DLL friendly: Reworked all functions not to throw exceptions across the library boundary and made a few definitions internal.
Not complete yet.

# Conflicts:
#	libraries/zmusic/zmusic/zmusic.h
2020-01-07 18:07:17 +01:00
Christoph Oelckers
353ffa2e95 - the timidity safe_malloc functions may not throw exceptions.
There is a high chance of them getting called within the stream servicing function which cannot deal with abnormal conditions, so the only choice here is performing a hard abort.
2020-01-07 18:07:15 +01:00
Christoph Oelckers
849bfb69b1 - blocked the destructor in the sound font reader base class.
If ZMusic is to act like an external library it may not call delete on external objects because there is no guarantee that they use the same allocator. Deletion must be done as a virtual function to ensure that the correct operator delete gets called, which, unlike the actual destructor is not virtual itself.
2020-01-07 18:07:13 +01:00
alexey.lysiuk
e1460eb050 - fixed crash during enumeration of MIDI devices
libraries/zmusic/zmusic/configuration.cpp:109:9: warning: returning reference to local temporary object [-Wreturn-stack-address]
2020-01-07 18:04:30 +01:00
Petr Mrázek
b07254507a - Support for MIDI on Linux via alsa sequencer 2020-01-07 18:04:28 +01:00
Christoph Oelckers
a92f71917a - apply the ZMusic mutex a bit more finely grained.
It should only guard the critical parts, like calling Stop() but can let Update and IsPlaying method work unhindered otherwise.
2020-01-06 01:30:55 +01:00
alexey.lysiuk
80a20d1b8c - fixed playback of gzip compressed music
https://forum.zdoom.org/viewtopic.php?t=66157
2020-01-06 01:30:53 +01:00
Christoph Oelckers
5544e50ca4 - fixed: ZMusic_Close may not lock the mutex because it will delete it.
Here the calling code must ensure that the music object won't be accessible anymore before it gets deleted.
2020-01-06 01:30:47 +01:00
Christoph Oelckers
2498fbf2b7 - Moved all music related synchronization to the top level
Most of the synchronization was too deep in the implementation so that it did not guard everything it needed.

Now each song has precisely one mutex which must be locked for all access to its internals - this is done in the public ZMusic interface
2020-01-06 01:30:45 +01:00
Christoph Oelckers
6b098107ce - ZMusic interface refactoring.
Use global functions instead of the class interface which exposed too many implementation details.
2020-01-06 01:30:43 +01:00
alexey.lysiuk
baa613ff62 - added dynamic loading of FluidSynth 2.x 2020-01-06 01:11:20 +01:00
alexey.lysiuk
f144af949b - return null instead of throwing exception if CD playback isn't supported
The game should switching to MIDI music on platforms without CD playback support
It was impossible to start Hexen on platforms other than Windows
2020-01-06 01:11:02 +01:00
alexey.lysiuk
fe76293f2d - handled differences of values returned by fluid_settings_...() functions
FluidSynth 1.x: these functions return 1 on success and 0 otherwise
FluidSynth 2.x: these functions return  FLUID_OK (0) on success and FLUID_FAILED (-1) otherwise
2020-01-05 21:09:31 +01:00
alexey.lysiuk
d7f0da033d - fixed setting of FluidSynth reverb and chorus 2020-01-05 21:09:29 +01:00
alexey.lysiuk
922eb28ca2 - fixed compilation with old versions of Xcode
libraries/zmusic/mididevices/music_fluidsynth_mididevice.cpp:628:3: error: use of undeclared identifier 'free'
2020-01-05 21:08:03 +01:00
alexey.lysiuk
9d49e33a80 - cleaned POSIX compiler arguments for libraries
Removed omission of frame pointers as it makes crash reports much less useful
Modified warning flags to hide annoying reports for external code
2020-01-05 21:08:01 +01:00
alexey.lysiuk
4c099300ca - implemented str(n)icmp function definitions via CMake macro 2020-01-05 21:07:58 +01:00
alexey.lysiuk
aa8438cb45 - applied fast math flags to C and C++ files
Avoid copy-paste using CMake macro

# Conflicts:
#	CMakeLists.txt
#	libraries/glslang/OGLCompilersDLL/CMakeLists.txt
#	libraries/glslang/glslang/CMakeLists.txt
#	libraries/glslang/spirv/CMakeLists.txt
2020-01-05 21:07:36 +01:00
alexey.lysiuk
49b8bedc86 - fixed: soundfont selection for FluidSynth was ignored 2020-01-05 21:06:42 +01:00