VOGONS


First post, by Wohlstand

User metadata
Rank Newbie
Rank
Newbie

Hello!

I'v got inspired by ADLMIDI program, which a MIDI player over chip emulator, and after creating the libADLMIDI I kept in my mind the idea to create similar library, but over YM2612 chip (a same chip that used in Sega MegaDrive/Genesis game console). Because the sense of any MIDI player to interpreting MIDI commands into native chip registers commands, I found that is very easy to make MIDI players over any other sound generation chip(s). After some works, I have created the bank editor (have reworked OPL3 bank editor with replacing YMF262 emulator and have adapted GUI to YM2612's specifics, and have created own WOPN bank format) and then created the full General Midi bank by collecting instruments from various VGM files, porting from OPL3 banks, and making/remixing any other instruments. ADLMIDI had multiple chips emulation to extend 18-channels (or 6 4-op channels) limitation which is used in libOPNMIDI to extend 6-channels limit and be able play better polyphony than chip allows. DAC for now is not used, but planned in nearest feature to allow passing the PCM samples as anternate percussion mode.

If you want preview library in action, you can try PGE MusPlay simple music player (which is linked below)

Source code of this library:
https://github.com/Wohlstand/libOPNMIDI
Hint: Unlike ADLMIDI, library doesn't has hardcoded banks and uses an external bank files. As alternative, you can hardcode your WOPN file and pass it via memory pointer.

A bank editor which us using for creation and editing of WOPN banks (with ability to import instruments from VGM files):
https://github.com/Wohlstand/OPN2BankEditor (prebuild for Win32 you can download here)

Where this library is used:

SDL Mixer X - my fork of SDL Mixer v 2.0 library which I extended with additional decoders include ADLMIDI and GME, and where I fixed some internal bugs of the re-sampling, and as small addon I added support of loop-points for OGG files based on vorbis comments LOOPSTART and LOOPEND (also supported LOOPLENGTH to be compatible with RPG-Maker's OGGs where that also supported):
https://github.com/Wohlhabend-Networks/PGE-Pr … _mixer_modified
(Note: Building of this library is designed to building under QMake from Qt 5)

PGE MusPlay - GUI-application that uses this library, a simple music player, where you can preview library sound in action:
http://wohlsoft.ru/docs/_laboratory/_Builds/w … y-dev-win32.zip
Just drop any MIDI-file into this application and choice the "OPN Midi" device. This application made for my game engine project as too to preview musics "like in game" to check are loops are added into music files correctly.
Note: custom bank choosing is not working yet. Library itself supports that, but wasn't implemented on music player side.
EDIT: Now PGE MusPlay supports usage of custom bank files. Custom bank file will be reloaded on re-open or stop/play of a song. If field is empty or refers non-existing file, default bank will be used

Last edited by Wohlstand on 2017-07-17, 04:05. Edited 3 times in total.

Reply 4 of 7, by Wohlstand

User metadata
Rank Newbie
Rank
Newbie
robertmo wrote:

Would it be possible to combine best wavetable and fm instruments as a one synthezator? are there any better fm instruments at all?

Yes! Once I combined Jammie O'Connel's driver with customized Fatman bank and Yamaha S-YXG50 software synthesizer and got this: wohlsoft.ru/docs/Music/Misc/BigTravel_(-5)_third.mp3

It's possible to combine together with FluidSynth and use libOPNMIDI, libADLMIDI and FluidSynth in RealTime MIDI mode (recently, I have implemented that on libADLMIDI and on libOPNMIDI, so, no more need you feed entire MIDI file to them), handle MIDI events and in dependence on patch/bank, send MIDI events to different synthesizers, and output of all processing synthesizers will be mixed into single output.

Reply 5 of 7, by SLON

User metadata
Rank Newbie
Rank
Newbie

What about the possibility of using the YM2608 core? It was distinguished by the presence of additional SSG and ADPCM (and RHY-channels), and also, as far as I know, a higher-quality DAC. True, I do not know how useful this will be for MIDI.

Last edited by SLON on 2018-10-24, 23:34. Edited 1 time in total.

Reply 6 of 7, by Wohlstand

User metadata
Rank Newbie
Rank
Newbie
SLON wrote:

What about the possibility of using the YM2608 core? It was distinguished by the presence of additional SSG and ADPCM, and also, as far as I know, a higher-quality DAC. True, I do not know how useful this will be for MIDI.

It's dependent on the availability of necessary emulator and the chip specification I can use to provide an interface. For now, libOPNMIDI doesn't use DAC, but its support is WIP. On side of libOPNMIDI are three emulators: Nuked OPN2 is implemented YM3438 chip, but it's very powerful and won't work on slow hardware in real-time if you running more than 3 chips; MAME OPN2 is implemented YM2612, doesn't using much power, but is a most balanced emulator that gives well-accurate and doesn't eat too much CPU; And the GENS 2.10, the old and inaccurate emulator, but, the fastest emulator I have at me.

Reply 7 of 7, by Wohlstand

User metadata
Rank Newbie
Rank
Newbie

SLON, some good news for you:
https://github.com/Wohlstand/OPN2BankEditor/issues/46
and
https://github.com/Wohlstand/libOPNMIDI/pull/72

So, we now have the experimental support of OPNA chip, and we have to experiment with it on some other ways. It's not ready for everything, but it's able to play the music correctly (you can try to compile libOPNMIDI and simple OPN MIDI Player [WITH_MIDIPLAY] yourself and try to play any music with it).
You also can join GitHub and watch my repos for the stuff ;3