Sound quality fix for Genesis core - FM Overdrive

kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Sound quality fix for Genesis core - FM Overdrive

Unread post by kalach.x »

Hello all,

I recently created interresting mod for Genesis core https://github.com/kalachx/Genesis_MiST ... rdrive_1.0

The idea was that I absolutely could not stand listening to Megadrive's YM2612. It is not however due to my dislike to FM synthesis. I absolutely love YM2151 (OPN - found in eg. Sharp X68000) or YM3812/YMF262 (OPL2/OPL3 - used eg. in Adlib/SoudBlaster cards) but YM2612 doesn't sound at all like those chips and more often than not music and sound effects for it sound completely broken.

My attempts at transplanting OPL3 to Genesis core failed. Transplanting YM2151 operator to YM2612 failed also, albeit with some successes eg. Doom music surprisingly sounded much better and more like Adlib rendition and at places where sounds were not broken there was this awesome characteristic YM2151 sound. What worked however without any artifacts is modifying sine table used by YM2612 core resulting in quite interesting effect. It was possible to remove all of the original sound characteristics that irritated me and in some instances make music and sound effects sound like something was unlocked in the chip. Some music has more sounds which were otherwise muffled.

Now the sound is a bit harsher and slightly more noisy resembling sampled sound at places and not clean FM synthesis but in actual music this doesn't seem to be bothersome and makes generally noisy Genesis sound even more coherent. "Overdrive" name was chosen because during testing I realized sound this mod produces is similar to guitar effect overdrive. It is especially audible in music that simulates guitars which sound much more realistic.

I recorded some music on my soundcloud account (sorry for the quality, it is an analog recording directly from Mister, I have yet yo buy HDMI grabber)
- https://soundcloud.com/e8root/earthworm ... -overdrive
- https://soundcloud.com/e8root/earthworm ... enesis-opm - this is from default core and sounds the same as my core with FM Overdrive option off
- https://soundcloud.com/e8root/devilish- ... -overdrive
- https://soundcloud.com/e8root/dkc-aquat ... -overdrive
- https://soundcloud.com/e8root/adventure ... -overdrive

BTW. I am not sure how I should inform people here about releases like these. Is there any rule to against it or more appropriate place for such things?
I am mostly doing Mister FPGA development for myself but this one made so much improvement imho that I wanted to share it.
coloursx00
Posts: 1
Joined: Mon Dec 27, 2021 11:36 pm

Re: Sound quality fix for Genesis core - FM Overdrive

Unread post by coloursx00 »

How do I install this?
Stupid Dufus
Posts: 157
Joined: Sun Aug 30, 2020 12:04 am
Has thanked: 98 times
Been thanked: 46 times

Re: Sound quality fix for Genesis core - FM Overdrive

Unread post by Stupid Dufus »

I imagine it's just a matter of downloading the .rbf file from the github linked at the top, then copying it to /media/fat/_Consoles
retro
Posts: 148
Joined: Fri Jun 04, 2021 5:19 am
Location: Kuala Lumpur, Malaysia
Has thanked: 47 times
Been thanked: 14 times

Re: Sound quality fix for Genesis core - FM Overdrive

Unread post by retro »

I love the FM Overdrive based on the two samples in your Soundcloud.
It definitely sounds a lot better than the original.
However, would this not affect the authenticity of the game?
User avatar
barfood
Posts: 96
Joined: Thu Jun 18, 2020 6:55 pm
Location: new user: felleg
Has thanked: 87 times
Been thanked: 20 times
Contact:

Re: Sound quality fix for Genesis core - FM Overdrive

Unread post by barfood »

Interesting, I'll give this a shot for sure! In particular, I'd like to hear how this sounds good Thunder Force 4.
kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Re: Sound quality fix for Genesis core - FM Overdrive

Unread post by kalach.x »

Menu core shows all .rbf files in folders in root of SD card which are starting with underscore _ so you can put Genesis_overdrive.rbf file from the release to _Console on SD card or some custom folder. I added overdrive after Genesis in the name file so that updater doesn't overwrite it and because it is not official release.

My recommendation is to connect Mister to your local router and use either FTP server or even SMB share (instructions https://github.com/MiSTer-devel/Wiki_MiSTer/wiki/Samba) and you can even map your Mister's sd card to a drive letter. I mapped it to M: as it seemed most appropriate : )

As for how this mod work it is still YM2612, this mod does not change anything about how it plays sound, just what sound it plays. What this mod changes is short sample that is being used to play all sounds from. It is the same table that YM2151 uses for its sinus calculation and it does not fit the way YM2612 produces sound at all. It is possible to actually play original sample and it sounds roughly the way Genesis games sound like suggesting what should be there is not something to calculate sinus from but an actual sinus.

I recorded interesting sountrack from game Daisenpuu. This one was originally on PC Engine:

BTW. There is new release: https://github.com/kalachx/Genesis_MiST ... rdrive_1.1
New release sounds much cleaner as it uses different sample that is more mathematically correct.

triangle
Posts: 14
Joined: Sun May 24, 2020 11:10 pm
Has thanked: 10 times
Been thanked: 2 times

Re: Sound quality fix for Genesis core - FM Overdrive

Unread post by triangle »

Hey this is pretty cool! Tried overdrive mode with a handful of Genesis games I'm fond of, particularly Ecco 1 and 2, as well as Thunderforce IV. Not sure if I would choose that sound over any of the originals on a regular basis, but it's fun to mix up music I've heard since childhood.

Assuming there is room for per game/per situation tweaking, it'd be neat if the overdrive configuration were something that could be set via config file the same way lowpass filters, scaliness, and whatnot are.
kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Re: Sound quality fix for Genesis core - FM Overdrive

Unread post by kalach.x »

New year and new release. This time more menu bits used so there is more tinkering with the sound!
RBF file is attached to this post.

Changes in this version:
- moved FM overdrive setting to right below ROM load for faster access
- increased number of overdrive presets from 1 to 15
- new presets called "clean" with superior sound quality
- changed the way lockup table works to not use tables and just case statements

There are even more "new" presets to choose from than just "clean" but this one is actually new for this project. Fresh from the bakery, still hot : )

Especially check clean_512
This preset imho nails it! Sounds just like Genesis while not sounding like Genesis at all :lol:

The lower values like _384 and _255 are more 'overdriven' and can sound better or worse depending in game/tune.

In the long run I will attempt adding file support to load presets from files.
Attachments
Genesis_fmo_1.3_beta.rbf
(3.57 MiB) Downloaded 211 times
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Sound quality fix for Genesis core - FM Overdrive

Unread post by aberu »

retro wrote: Tue Dec 28, 2021 3:43 am However, would this not affect the authenticity of the game?
Yup that's the point. OP didn't like the authentic sound. Which is fine, and this is a very interesting and creative solution to OP's problem. :)
birdybro~
kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Re: Sound quality fix for Genesis core - FM Overdrive

Unread post by kalach.x »

FM Overdrive 2.0 RC
- reworked YM2612/YM3438 operator to support higher bitdepth precission
-- sinelog table precision increased from 12-bit with 8-bit address to 24-bit with 12-bit address
-- exprom table precision increased from 11-bit with 8-bit address to 22-bit with 12-bit address
-- internal logic precision increased - most registers/wires are now twice as wide
- four presets are available Default, SineExp/3, Clean512 and Linear512
- added option to apply extra boost - applied to eg. Clean512 will make the same preset as Clean256 from previous beta release
- added one additional preset for exponent table - minor change in sound
- added option to reduce original feedback gain - reduces original OPN overdrive
- disabling FM Overdrive will run original unchanged FM operator with its original precision and only one preset

Other changes unrelated to FM Overdrive:
- added Color Palette option with presets Default, Raw RGB, Composite and Grayscale
- moved CPU Turbo option in easier to access location and removed medium turbo as I found it too unstable to be usable while highest turbo seems to work fine all the time so to not freeze my game by wrong setting I removed it

Actually new operator code supports wider address range than 12-bit but we do not have enough resources in the FPGA chip to take full advantage of 16-bit addresses ;) I did test if there is difference between 8-bit address and 12-bit and could hear difference, not sure above 12-bit yet. Even compared to original implementation difference is usually very very subtle but it is cleaner and more defined with new implementation, especially audible on some sound effect and distortions. This whole mod is about nice distortions so having more bits helps 8-)

Other than operator I did not change anything else so we are limited by bitdepth of rest of YM design (9/13-bit) but I figured operator is most important part to improve first.

I also need to figure out how hidden menu items work to hide additional FM Overdrive options when it is disabled. Either I just skimmed through 'documentation' or it doesn't include such information.
Attachments
Genesis.rbf
(3.69 MiB) Downloaded 194 times
User avatar
meauxdal
Posts: 152
Joined: Mon Nov 23, 2020 3:28 am
Location: atlanta
Has thanked: 39 times
Been thanked: 126 times
Contact:

Re: Sound quality fix for Genesis core - FM Overdrive

Unread post by meauxdal »

This is one of my favorite alternative cores on MiSTer. I love being able to hear music I've heard for decades in new ways, and some tunes really sing with the right settings.

Post Reply