aliens

Author Topic: Roland MIDI support  (Read 2213 times)

Offline HunterZ

  • Sergeant
  • **
  • Posts: 33
    • View Profile
Roland MIDI support
« on: October 16, 2022, 10:02:16 pm »
The original game includes ROLAND.CAT and RINTRO.CAT files that, along with LAPC1.PAT, provide support for the MT-32/LAPC-I/CM-32L family of MIDI synthesizers.

I made a "mod" that overrides GM.CAT with a fixed ROLAND.CAT (from https://www.vogons.org/viewtopic.php?p=166565#p166565 - the newer official patch versions of X-COM have a broken one) and INTRO.CAT with RINTRO.CAT, but it still doesn't work quite right because the SysEx data in LAPC1.PAT doesn't get sent.

By sending LAPC1.PAT with an external tool (MIDI-OX), I was able to get full Roland support working in Windows 11 with my CM-64: https://twitter.com/HunterZ0/status/1581718795017949185

I would be willing to try implementing support for this myself and submitting via a pull request if the maintainers are interested. It would likely consist of adding support for a "ROLAND" music mode that uses ROLAND.CAT/RINTRO.CAT in place of GM.CAT/INTRO.CAT, just as the Adlib music mode uses ADLIB.CAT/AINTRO.CAT, plus sends LAPC1.PAT SysEx data on startup.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Roland MIDI support
« Reply #1 on: October 19, 2022, 03:20:40 am »
If you can code it, sure. Though you'll have to add the fixed ROLAND.CAT to the data patch.

Offline HunterZ

  • Sergeant
  • **
  • Posts: 33
    • View Profile
Re: Roland MIDI support
« Reply #2 on: October 19, 2022, 05:55:15 am »
If you can code it, sure. Though you'll have to add the fixed ROLAND.CAT to the data patch.
Yeah, I think the 3 things to work out are:
  • Figure out how to deploy the fixed ROLAND.CAT
  • Figure out how to derive the SysEx stream from LAPC1.PAT that actually gets sent by the original game (there seems to be some header/section/footer data that gets derived on the fly) - or just ship a canned .syx dump and stream that instead?
  • Implement Roland music mode, including logic to load LAPC1.PAT and stream it on MIDI init

Offline HunterZ

  • Sergeant
  • **
  • Posts: 33
    • View Profile
Re: Roland MIDI support
« Reply #3 on: November 06, 2022, 06:41:37 am »
Nevermind, trying to build OpenXcom in MSYS MinGW64 is too much of a mess:

The latest official release of yaml-cpp is broken, resulting in linker errors, and is the version shipped by both MSYS and Vcpkg package managers. They fixed the bug 6 months ago, but the latest release is 16 months old, so there's nothing the package managers can do about it.

Meanwhile, the MSYS MinGW64 packages for SDL1.2 also seem broken, as they also result in linker errors, and Vcpkg doesn't even ship SDL1.2 because it's deprecated. I also noticed a couple of bugs in OpenXcom's CMake goop for SDL if you're not using the 'deps' path.

This leaves me with either trying to download someone's arbitrary pre-built versions of the dependencies and hoping they work with current MSYS MinGW64, or having to build them all myself from source.

Offline Chuckebaby

  • Colonel
  • ****
  • Posts: 408
  • Chrysalis are people too
    • View Profile
Re: Roland MIDI support
« Reply #4 on: November 06, 2022, 12:31:23 pm »
I am curious, what kind of audio compression format was used for the audio samples (in the intro "warning", the screams in the game, etc.) ?