OPL emulation?

Moderator: Raze Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia
Contact:

Re: OPL emulation?

Post by Wohlstand »

The alternative way is making it work dynamically like a plugin:
- take all important calls you do use as function pointers into structure
- on load time, try to dlopen / LoadLibrary to find libADLMIDI.so/dll/dylib
- absence of library must don't hurt the work of game
- my friend Jean-Pierre Cimalando was made the same at DXX-Rebirth project because it had own license that incompatible worth the rest of universe
- about EDuke, I was fount that it do support cmdmusic way, I used that to use my opnmidiplay tool to play game songs, and that worked :)

On Linux it's very easy to build my libraries with the default CMake build system and install them into the system.
For windows I have the AppVeyor CI that builds me a wide set of variants for different compilers and build types. So, DLL can be taken.
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia
Contact:

Re: OPL emulation?

Post by Wohlstand »

Also, at my libraries is supported the ability to disable any unwanted chip emulator (for example, which has GPL license) by macros and by CMake flags.
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia
Contact:

Re: OPL emulation?

Post by Wohlstand »

P.S. "OPL Synth Emulation" may get an ability to change license if you allow it disable emulators that GPL-licensed. You also can take the Opal emulator from libADLMIDI that is public domain even it lacks a rhythm-mode and is OPL3 only.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: OPL emulation?

Post by Graf Zahl »

Wohlstand wrote:The alternative way is making it work dynamically like a plugin:
- take all important calls you do use as function pointers into structure
- on load time, try to dlopen / LoadLibrary to find libADLMIDI.so/dll/dylib
- absence of library must don't hurt the work of game
- my friend Jean-Pierre Cimalando was made the same at DXX-Rebirth project because it had own license that incompatible worth the rest of universe
- about EDuke, I was fount that it do support cmdmusic way, I used that to use my opnmidiplay tool to play game songs, and that worked
According to the FSF that is not sufficient to satisfy the license requirements. As things stand I consider the entire package licensed under the Build license, containing GPL code with a licensing exception. So the main GPL requirement that the entire package containing GPL code has to be licensed under the GPL has already been voided by this code's developers. And with a oackage that as a whole is not governed by the GPL, using a GPLv3 library as an external module is fine. It's still annoying to have code in there with poison-pill licenses, that applies to both Build and GPLv2 with no upgrade clause.
Gez
 
 
Posts: 17834
Joined: Fri Jul 06, 2007 3:22 pm

Re: OPL emulation?

Post by Gez »

I'm bumping this to mention the existence of YMFM, which offers OPL emulation under the terms of the BSD. I found out about it here, where Edward850 mentioned it was used to bring OPL emulation to SVE on Switch.

So integrating YMFM in ZMusic should allow to offer one type of OPL emulation in ZMusicLite -- even if it won't have the same multitudinous choice of cores as in ZMusic.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: OPL emulation?

Post by Graf Zahl »

Problem: This isn't a MIDI player, it's just the cores for the different chips. Sorry, I'm not qualified to write anything that can make use of these unless someone points me to some documentation.
Last edited by Graf Zahl on Thu May 27, 2021 2:26 am, edited 1 time in total.
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia
Contact:

Re: OPL emulation?

Post by Wohlstand »

Gez wrote:I'm bumping this to mention the existence of YMFM, which offers OPL emulation under the terms of the BSD. I found out about it here, where Edward850 mentioned it was used to bring OPL emulation to SVE on Switch.

So integrating YMFM in ZMusic should allow to offer one type of OPL emulation in ZMusicLite -- even if it won't have the same multitudinous choice of cores as in ZMusic.
I saw the set of these emulators, however, I didn't test them yet, thanks to that you had to poke me, I'll try to add these emulators to my libADLMIDI, libOPNMIDI, OPL3-BE, and OPN2-BE as an option. With this case when I finally replace all Bisquit's code from my libADLMIDI / libOPNMIDI with mine, I'll be able to license these libs as MIT in the condition they was built with license-compatible emulators, otherwise, the license depends on the emulators enabled in the build.
Gez
 
 
Posts: 17834
Joined: Fri Jul 06, 2007 3:22 pm

Re: OPL emulation?

Post by Gez »

For MIDI player, there's this: https://github.com/devinacker/ymfmidi
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia
Contact:

Re: OPL emulation?

Post by Wohlstand »

Gez wrote:For MIDI player, there's this: https://github.com/devinacker/ymfmidi
Looks like an interesting thing, I may try to take some from here and mix up with my libADLMIDI (and libOPNMIDI) to finally drop the rest of Bisqwit's code that is GPL. The half is already mine, I had to replace a lot of it. By the way, I checked the code and it mentions that volume models were not supported here. It's the very important feature I made to give the almost same sounding of every bank as they sounded in their original midi drivers (You can review some here, NukeYKT also helped me to develop the AIL, HMI, and DMX volume models being more accurate). Together with volume models, I developed the different frequency formula to get the same as the original midi driver, which is very important for drums, they were very sensitive to the frequency formula!

Devinacker's MIDI sequencer needs improvement as it doesn't support loop tags which is also an important feature I do have. By the way, I had to post my MIDI sequencer here https://github.com/Wohlstand/BW_Midi_Sequencer separately, It's internal libADLMIDI and libOPNMIDI's MIDI sequencer published as a general-purpose header-only library, I already use it with FluidLite at my MixerX fork and I do use it with Windows Native MIDI as an alternative sequencer that supports loop tags and other formats than just MIDI. However, MUS and XMI code at me is LGPL-licensed copypasta from the WildMidi, I must replace that with Devinacker's to resolve this license problem, however, I kept an ability to disable MUS and XMI to use the MID license.
Gez
 
 
Posts: 17834
Joined: Fri Jul 06, 2007 3:22 pm

Re: OPL emulation?

Post by Gez »

Wohlstand wrote:However, MUS and XMI code at me is LGPL-licensed copypasta from the WildMidi, I must replace that with Devinacker's to resolve this license problem, however, I kept an ability to disable MUS and XMI to use the MID license.

ZDoom has its own MIDI variants code (supporting MUS of course, but also HMI/HMP and XMI), couldn't you use that? I remember I plugged them into SLADE 3 a looooong while ago without much difficulty. ZDoom's code is BSD-3-point.
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia
Contact:

Re: OPL emulation?

Post by Wohlstand »

Gez wrote:ZDoom has its own MIDI variants code (supporting MUS of course, but also HMI/HMP and XMI), couldn't you use that? I remember I plugged them into SLADE 3 a looooong while ago without much difficulty.
I have the branch where I trying to implement the HMI support, but it's incomplete yet (I used GZDoom's code as a reference). My MIDI sequencer makes the full parsing of all music data and builds the internal queue of events in its own format that is easy to seek and play. I was lazy to make some, and I had to just use MUS2MID and XMI2MID until to parse, to play such files, however, I must do the direct parse of these files and fill the events queue directly than do that through the MIDI, this should simplify a lot of things

BTW, in the Slade you would use libADLMIDI and libOPNMIDI directly, they do have the built-in MIDI sequencer for the simple usage and native MUS support (even in the tricky MUS2MIDI, "it just works!" (c) Todd Howard), and you have to simply pass the music file's content as a memory block and play the song here by taking the PCM chunks in the common audio cycle. The more tricky is a real-time MIDI playing mode that needs you to count gaps between events and run PCM playing in a specific length to match the defined gap, etc. These libs were used with the real-time mode at GZDoom as it has own MIDI sequencer that is used here.

P.S. I do use command-line versions of libALDMIDI and libOPNMIDI bypassed into "Timidity" field, and this works :D
Снимок экрана от 2021-05-27 15-58-47.png
Post Reply

Return to “Closed Bugs [Raze]”