- The missing comma on the first line of dBm_pan_volume's definition
looked suspicious, so I checked the MIDI specification at
http://www.midi.org/techspecs/rp36.php and found the equations
there gave different dB values than were in the table. So I
rebuilt it using the equation given there:
20*log (sin (Pi /2* max(0,CC#10 – 1)/126))
According to blzut3, it looks like it is a byte followed by a variable length field. It can be any value 0-15 and will be followed by that many bytes one for each bank used. If the bank count is 0 then it is shorthand for using one bank (bank 0).
-- errno.h is required for 'errno';
-- don't use str(n)casecmp and rely on ZDoom CMake handling;
-- add a missing parenthesis around a 'signed char' cast;
-- remove an unneeded GNU_SOURCE redefinition;
-- the non-MSVC side of snd_mididevice was not adapted to the new code, making wildmidi unavailable through the menu.
- Besides being little-endian centric, this bit shifting madness
was unneccessary since the values were already clamped to a 16-bit
range, so all we need to do is cast them to a short.
- In order to use ZDoom's own MIDI sequencer event handling must be
completely separate from mixing, but WildMidi had them intertwined
because it wasn't designed for external sequencers.
- Also remove all 'long's defining the output buffers to avoid having
something that's 32 bits wide on Windows and 64 bits wide on Linux.
The pointless error message in WildMidi_Shutdown was removed to keep the rest of the code simple and allowing to call this even when the device never was used.