OPL emulation?

Moderator: Raze Developers

Guest

OPL emulation?

Post by Guest »

Will Raze have OPL emulation at some point? That's the way I played the music when I was a kid. :)
User avatar
wildweasel
Moderator Team Lead
Posts: 21500
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10, 21H1
Graphics Processor: nVidia with Vulkan support

Re: OPL emulation?

Post by wildweasel »

... Does it not already?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48325
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: OPL emulation?

Post by Graf Zahl »

No. The current OPL code cannot be used due to licensing restrictions. It's all GPL.
The Doom-based OPL doesn't sound that great anyway because the instruments don't match, which would leave libADL. That one's not bad, actually but with the current licensing quagmire it's not usable. So the only chance would be to adjust the player in EDuke32, but that one poses problems as well, because it's licensed under the GPLv2 with no upgrade clause! :( so I cannot integrate it in ZMusic and would have to write a standalone player recreating all the funcionality of ZMusic's sequencer.

The situation here is unfortunately an utter mess so I'm a bit stuck. That's the Build license's effects and the fact that nobody working on these games seems to have the slightest interest to at least present the non-Build code under a consistent and compatible license.
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia

Re: OPL emulation?

Post by Wohlstand »

Graf Zahl wrote:The Doom-based OPL doesn't sound that great anyway because the instruments don't match, which would leave libADL. That one's not bad, actually but with the current licensing quagmire it's not usable. So the only chance would be to adjust the player in EDuke32
I want to tell some:
- Yeah, I took the care to make the sounding being closed to original OPL engines like DMX, Apogee, AIL, HMI, and Win9x. Together with my recent updates, the accuracy is even more.
- About licensing, I have some cases when I can get at least LGPL licensing for my libADLMIDI and libOPNMIDI libraries:
-- Original code from which I made libADLMIDI, is GPL-licensed. I asked permission for LGPL, however, the author has asked me to make him the library based on his ancient state. Here is the awaiting PR for him https://github.com/bisqwit/adlmidi/pull/7 that he should review soon. That changeset is a solution for his condition that allows me LGPL licensing.
-- To have LGPL, it needs to use the Nuked OPL3 emulator which has this license. For the DosBox emulator, I need to ask the DosBox team for LGPL permission, otherwise, this code is GPL. Alternatively, I have the Opal emulator which is in the public domain (I asked its creator for the license, and they replied to me that all source codes include this Opal emulator, are in the public domain). Its limitation is that it doesn't support rhythm-mode drums at all, and it can work in OPL3 mode only.
- libOPNMIDI's base will also get an LGPL license with libADLMIDI because I had to use some skeleton code from libADLMIDI to build an OPN2 synthesizer on it.
-- There are some emulators with non-GPL licenses: Nuked OPN2 as the most accurate and CPU hungry emulator has LGPL license. Neko Project II Kai OPNA emulator has an MIT license. PMDWin OPNA emulator has a modified BSD license (without an advertising term). Faulty but old and well known GENS has LGPL, I took it from GME project originally.

The only condition when I can get libADLMIDI and libOPNMIDI cores being MIT licensed, I need to rewrite the whole skeleton of those libs. I had to rewrite only the next part:
- MIDI sequencer, I made it support seek ability and other features like nested and count-limited loops
- Chipset overlay that I use to unify the use of emulators
- At libADLMIDI, the whole embedded banks' database, now it majorly different from the original look
- And some other small parts...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48325
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: OPL emulation?

Post by Graf Zahl »

LGPL would be fine, but there's still one gotcha. Nuke.YKT put both NBlood and PCExhumed under the GPLv2 without an upgrade clause. But the GPLv2 is not compatible with the LGPLv3, and I have no idea how applicable the license is in the combined package, which is still governed by the Build license. My guess is, not at all, because it's the GPL code which needs to have a licensing exception, but not even my employer's lawyer could give me a good answer, especiallly because so much of this "GPL"ed code is reverse engineered, meaning that the license is most likely invalid to begin with (i.e. one cannot relicense the translation of other people's code.)

The only "real" (i.e. non-reverse engineered) GPLv2 code - EDuke32 and RedNukem - is gone anyway so I guess it'd be ok - but it's still a guess. Sadly, nobody in the Build community seems to truly care about properly licensing their code so that the compiled packages are governed by clear rules - BuildGDX isn't really any better licensing-wise.

As a result I only put code that's LGPLv2 or less into the 'lite' version of ZMusic.
User avatar
mjr4077au
Posts: 800
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: OPL emulation?

Post by mjr4077au »

If Duke 3D originally had the "or later" clause, is it within the EDuke32's rights to have taken it out?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48325
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: OPL emulation?

Post by Graf Zahl »

Unfortunately, yes. They cannot retroactively change the original code's license but they can put their own code under whatever license they want, as long as it is compatible.

Although it must be said that this license change was most likely an accident - it happened before the GPL v3 came to be - but I think it tells a lot that this was never corrected and that two derivate ports copied the license verbatim, despite not using any code from EDuke32 itself. And yes, this may become a problem later, should we ever manage to get rid of the original Build code, and the licensing status of the reverse engineered code gets cleared, as unlikely as it may be. Should the latter ever happen there may be no alternative to swapping out the NBlood/PCExhumed code for GDX, which is nominally licensed as GPLv3 (but with the same strings for reverse engineering attached to it, of course.)
User avatar
mjr4077au
Posts: 800
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: OPL emulation?

Post by mjr4077au »

I've been doing some reading and it looks like a fucking mess. However, Nuked OPL3 is LGPLv2.1 according to his GitHub repo which is compatible with GPL2 and doesn't need the or later clause, only LGPLv3 needs it.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48325
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: OPL emulation?

Post by Graf Zahl »

I know, but what LGPL are we actually talking about?
User avatar
mjr4077au
Posts: 800
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: OPL emulation?

Post by mjr4077au »

I thought there was concern about including Nuked OPL3 because of licensing woes but from what I've read there shouldn't be an issue?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48325
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: OPL emulation?

Post by Graf Zahl »

Both libADL and libOPN are GPL v3 right now, so it depends on what LGPL they can use.
User avatar
mjr4077au
Posts: 800
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: OPL emulation?

Post by mjr4077au »

But Nuked OPL3 is LGPLv2.1 and can be used without any compatibility concerns with GPLv2. It's considered a very good OPL3 emulator and of course is what's in EDuke32 at the moment (unless it has dependencies I'm am unaware of).
User avatar
mjr4077au
Posts: 800
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: OPL emulation?

Post by mjr4077au »

Ah hang on, I guess there's co-existence issues? I was only thinking of the Build game code and not much else I guess.
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia

Re: OPL emulation?

Post by Wohlstand »

Graf Zahl wrote:Both libADL and libOPN are GPL v3 right now, so it depends on what LGPL they can use.
I want to get LGPL2.1+, that because this license is most.often and most compatible with things around.
User avatar
mjr4077au
Posts: 800
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: OPL emulation?

Post by mjr4077au »

I've been reading more on libADL believe it's using Nuked OPL3 as LGPLv3 as Nuke has the upgrade clause in the licence. However that isn't helping Raze. What I was proposing in my discussion above was just using Nuked OPL3 without libADL to escape the issue of GPLv2 and V3 compatibility since Nuked OPL3s code being LGPLv2.1 can be directly used.

Return to “Feature Suggestions [Raze]”