Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One GME issue on SPC #56

Open
Yave-Yu opened this issue Aug 3, 2022 · 13 comments
Open

One GME issue on SPC #56

Yave-Yu opened this issue Aug 3, 2022 · 13 comments

Comments

@Yave-Yu
Copy link

Yave-Yu commented Aug 3, 2022

Idea no Hi's title screen music (01 Day of the Idea) on SDL Mixer X has unpleasure audio bursting (?) effect, but other place of GME such as kode54's GME plugin for FB2K didn't has this issue.

@Wohlstand
Copy link
Member

Wohlstand commented Aug 3, 2022

At MixerX the mainstream GME is used: https://bitbucket.org/mpyne/game-music-emu/wiki/Home
However, I do some updates on GME itself sometimes. Also, @kode54 developed an updated patch over the latest mainstream. I ported almost all his updates to the mainstream, except for the SPC update which has a serious problem of tempo changing which I hadn't resolved yet.

unpleasure audio bursting (?) effect

Try the Moondust MusPlay and ensure the F32 format is used for output. Anyway, at SMBX38A, please specify the |0;g=1.0; gaining factor to make sure this file won't be too loud.

I tried to listen to the song at ZXTune (which uses old kode54's modded GME) and Moondust MusPlay to verify the sounding, and I can't understand, what the problem is... Could you record a small fragment of "what should be" and "what actually happens"?

@Wohlstand
Copy link
Member

The problem with SMBX-38A is that it still requests to run the S16 audio format, and it really needed to switch the F32 format output (I already did that on TheXTech and Moondust Project) to avoid possible clipping when too loud output.

@Yave-Yu
Copy link
Author

Yave-Yu commented Aug 4, 2022

ShortCompare.zip
One is FB2K GME plugin, another is SDL Mixer X (Music player, F32LSB). Just the song's intro clip. 爆电平

@Wohlstand
Copy link
Member

I hear the difference of timbre between two of variants 🤔

@Wohlstand
Copy link
Member

Anyway, I'll ask for more info from @kode54 what the real difference between the old blaarg's SPC emulator and the new one that he used later...

@kode54
Copy link

kode54 commented Aug 5, 2022

Try toggling the SPC analog simulation filter in Advanced Preferences in foobar2000. GME defaults this filter to enabled, I was suggested by users to disable it by default. If this is indeed the cause, it is already proposed to add an option to toggle it at runtime here.

@kode54
Copy link

kode54 commented Aug 5, 2022

This filter, along with gaussian interpolation, is intended to simulate what a hardware unit would sound like. The gaussian interpolation table is hardware correct to produce exact digital output, while the analog filter stage is supposed to mimic the behavior of the analog components post-DAC.

@LoveBodhi
Copy link

FB2K GME allows to choose different interpolation! SDL Mixer X can only by played via gaussian!

@kode54
Copy link

kode54 commented Aug 10, 2022

FB2K GME also uses a different fork of GME that has different interpolation modes added, just because it was simple enough to add them. I chose to implement the interpolation setting as a signed integer where 0 is gaussian, going up from there is mathematically higher quality than hardware, such as cubic interpolation and 8 point sinc interpolation, while going lower than 0 is linear interpolation and no interpolation, which just sounds horrid in many cases.

Unlike sample rate scaling, it was something I could implement easily. Sample rate changes would require scaling all envelope parameters, as well as all echo/reverb parameters, which is not so easy to do in a linear fashion, especially considering FIR coefficients.

@Wohlstand
Copy link
Member

I took some investigation, and I found the option called gme_enable_accuracy() which disables/enables the filter (SPC_Filter), and now I am really curious, should it help with the issue? 🤔

I made the recording to compare with the enabled or disabled option (by default it's enabled).

2022-08-18_05-01-24.mp4

@Yave-Yu, does it helps with your issue? If yes, I'll bind it into MixerX's arguments, so, you will be able to use it.

@Yave-Yu
Copy link
Author

Yave-Yu commented Aug 20, 2022

Still has bursting result...

@Wohlstand
Copy link
Member

Then, I'll really try another thing...

@kode54
Copy link

kode54 commented Aug 20, 2022

I should have tried this track to begin with. And watched that recent video.

ReplayGain results for the first track, with the (digital) "analog" simulation filter, and the 1.4x gain, which I disable on GME and apply in floating point afterward:

Track Gain: -13.74 dB
Track Peak: 1.376801

You're definitely hearing clipping. I need to fix this in Cog, too, because that doesn't do the 1.4x volume scale in floating point, either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants