Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MOD/Tracker music! SDL does not loop properly
#1
It would be great if this forum had a  "Retro game development" sub forum since that's what we'll be doing with Tilengine!  That's where I'd put this post if it existed.

Back on topic; Herein, when I say MOD files, I mean all tracker formats - MOD, S3M, IT, XM, etc.

SDL_Mixer (and IDEs that use SDL, such as Love2D) can "play" MOD files, yes - and I guess apparently we should count our blessings that anyone seems to care about implementing such an old (super compact and dynamic!) format... but they do not loop properly, not one bit.  The song reaches the end... there is a huge half-second pause while the sound system takes a breath... and then the song restarts again.  Always from the very beginning.  Loop points are ignored, and looping is NOT seamless!!  This is unacceptable!  This is like... the whole point MOD files were invented; to be dynamic, and played seamlessly in the background of games.

Looking into the issue in SDL_Mixer, it seems it uses MikMod and ModPlug under the hood, and it deliberately ignores the looping features they provide.  I find this incredibly ignorant.   The only use case this would benefit is media players - that's it.  That is an extremely limited use case.  What about... you know, games?  Why not provide an option to switch seamless looping on or off?  From what I can read, the author of SDL_Mixer seems completely oblivious to what this means.  The only comment I could find him responding to someone asking about this, is asking them why they couldn't just use the built in looping... man.

I found this thread giving two different methods to enable the settings of MikMod and ModPlug in SDL_Mixer to allow seamless looping, but neither approach made a difference.  And the most recent thread on the issue I could find, contained a post of someone saying that none of the tricks involving overriding the ModPlug settings work anymore in SDL_Mixer.

I hear that the MOD looping in Unity is seamless, to a fault - apparently it can't be ignored (fine by me!) and Unity uses a stripped down version of FMOD.  I haven't had a chance to test it in Unity but I am going to try using FMOD for my sound library for Tilengine, instead of SDL_Mixer.  Looking at the API documentation, there are commands for individual channel volumes in MOD files (which is what you could use to cross between different sound tracks without skipping a beat, a la Banjo-Kazooie), and I wager if it has this kind of attention to detail for MOD file support, then of course looping should work!

Fingers crossed!

(Note: I'm currently using C++.  A quick search shows that FMOD does have a C# wrapper but so far it seems like C++ is the most well worn path with these things, so I'm sticking to it for now.)
Reply


Messages In This Thread
MOD/Tracker music! SDL does not loop properly - by Domarius - 08-03-2018, 08:57 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)