mmontag / chip-player-js

Web-based music player for a variety of video game and chiptune music formats.
https://chiptune.app
GNU General Public License v3.0
332 stars 18 forks source link

Add libOPNMIDI synthesizer #90

Closed Wohlstand closed 1 year ago

Wohlstand commented 3 years ago

Hello!

Since you have the using of libADLMIDI synthesizer, I also suggest you add another synthesizer called libOPNMIDI:

https://github.com/Wohlstand/libOPNMIDI

It's very similar to libADLMIDI by its API, but has the next differences:

mmontag commented 3 years ago

@Wohlstand Thanks for the recommendation!

Maybe this is a stupid question, but can you explain how the YM2612 and YM2608 cores will sound different from the YMF262? I thought they were essentially just a different number of operators with different configuration options.

Do you actually map the built-in 2608 drum sounds to GM drum kit, even map the Pulse channels to GM instruments in a creative way?

Wohlstand commented 3 years ago

how the YM2612 and YM2608 cores will sound different from the YMF262?

You may check out my video samples: https://www.youtube.com/watch?v=l0CyXqIZFsU&list=PLrUcHGBNRjJMJ_s71k2DtSscsQtqgmWut&index=13

These chips were similar by the way of work, but they have different registers layout, but still have the same terms. All these chips (YMF262, YM2602) are sound generators with a number of voices, and the MIDI synthesizer (the sort of a driver that accepts MIDI commands and interpreting them as chip native register commands). Using the same way, I built the libOPNMIDI. I built some bank files in WOPN format, they have a set of instruments that literally represents the GM/GS/XG map of instruments in the bank, and physical voice channels at the chip. Once note play is requested by MIDI commands, the driver (inside both libADLMIDI and libOPNMIDI) takes the instrument data from the bank, finds the physical voice of the requested format that is not busy, then sends all instrument data into it in a condition they have not matched instrument data, and sends the note on register state.

Right now libOPNMIDI uses FM voices only, but there is an exact plan to support other voice types such as PSG and PCM-based (mainly for drums). The type of voice will be defined by the bank.

mmontag commented 3 years ago

Thanks! I'm intrigued by the libOPNMIDI + Fluidsynth videos. I had a thought to implement flexible MIDI routing in chip player - in case you want soundfont drums, a pianoteq piano, and FM orchestra. This was possible in Windows 95, if you recall...

image

there is an exact plan to support other voice types such as PSG and PCM-based (mainly for drums).

Nice, I'll definitely check it out once that lands!

Wohlstand commented 3 years ago

soundfont drums

Using combining with FluidSynth at my videos is a temporary solution, the real solution is implementing the sub-system at libOPNMIDI itself, and there is a plan I want to proceed, however, lack of time and other tasks don't allow me to make that quickly, but I still want, very want, and so, once I find a moment and inspiration, I will start the actual work on the thing.

Wohlstand commented 3 years ago

P.S. Not all drums are PCM-based, the big rest of them still be FM-based, so, it's percussion per-note mapping used