danielrfry / opl2sd1

OPL-compatible driver for Yamaha YMF825 (SD-1)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Publishing work on MIDI implementation?

nikitalita opened this issue · comments

Hi,

there’s a thread on VOGONS where they discuss trying to implement MIDI on the MA-3 (aka the predecessor to the SD-1) and they mention they would love to see the SD-1 MIDI implementation published: https://www.vogons.org/viewtopic.php?p=1057380#p1057380

is this in the cards in the near future?

Yes, I’m very keen to release the code as soon as it is in a generally usable state. The project includes several components (the names are placeholders):

  • libfmcore: device-independent MIDI implementation in C++, with drivers for OPL2, OPL3, OPM and SD-1. Can be built as an RP2040 or Teensyduino library (possibly other Arduino targets too) for embedding, or linked into libfm for use on desktop/web platforms.
  • libfm: library incorporating libfmcore, the DOSBox OPL emulator, and the MAME OPM emulator, targeting Linux, macOS and web (as a WASM module). Allows use of the MIDI implementation without dedicated hardware.
  • opl-patch-editor: particularly badly named GUI patch editor and software synthesiser for OPL, OPM and SD-1. Implemented as a web app using React, libfm, web audio and web MIDI.
  • vgmtools: collection of tools implemented in Python for converting, ‘disassembling’ and editing VGM/DRO files, converting MIDI to VGM, playing or rendering VGM/MID files to WAV, etc. using libfm.

Before releasing this, I’d like to:

  • Rename everything. The placeholder names I picked are misleading and conflict with existing projects.
  • Figure out licensing - either find a licence that is compatible with both the DOSBox/MAME emulator code in libfm, replace the emulators with equivalents with compatible licences, or extract the code into a separate project with a different licence.
  • Implement MIDI device selection in the patch editor. Currently the MIDI input/output devices are automatically selected, with no easy way to override the selection if it is incorrect.
  • Implement exporting patches as SYX files to make using custom patches in sequencers easier.

I hope to find the spare time to complete these last few pieces of work soon.

An update for anyone interested: MIDI device selection is now implemented. I expect this to be the largest of these pieces of work.

I haven't made a final decision regarding licensing yet, but I expect to release libfmcore under the MIT Licence, and everything else under GPL v2. This is due to the use of the MAME YM2151 emulator, which uses this licence, in libfm. An alternative might be to replace it with the Nuked-OPM emulator, which is LGPL-licensed.

commented

You may also want to take a look at ymfm as well.

@OPLx Ah, perfect - thanks for the tip! I've concluded that licensing for libfm doesn't matter too much, as it is essentially just glue code between the MIDI implementation and the emulators. But more of a concern is that using GPL'd code from Python or JS seems to count as 'linking' under the terms of that licence, which would affect vgmtools and the patch editor. So this sounds like an ideal solution to keep things flexible for those.

commented

@danielrfry No problem. Please keep up the great work!

I've now replaced the DOSBox OPL and MAME OPM emulators with their equivalents from ymfm. Conveniently, this now means that all the code in libfm from other projects is BSD 3-clause-licensed.

libfmcore and vgmtools do not contain any code from other projects.

The patch editor, being an npm-based web app, has many dependencies - however, all use permissive licences that allow redistribution in source or compiled form. Certainly there is no (L)GPL'd code. So I think for simplicity, I will use BSD 3-clause for this too.

TLDR: Everything will be released under the BSD 3-clause licence.

.SYX export is now implemented - so the largest remaining task is to rename all the projects. In addition, I have a few small issues to fix, and I'll try to write up some basic documentation as a starting point, then I should hopefully be ready to make the repositories public.

As is often the way, the final small tasks multiplied... but I've now got to a point where I'm comfortable releasing everything, so the repositories are now public. I have named the project "Note Salad", in a move I may later regret.

https://github.com/danielrfry/notesalad/
https://github.com/danielrfry/notesalad-tools/
https://github.com/danielrfry/notesalad-editor/

I hope it can be of some use to someone!