Skip to content

Software WinFM OPL3 MIDI driver exists!

with source code!

Technical discussion which is not directly related to VGM files. Talk about Hardware and Software.

Moderator: Staff

  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

Software WinFM OPL3 MIDI driver exists!

Post by MaliceX »

EDIT: My own updates to this can be found a few posts below

http://www.vogons.org/viewtopic.php?f=9 ... 7&p=320148

While randomly searching for means of recording MIDI into a program like Adlib Visual Composer, I bumped across this. Looks like it finally exists!

Although I'm aware ValleyBell made some efforts in making his own WinFM-based MIDI player, this is a software-driven MIDI driver which you can use in any Windows application that can use a MIDI output device.

So....yeah. Re-live the glory of terrible tinny MIDI music!! xD
Last edited by MaliceX on 2013-10-29, 20:03:18, edited 1 time in total.
-dj.tuBIG/MaliceX
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

Very nice! I do believe I shall study this source code to see just how possible a YM2151 or YM2612 user-mode softsynth can be :)
  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

Post by MaliceX »

I'm more interested in finding out how hard it would be to replace the patches. Seeing as it directly used the WDK FMSynth patches as ValleyBell's MidiPlay did, need to figure out if the BNK patch format is compatible.

EDIT: a bit of looking and asking around, it looks like according to Bisqwit's adlmidi, the Fat Man 2op soundset is equivalent to Microsoft's patches, both stored in "Junglevision Patch Format" ? Need to find out the specification of that and translate BNK to that.

EDIT2: http://djtbmx.jamesoz.com/junk/bnk2opl.c (compile with gcc -Wall -ansi -pedantic)
Will take any .BNK file and spit out in exact order, an instrument file which MidiPlay can read.

Of course, all that leaves now is a user-friendly way to map patches to where, and of course importing these into the driver.

A test using MidiPlay (ie: what I aim to get this driver to sound like for me):
https://dl.dropboxusercontent.com/u/128 ... ibtest.vgm
https://dl.dropboxusercontent.com/u/128 ... ibtest.vgm (because stereo rules)
https://dl.dropboxusercontent.com/u/128 ... wtest2.vgm

EDIT3: Just a mental note. opl3emu.dll, instrument presets also replaceable from offset 0x2C110 if one cannot be bothered to recompile. :P
Last edited by MaliceX on 2013-09-06, 22:00:53, edited 8 times in total.
-dj.tuBIG/MaliceX
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

I've never been able to compile adlmidi from scratch successfully, ended up always requesting a compile from bisqwit directly. That reminds me, I have to email him about the last version...
  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

Post by MaliceX »

First, get fraction from the SVN. It's missing from the tarball.
On MinGW, open it with MSYS or git-bash (nuwen's)
On the Makefile, get rid of the --mno-cygwin flags
make

EDIT: alternatively, here's a precompiled copy I did with nuwen's MinGW 10.2. https://dl.dropboxusercontent.com/u/128 ... i-1.2.1.7z
Last edited by MaliceX on 2013-09-08, 10:16:17, edited 2 times in total.
-dj.tuBIG/MaliceX
  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

Post by MaliceX »

Oh yeah...
neologix wrote:Very nice! I do believe I shall study this source code to see just how possible a YM2151 or YM2612 user-mode softsynth can be :)
I think ValleyBell beat you to it.
http://forums.sonicretro.org/index.php? ... t&p=752605
-dj.tuBIG/MaliceX
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

MaliceX wrote:Oh yeah...
neologix wrote:Very nice! I do believe I shall study this source code to see just how possible a YM2151 or YM2612 user-mode softsynth can be :)
I think ValleyBell beat you to it.
http://forums.sonicretro.org/index.php? ... t&p=752605
Oh. My. MOUSTACHE.

This is what I get for not visiting Sonic Motobug Retro Forums! Time to finish the Yamaha XG drum kit I was making for mid2smps and have some fun...
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

just btw: I posted the first beta of the mid2smps MIDI driver almost exactly one year ago on IRC.
It's based on mudlord's BASSMIDI driver, so I guess the origins of the MIDI API code date go to munt's MIDI driver, too.
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

Ok, just downloaded and tried out mid2smps driver. Not hearing anything in Windows Media Player. Changed the volume to 2000, loaded different .gyb files from a 2012 June version of mid2vgm_2612 and a 2011 Oct version of mid2smps, tried all the PSG envelope files that came with this, and the DAC data from this and my WIP version of the YXG drums.

No sound in any of it. Ran the driver config with admin privileges to install and it said success and even copied the .dll to system32. Nothing.
  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

Post by MaliceX »

irc.digibase.ca/#vgmrips wrote:13:31 <~ValleyBell> http://vgm.mdscene.net/MDMidiDrv_2013-10.7z
13:31 <~ValleyBell> Try this version.
13:31 <~ValleyBell> It's the one I'm currently using.
13:31 <~ValleyBell> And I compiled it with VS 2010.
Note: Don't bother using it in WMP. Also Winamp hangs if using MIDI Mapper as the device, with this synth selected. (using it directly poses no issues)
-dj.tuBIG/MaliceX
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

Thanks, updated and switched to Winamp and works now! I'm really gonna have to look into using Foobar2000 for my daily player soon since Winamp is a behemoth and WMP has failed me too many times...
  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

Post by MaliceX »

Back on topic. I've forked the original source code and started adding some changes to the OPL3 driver.

Win32 Binary: https://dl.dropboxusercontent.com/u/128 ... driver.rar
WinRT Binary: https://dl.dropboxusercontent.com/u/128 ... pl3emu.dll
Git repo/source: https://bitbucket.org/djtubig-malicex/opl3-synth-driver

Changelog:
[17-JAN-2013] - Major update
  • VGM Logging support (CC119=127 for ON, CC119=0 for OFF. Saves to %TEMP%\opl3vgmlog.vgm for now)
  • Fixed intermittent 4-op -> 2x2op/2op voice stealing issues
  • Fixed voice-stealing problems on patch change (MS's oldest-by-patch policy was flawed)
  • Tweaked Attack/Release range
  • Portamento (CC5/CC65) support for both poly and mono. Using EXP start-end time policy, and sustained pitch tracking. 100Hz update.
  • Modulation wheel (CC1) support. LFO policy is per-voice except for mono legato which follows on previous voice until silence. 100Hz update.
  • Experimental linear pitch envelope support (currently possible with drum patch map only; see 2x2patchtest.h) 100Hz update.
  • Channel Volume = 0 non-zero velocity should still allocate a voice. (thanks DracoNihil)
  • Changes to initialization code structure.
  • Fixed project solution to spit out differentiating filenames depending on use for hardware or emu.
EDIT: note it's using khokh2001's OPL3 core which has a retriggering bug. Let me know if this is an issue.
Also, give this a listen with this build. https://dl.dropboxusercontent.com/u/128 ... ntest2.mid

[5-JAN-2014] SPECIAL RELEASE
  • Hardware OPL Passthrough implemented via inpout32.dll functional! Read instructions before installing.
  • Separated builds until a configuration utility is made to have this user-changeable.
  • Reorganised build configurations
Currently hardcoded to 0x388. If you need a different port, change the FMPort variable and recompile, or ask me and I'll rebuild for you.
Special thanks to ValleyBell for the OPL HW playback code from VGMPlay/MidiPlay

--please see git repository wiki page for past list of changes--

TODO:
  • Add Voyetra Super SAPI! and Creative PLAYMIDI patches
  • Patch editor or more patch converters (looking at .SBI and Freq Monster 801)
  • Config Utility
Last edited by MaliceX on 2014-01-16, 19:56:15, edited 2 times in total.
-dj.tuBIG/MaliceX
  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

Post by MaliceX »

Progress update on what's currently happening: https://www.youtube.com/watch?v=nTBL-OdfsU0
No new binary at this stage. Finishing university this semester, and still in dire need of free time to work on some outstanding issues with the implementation code.
-dj.tuBIG/MaliceX
  • denjhang Offline
  • Posts: 95
  • Joined: 2021-03-24, 4:44:34
  • Location: hk

Post by denjhang »

bnk2opl.c File has expired.Please add the link again.
Post Reply