libADLMIDI icon indicating copy to clipboard operation
libADLMIDI copied to clipboard

legal status of the binary files in `fm_banks/`

Open fabiangreffrath opened this issue 1 month ago • 35 comments

Hi,

I am really sorry to open this can of worms, but I am considering to package this library up for Debian and I am seriously questioning the legal status of the literally hundreds of BLOBs in the fm_banks directory. Apparently, some of them have been ripped straight out of game assets. Anyway, the origin of all of these files is completely unclear. And while the project homepage claims that "other parts are licensed under GPL3+", I have to doubt that this can even apply to the files in this directory at all. I mean, I doubt that the binary formats of these files are the "preferred form of the work for making modifications" that the GPL demands.

I know that I can built the library without embedding any of these data, but then it just won't work out-of-the-box anymore. Is there some kind of a middle-way, as in "a reduced set of data that is guaranteed to be free under the terms of the GPL, which I can assure, because I am the sole author of these files and I have the sources and tools available to reproduce them"?

Again, I am sorry to dig up the dirt, but I am afraid I (or Debian, that is) cannot distribute the library with all this data embedded - but without this data it is close to useless. There must be some other solution.

Cheers,

  • Fabian

fabiangreffrath avatar Nov 21 '25 13:11 fabiangreffrath

Hello hello!

These banks are absolutely not required to be distributed at all, it's possible to just build the libADLMIDI with the complete disabling of embedded banks and forcing users to use external banks of WOPL format. The WOPL format is my invention that I made for libADLMIDI and for OPL3 Bank Editor to preserve the rest of known features of OPL2/OPL3 banks and its specification is placed at the OPL3 Bank Editor's repository.

Author of original adlmidi (the project from which I forked and started this) explained next regarding legal status of these banks, just his direct quotes:

The FM soundfonts (patches) used in the program are imported from various PC games without permission from their respective authors. The question of copyright, when it comes to sets of 11 numeric bytes, is somewhat vague, especially considering that most of those sets are simply descendants of the patch sets originally published by AdLib Inc. for everyone's free use.

Explanation: each bank file is basically a simple settings of chips. Each instrument is configured by 11-22 bytes number sequences (they are "attack", "decay", "release", "sustain", "total level", "wave shape", "feedback", "algorithm", "key-scale level", "frequency multiplication", etc.), they aren't kind of encryption keys or programs, they are result of fine tuning to make the chip to produce the specific sounding. They feels like has the same legal status as a preset for, as an example, filtering/reverb plugin like "room size", "dumping", etc.. And even more, the majority of these banks just a directive work from initial banks released by Ad Lib Inc. for everyone's free use. Speaking about banks for DMX, I have a contact to Scott Host who made an original one, and if it's REALLY need, I could ask him to make an explicit grant to these banks. But I think these banks basically has serious question why they should have any legal issues.

Actually, these files at fm_banks actaully aren't required for direct build (to just build the libADLMIDI from the scratch), they only required to build up the database at the src/inst_db.cpp file that is fully designed by me and it contains only chip's instrument settings.

As an other solution, knowing that these original files basically a set of settings rather than something special, I can just import these settings and save as my own WOPL format that is fully clear legally.

Wohlstand avatar Nov 21 '25 15:11 Wohlstand

Just: ALL these files can be explicitly edited and modified via OPL3 Bank Editor program that I made: https://github.com/Wohlstand/OPL3BankEditor It can read and write them as well. And the specification for each file format is included too. Some formats like IBK, AIL's AD/OPL, Apogee's TMB were already been widely known since Jammie O'Connel published header that describes his format, then John Miles releases all his sources for AIL library that uses AD/OPL files, and even builds them using AdLib BNK files. Apogee's Sound System library also became open source and its TMB format is also known. The DMX's format was been reverse-engined so deeply so it's also known. BNK files were known from AdLib's SDK. HMI's BNK files were known from the reverse engining. Junglevision's bank format is also known from the reverse engining. The only WOPL format is my direct invention that I made for everybody's use and the read/write module I licensed under MIT (I have its copy at both libADLMIDI and OPL3 Bank Editor).

Wohlstand avatar Nov 21 '25 15:11 Wohlstand

Also! During the build of src/inst_db.cpp, only content of these files (i.e. chip settings data) gets imported and saves in its own format. These original files (treated as "blobs") are never been embedded into the build directly.

Wohlstand avatar Nov 21 '25 15:11 Wohlstand

Also! Some of these banks were really been released with open-source releases of audio libraries (Apogee Sound System, FM Synth by Jammie O'Connel, AIL by John Miles), and these files were been included in their set. And some banks were just made from the scratch and released in this set like the DMXOPL bank made by @sneakernets (licensed under MIT).

Wohlstand avatar Nov 21 '25 16:11 Wohlstand

Thank you very much for your replies!

These banks are absolutely not required to be distributed at all, it's possible to just build the libADLMIDI with the complete disabling of embedded banks and forcing users to use external banks of WOPL format.

Right. And it would be cool if you could include some definitely-free-void-of-any-doubt bank in WOPL format that could serve as a fallback if none of the other banks are embedded into the binary. Currently it fails to do anything useful and reports "Bank is not set! Please load any instruments bank by using of adl_openBankFile() or adl_openBankData() functions!".

Explanation: each bank file is basically a simple settings of chips. Each instrument is configured by 11-22 bytes number sequences (they are "attack", "decay", "release", "sustain", "total level", "wave shape", "feedback", "algorithm", "key-scale level", "frequency multiplication", etc.), they aren't kind of encryption keys or programs, they are result of fine tuning to make the chip to produce the specific sounding.

Well, I'm not sure. By this argumentation you could say that a picture is "only a sequence of RGB-triplets", or a musical track is "only of sequence of notes", or that MS Windows is "only a sequence of machine code to get the CPU running". You get my point.

As an other solution, knowing that these original files basically a set of settings rather than something special, I can just import these settings and save as my own WOPL format that is fully clear legally.

But this still wouldn't change the spurious origin of the data.

Also! During the build of src/inst_db.cpp, only content of these files (i.e. chip settings data) gets imported and saves in its own format. These original files (treated as "blobs") are never been embedded into the build directly.

Yes, but you are still extracting data from these files. This is like using some bmp2c program to convert a picture into a char array, build this into your program and claim "I am not embedding the picture". 😉

Also! Some of these banks were really been released with open-source releases of audio libraries (Apogee Sound System, FM Synth by Jammie O'Connel, AIL by John Miles), and these files were been included in their set. And some banks were just made from the scratch and released in this set like the DMXOPL bank made by @sneakernets (licensed under MIT).

This is cool, maybe we find a solution to my concern. I'd like to do the following

rm -rf fm_banks/
rm src/inst_db.cpp
cmake -DWITH_EMBEDDED_BANKS=OFF

and still get a library that works out-of-the-box (with the limitations of only providing exactly one fallback bank), because it still has this one bank embedded that is free-beyond-any-doubt.

fabiangreffrath avatar Nov 21 '25 16:11 fabiangreffrath

Okay so, I can make the next, to ensure legal clearness I can make this:

  • Make the second directory close to fm_banks like fm_banks_free that will only contain fully clear in legal sense banks.
  • Make the second "banks.ini" file that will include only legally valid banks selected from the fm_banks directory (which are really sourced from the open-source releases of DOS audio libraries and licensed properly).
  • When producing fully legal-clear build the src/inst_db.cpp, the second variant of banks.ini file will be used instead of my primary one. And resulted inst_db.cpp will only contain banks with legally clear content.
  • I could include two variants of inst_db.cpp like inst_db_free.cpp and original inst_db.cpp, so it can work.

By the way, what about my second libOPNMIDI project, it never supported custom banks, but its terminal player can look for default bank at the /usr/share/... directory if install the thing into system and don't provide any bank file explicitly. And just, user applications always buldned a header-compiled xg.wopn bank that I built as a default bank for libOPNMIDI.

P.S. What about Apogee Sound System, just what their default bank is: https://github.com/videogamepreservation/dukenukem3d/blob/master/audiolib/SOURCE/GMTIMBRE.C#L20-L30, it's a structure of chip parameters, and array of 256 entries with different values. Each line in that array is an invididual "instrument" setup. Other bank formats are just similar. I already exported that and saved as related bank file. The final sound is produced by chip itself, it generates it using formula coefficients that came from these instruments. Just how it works:

  • Chip has only 18 channels (one channel - one note played at the same time).
  • Before playing a note, parameters from the bank gets written to the chip, and cihp starts to generate the sound defined by these settings.
  • Note gets played.
  • When playing different notes of different instruments, these settings on the chip gets dynamically replaced by other set, and the diffrent instrument gets played here.

~~Actually, sounds just absurdous that Western copyright allows to set a text file that contains just only single swear F-word.~~

And again, the legal status of such banks is extremely vague as original adlmidi's author says.

Wohlstand avatar Nov 21 '25 16:11 Wohlstand

Also! Some of these listed banks are just repeating each other, including banks in the open-source releases of audio libraries, and so, I can to just recreate them by adjusting of few options in open-source-released banks.

Wohlstand avatar Nov 21 '25 16:11 Wohlstand

Right now I started to make a total revision of existing banks and making a text file that describes all the banks. Just a note that the rest of IBK files in the fm_banks/ibk_files released under next terms since original:

SBTimbre 3.50

All of the IBK files have been provided for use with SBTimbre.
There is no royalty requirement for using any of these sounds in other products, and you may use them freely, as long as the product itself is not a collection of Timbres.

And few of these banks are licensed under MIT terms since they are included with open-source release of FM Synth by Jammie O'Connel

Wohlstand avatar Nov 22 '25 00:11 Wohlstand

Okay so, I can make the next, to ensure legal clearness I can make this:

This sounds like a good plan. But it won't be enough to move the files to a different directory and claim "these are free". Freedom is defined by the license and this in turn is granted by the copyright holder. As long as these information are missing, the files are to be considered as "all rights reserved".

By the way, what about my second libOPNMIDI project, it never supported custom banks, but its terminal player can look for default bank at the /usr/share/... directory if install the thing into system and don't provide any bank file explicitly. And just, user applications always buldned a header-compiled xg.wopn bank that I built as a default bank for libOPNMIDI.

It will be a good idea to look for additional banks in the file system. 👍

P.S. What about Apogee Sound System, just what their default bank is: https://github.com/videogamepreservation/dukenukem3d/blob/master/audiolib/SOURCE/GMTIMBRE.C#L20-L30, it's a structure of chip parameters, and array of 256 entries with different values. Each line in that array is an invididual "instrument" setup. Other bank formats are just similar. I already exported that and saved as related bank file.

Perfect, this is exactly what I am looking for! An actual source file with a copyright holder and a license. If you could include this file in the libADLMIDI sources and convert it to the WOPL format at build time, this could serve as the definitely-free fallback bank that remains embedded into the library no matter what.

Also! Some of these listed banks are just repeating each other, including banks in the open-source releases of audio libraries, and so, I can to just recreate them by adjusting of few options in open-source-released banks.

This is even better. The more reproducible the generation of the banks becomes, the more we could abandon shipping them as binary blobs.

Right now I started to make a total revision of existing banks and making a text file that describes all the banks. Just a note that the rest of IBK files in the fm_banks/ibk_files released under next terms since original:

SBTimbre 3.50 All of the IBK files have been provided for use with SBTimbre. There is no royalty requirement for using any of these sounds in other products, and you may use them freely, as long as the product itself is not a collection of Timbres.

While this is a nice gesture, it is certainly not a free license in the DFSG [1] sense (or by other meaning as defined by the FSF or OSI), as it (1) does not explicitly grant the right to modify the files and (2) imposes restrictions on their distribution (the "as long as" term).

[1] https://www.debian.org/social_contract#guidelines

fabiangreffrath avatar Nov 22 '25 10:11 fabiangreffrath

Perfect, this is exactly what I am looking for! An actual source file with a copyright holder and a license. If you could include this file in the libADLMIDI sources and convert it to the WOPL format at build time, this could serve as the definitely-free fallback bank that remains embedded into the library no matter what.

Among these IBK files as I said, explicitly licensed as MIT are presented, and they are taken from this repository: https://github.com/Jamie-MIDIOX/FMSynth/tree/main They are source/GENMIDI.IBK and source/DRUM.IBK, at my repository they placed under names fmsymth_internal_drum.ibk and fmsymth_internal_melodic.ibk.

Wohlstand avatar Nov 22 '25 11:11 Wohlstand

This sounds like a good plan. But it won't be enough to move the files to a different directory and claim "these are free". Freedom is defined by the license and this in turn is granted by the copyright holder. As long as these information are missing, the files are to be considered as "all rights reserved".

I meant, I will place to new directory only files are REALLY properly licensed files, other files will remain in their old directory. Apogee's and O'Connel's files are first that will come to that directory.

Wohlstand avatar Nov 22 '25 11:11 Wohlstand

While this is a nice gesture, it is certainly not a free license in the DFSG [1] sense (or by other meaning as defined by the FSF or OSI), as it (1) does not explicitly grant the right to modify the files and (2) imposes restrictions on their distribution (the "as long as" term).

I could request Jammie O'Connel (@Jamie-MIDIOX), the author of these files, to give more valid license to these banks so they will be no longer so restrictive. I.e. it's required to use license that explicitly grants redistribution and explicitly grants any modifications and re-use of the data. And, it does NOT sets any restrictions (that restriction that prohibits bundling "collection of timbres" seems doesn't have a sense in modern times), except of requirement to respect the authorship (i.e. giving credits and don't taking this and claiming "I did it!" when it's not), as an example what Zlib license tells. Because of that restriction, these files considered inapropriate for the official distribution for Debian.

Wohlstand avatar Nov 22 '25 12:11 Wohlstand

Yes, I think this is going into the right direction!

fabiangreffrath avatar Nov 22 '25 13:11 fabiangreffrath

Okay so, I made the full revision and I described all the bank files are presented in the directory and these are actually used in the libADLMIDI's inst_db.cpp. https://github.com/Wohlstand/libADLMIDI/blob/master/fm_banks/list-of-banks.txt And so, it will be understandible which banks are fully libre, and which are not for Debian. I will try to send requests to known sources to resolve the problem with the rest of them.

Wohlstand avatar Nov 22 '25 15:11 Wohlstand

What about Apogee Sound System, just what their default bank is: https://github.com/videogamepreservation/dukenukem3d/blob/master/audiolib/SOURCE/GMTIMBRE.C#L20-L30

What steps exactly would be required to convert this C source code file into a WOPL file that I could load into the library with adl_openBankFile()?

fabiangreffrath avatar Nov 22 '25 22:11 fabiangreffrath

What steps exactly would be required to convert this C source code file into a WOPL file that I could load into the library with adl_openBankFile()?

Very easy - just dump as binary data (in result you will get the file of TMB format will appear), then use the OPL3 Bank Editor to open it and re-save as the WOPL format. However! This bank needs to be fixed, it contains skewed percussions, they need to be fixed, they should be placed with some small offset. The first half of work I already done, you will find the "fm_banks/tmb/default.tmb" file, it's already exported content of that source file (I copied it into small C file, and then I ran it to dump the data as a TMB file). The second part of work needs to fix broken percussions in the bank.

Wohlstand avatar Nov 22 '25 22:11 Wohlstand

then use the OPL3 Bank Editor to open it and re-save as the WOPL format.

Is this possible without a graphical editor?

fabiangreffrath avatar Nov 22 '25 22:11 fabiangreffrath

Is this possible without a graphical editor?

If you will use the wopl_file.c / wopl_file.h module with your custom code that reads bytes from the structure and puts them into WOPL structures to produce the output data to be written into the file. I don't yet have the terminal-based converter between different bank formats, only some drafts. But I do have some exact plans to make a similar thing once upon to simplify other tasks. Primarily I noted about Bank Editor because it's not just conversion needed: the manual fixing of incorrect data and adjusting. I would like to perform everything just by myself, that's fine for me.

Wohlstand avatar Nov 22 '25 22:11 Wohlstand

Ah, bummer!

My plan was to include the GMTIMBRE.C file in the Debian package, dump it to tmb binary format at package build time, convert it to wopl format and install it into the file system. Then I would patch the library to fall back to using this bank if no other one was found or provided by the user. I was hoping the gen_adldata utility could help with this process.

Sorry, but I cannot just ship binary files (without corresponding sources) that have been converted from these sources using a non-reproducible process (because that involves manual steps in a graphical tool) and then claim "but trust me, the sources and the tool are free". That's not how things work in Debian. Yes, we are picky. 😁

fabiangreffrath avatar Nov 23 '25 10:11 fabiangreffrath

@fabiangreffrath , I have another idea: I talked to George Alistair Sanger (one of authors of banks "The Fat Man" both 2op and 4op variants) via email, and he explicitly granted to release his "The Fat Man" banks under terms of the MIT license. That means the large number of included banks are now officially libre (they are mostly derivatives of "The Fat Man" with minor differences). I made the separated repo to preserve this event, and I made dump of banks data as a human readable text files with detailed documenting of each parameter in the bank files. These banks are much better candidates to be default, and one of them is already default bank.

And, another idea: I can make the custom textual bank format which will be similar to WOPL format, and store all the bank data in this form, and put suitable license header to every such file. And then, gen_adldata can just read that data and import as inst_db.cpp in usual form.

What do you think?

Wohlstand avatar Nov 23 '25 11:11 Wohlstand

And so, I want to make sure that ID of banks won't be skewed too much to don't break existing players and games that rely on exact ID. And then the legally clear version of the banks set would contain duplicates of allowed banks, so, important ID will be preserved. Actually I should additionally note to maintainers of vintage game ports to convert their banks into WOPL or implement a brief code that converts game's native format into WOPL to load it into libADLMIDI, so, they don't use embedded banks anymore. Recently was a talk with a maintainers of the Syndicate game and they just used an embedded bank by ID as a quickest solution. I guess, for these game ports I could implement a simple module for such game ports so they can just supply their native bank that will be converted to WOPL before loading. I already made a similar one for GZDoom that can use OP2 banks in addition to embedded.

Wohlstand avatar Nov 23 '25 13:11 Wohlstand

What do you think?

Thank you very much! Every step that takes us closer to "copyrighted and properly licensed sources for the banks" is highly appreciated.

fabiangreffrath avatar Nov 23 '25 13:11 fabiangreffrath

Anyway so, @fabiangreffrath, should I turn the rest of these banks into textual format (that can have license header and description attached) instead of binary formats? These binary formats actually in same manner as the sound recording or image files. Just, data itself is way simpler. But unlike images or sound recordings, such data can be easily represented as a text file with all values shown in human-readable form.

Wohlstand avatar Nov 23 '25 19:11 Wohlstand

Just, an example, how the data of each instrument looks in the Bank Editor:

Image

And how it looks in text form:

INS=3: NoteOff1=0 VelOff=0 FB1=6 Conn1=1 FB2=0 Conn2=0 4-OP Operators:
  - Op0=CAR1 [Attack=12 Decay= 3 Sustain=14 Release= 4 KSL=1 TL=31 AM=0 VIB=0 EG=0 KSR=0 FMult= 2 WaveForm=0]
  - Op1=MOD1 [Attack=15 Decay= 1 Sustain=13 Release= 4 KSL=2 TL= 9 AM=0 VIB=0 EG=0 KSR=1 FMult= 1 WaveForm=0]
  - Op2=CAR2 [Attack=12 Decay= 1 Sustain=13 Release= 5 KSL=0 TL= 0 AM=0 VIB=0 EG=0 KSR=1 FMult= 1 WaveForm=0]
  - Op3=MOD2 [Attack=12 Decay= 1 Sustain= 3 Release= 5 KSL=2 TL=27 AM=0 VIB=0 EG=0 KSR=0 FMult= 0 WaveForm=0]

Wohlstand avatar Nov 23 '25 19:11 Wohlstand

Thanks for asking! Yes, indeed I'd prefer that. The sheer fact that it's human readable and editable now, together with the fact that it can be annotated with copyright and license information just like a regular source code file, makes it definitely the preferred format.

fabiangreffrath avatar Nov 23 '25 20:11 fabiangreffrath

Okay so, my plan for the recent time:

  • Create the textual format that OPL3 Bank Editor can load and save (it will not match the look of dump I generated at TheFatManOPL repo [The goal of that dump is to illustrate what actual data inside sample WOPL files I placed here], it will be done in format so it will be both human-readable and machine readable, and it will allow commentaries, so, license header will be included too). Let's name it "WOPLX" - it will hold same data as binary WOPL, but in textual human/machine-readable form, and editable via text editors.
  • Implement at the gen_adldata the support of these files.
  • Re-save banks that are legally clear into new "WOPLX" format and adding all the important data into it.
  • Adjust the "banks.ini" to use WOPLX files instead of former binary formats.

Is that a good plan?

Wohlstand avatar Nov 23 '25 20:11 Wohlstand

Sounds like a good plan! Thanks for picking up this issue and taking it serious.

fabiangreffrath avatar Nov 23 '25 20:11 fabiangreffrath

Some updates on this:

  • I invented and implemented the working support for WOPLX format at the OPL3 Bank Editor, here is the specification and sample files (one and two) that shows how data looks.
  • Soon I will start implementing that support at the libADLMIDI's gen_adldata thing and making revision of all the bank data, turning them into WOPLX format and clarifying the license information. Originals will be moved into separated directory so they can be excluded easily if needed.

EDIT: Second file link was wrong, I fixed it.

Wohlstand avatar Dec 07 '25 02:12 Wohlstand

Just now, I converted the large pile of banks into WOPLX format and I clarified their license information: they all now here: https://github.com/Wohlstand/libADLMIDI/tree/master/fm_banks_new For these banks are not yer converted, are left for the further investigation to clarify their legal status. And for other part I attempting to send requests to clear everything. Most of banks are consumed are Fat Man, John Miles's, Jamie O'Connel's (that appears in the FMSynth repo with the MIT license), Sneakernets's explicitly MIT-licensed bank, and my own bank that I built using various captured setup of IMF-based games.

Right now, there are around of 32~35 banks of the whole set needs an attention.

Wohlstand avatar Dec 08 '25 12:12 Wohlstand

Hi Folks,

I am not a lawyer. Which license would be most useful for your project? Suggest the full text of a license to me and I will approve it or object to it. I am not likely to object to anything that remains free.

regards, --Jamie

On Mon, Dec 8, 2025 at 7:09 AM Vitaly Novichkov @.***> wrote:

Wohlstand left a comment (Wohlstand/libADLMIDI#301) https://github.com/Wohlstand/libADLMIDI/issues/301#issuecomment-3626605991

Just now, I converted the large pile of banks into WOPLX format and I clarified their license information: they all now here: https://github.com/Wohlstand/libADLMIDI/tree/master/fm_banks_new For these banks are not yer converted, are left for the further investigation to clarify their legal status. And for other part I attempting to send requests to clear everything. Most of banks are consumed are Fat Man, John Miles's, Jamie O'Connel's (that appears in the FMSynth repo with the MIT license), Sneakernets's explicitly MIT-licensed bank, and my own bank that I built using various captured setup of IMF-based games.

Right now, there are around of 32~35 banks of the whole set needs an attention.

— Reply to this email directly, view it on GitHub https://github.com/Wohlstand/libADLMIDI/issues/301#issuecomment-3626605991, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABT6VWLGQ3IL5SBBLCGGRP34AVTBJAVCNFSM6AAAAACMZ4SKSKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMRWGYYDKOJZGE . You are receiving this because you were mentioned.Message ID: @.***>

Jamie-MIDIOX avatar Dec 08 '25 16:12 Jamie-MIDIOX