Wohlstand / libOPNMIDI

A Software MIDI Synthesizer library with OPN2 (YM2612) emulator
GNU Lesser General Public License v3.0
96 stars 6 forks source link

Add param for XG brightness control #8

Closed freq-mod closed 6 years ago

freq-mod commented 6 years ago

OK, this one is weird. On some random MIDIs, there is a strange bug (?) where random instruments sound very "filtered", like they had modulators muted down or running at very low level. It doesn't affect libADLMIDI, where everything sounds normal, it doesnt matter whether it's built-in bank or my custom one, it doesn't make difference whether it's Nuked or Gens, it's not GS/XG-exclusive problem I think, so WTF?

Aand again, some .mid examples, some sound barely tolerable, some are totally destroyed broken opnmids.zip

Wohlstand commented 6 years ago

XG/GS are standards for MIDI, but not for chips are has own raw commands are sending by MIDI sequencer from received MIDI events. It's not a bug, its a specific instruments and not dependent on emulators. Look: The sound is not "too filtered" when modulator's frequency multiplier is higher or equal to carrier. When carrier has higher FMULT, then resulted sound is "too filtered" no matter from a chip. The Brightness XG-specific controller for now is same as individual volume level for modulator (on all chips). However, because of some MIDI files are has too low brightness level seted up, the sound will be also "too filtered" with even no matter which FMULT has higher value. Anyway, I has to resolve this unexpected crap by next solution: I will add into WOPL/WOPN extra per-instrument flags and values to tell which operators are allowed to affect by Brightness and even ability to forbis brightness for this instrument. By default, briggtness events are ignored for percussion channels.

Anyway, MIDI files Ill review when Ill reach my home, at this moment im in the bus.

EDIT: Yeah, in MIDI file is too low brightness was set up: default

P.S. On real XG synthesizer the "Brightness" controller just a filter of final sound while on FM chips it's a level modifying of modulator(s).

P.P.S. Same MIDI files with removed all "Brightness" controllers, will sound fine everywhere: broken.opnmids-fixed.zip

P.P.P.S. How to use Brightness controller, I made an example MIDI file: Ecu_10_Bass_xg.mid.zip (Suggested to listen it on 62'th (DukeNukem) bank of libADLMIDI)

freq-mod commented 6 years ago

Fixed since f5ad1e9