mazmazz / SRB2

A 3D Sonic the Hedgehog fangame built from Doom. See README for my contributions.
GNU General Public License v2.0
4 stars 2 forks source link

Music fading in after jingle don't work with GME #29

Open SteelT1 opened 6 years ago

SteelT1 commented 6 years ago

After the extra life jingle plays, if the level music uses a gme-supported format, it won't fade in, it would just resume normally.

mazmazz commented 6 years ago

Thanks for this. I believe I forgot to funnel GME music switches into the SDL Mixer fade-in call. Will have to see if that's possible; it might not be unless GME has its own fade-in call.

SteelT1 commented 6 years ago

I guess it won't be any time soon, there's a gme_set_fade function, but that's for fading out, so that wouldn't be useful in this case.

mazmazz commented 6 years ago

I was thinking about how to roll out my own fade-in/fade-out in mixer_sound.c, because I wasn't sure if SDL mixer's fade API was thread-blocking (meaning I can't use them.) So it might happen.

If the in-game volume controls affect both GME and MIDI, then that means it's feasible. Hopefully works with the [https://wiki.libsdl.org/CategoryThread](Thread API)

SteelT1 commented 6 years ago

I believe so, it seems music volume affect both digital and gme. MIDI volume is hard coded currently though due to issues it caused with windows mixer.

Wohlstand commented 5 years ago

About of GME and MIDI synths at SDL Mixer X: I have used square root formula to scale volume, as the sound of those libraries originally too quite, I made them to scale volume with sqrt to compensate volume lack on lower levels which also affects fading. So, I guess, it's now better for me is to gain the output rather scale by junky formula to avoid too silent playback in some cases...

Wohlstand commented 5 years ago

Also, about the Windows's Native MIDI: when you are using default MSGS crap, the attempt to scale volume will cause master volume of app go into silent. It's MS side bug that didn't fixed. However, at me I have planned a workaround to scale volume by MIDI events and also scale volume values of exist events to make an illusion of master volume and avoid MS-side bug to affect master volume of app. However, when you are using any other alternatives synthesizer, bud didn't happen, it's only can happen with MSGS.