Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add General MIDI Support #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nikitalita
Copy link

Since it seems the parent repo maintainer is not interested in this, I decided to see if you would be:

This adds MIDI Support to OpenTyrian.

This is accomplished with the use of two third-party libraries and the use of vcpkg to install them.

In order to get something that played nice with SDL audio and had support for software synths like fluidsynth and the Native MIDI driver (for macOS and Windows), and ALSO allowed direct control of the mixer so that we could continue to use the same mixing we already had, I decided to use SDL-mixer-X, which is a fork of SDL-mixer that has a bunch more of the interface exposed and support for changing the MIDI backend at runtime.

I also needed a library to convert the LDS files to MIDI, so I decided to take foo_midi's integrated midi processing and spin it off into its own library.

Since those would be a pain to install since they're not packaged for distributions, I decided to use vcpkg to manage those dependencies. This is optional; you can just build them with cmake and install them as you would normally with cmake install.

If you want to use vcpkg, just install vcpkg and then run vcpkg install (vcpkg install --triplet x86_64-win-static-md on windows) in the working directory; the makefile will automatically find them using pkgconfig.

The vcpkg packages are version-pinned using the vcpkg-configuration.json file.

@gobalius
Copy link

gobalius commented Nov 3, 2024

@nikitalita is there any possibility you could provide binaries for your fork?

@nikitalita
Copy link
Author

I can only provide MacOS binaries atm.

@gobalius
Copy link

gobalius commented Nov 4, 2024

@nikitalita OK, I understand. I guess I'll have to set up the build environment for Windows and build it myself. :)

@gobalius
Copy link

gobalius commented Nov 5, 2024

@nikitalita sorry to bother you... I managed to build it, but when I enter "Sound" menu and then "Music Device" the only option to select is "OPL3", none other. I have also tried placing a .sf2 file in the same folder as the .exe and setting it in the opentyrian.cfg file and still the same. What am I doing wrong?

@gobalius
Copy link

gobalius commented Nov 6, 2024

@nikitalita since your fork does not have the "Issues" tab, I will try my luck by reporting my problem here...
It seems like my problems are the result of not being able to install the dependencies with vcpkg. The command "vcpkg install --triplet x64-windows-static-md" fails as can be seen in the attachments.

vcpkg-fail.txt

install-x64-windows-static-md-dbg-out.log

If I manually run cmake on the midiproc-0.1.0 I get midiproc.vcxproj and if I use it with VS2022 the build fails.

midiproc-0.1.0-vs2022-fail.txt

To me it looks like the same problem that I'm too much of a noob to solve.
Help? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants