ZDoom / ZMusic

GZDoom's music system as a standalone library
https://forum.zdoom.org/index.php
64 stars 33 forks source link

Switch to libxmp for most tracker formats #62

Closed Cacodemon345 closed 1 month ago

Cacodemon345 commented 1 month ago

This PR switches to libxmp (the 4.6.0 release) for most tracker formats (DUMB was officially declared dead in April of this year).

DSM still needs foo_DUMB for playback since libxmp does not support it so it has been left there.

What is supported:

  1. All foo_DUMB formats except DSM.
  2. Galaxy Sound System formats.
  3. UMX container format (tracker-only, no support for WAV/MP2 types).
  4. Pretty much all formats listed as supported in https://xmp.sourceforge.net/.
  5. Master volume (hard clamped to 0-200).
  6. Interpolation modes.
  7. Sample rate adjustment.

What isn't supported:

  1. Volume ramp style (appears to be handled dynamically).
  2. Chip-O-Matic (interpolation can't be turned off for individual samples).
  3. Interpolations modes other than Aliasing/Nearest, Linear, Cubic.
Cacodemon345 commented 1 month ago

Done.

Cacodemon345 commented 1 month ago

libxmp's output shouldn't require float conversion on any merits; it already internally clamps the output to avoid clipping problems and was tested specifically for that.

It also employs additional safeguards to not cause clipping problems IIRC. So it doesn't make sense to convert the output to float and apply the master volume like that when the library can already do it without any problems.

Cacodemon345 commented 1 month ago

Switched to float output anyways.

coelckers commented 1 month ago

That's better.

I think we should add an option to select the default module player as a user setting and as a song setting, similar to $mididevice. XMP tends to sound a little different than Dumb and some people may prefer Dumb. I'll look into that.

Cacodemon345 commented 1 month ago

I don't really believe DUMB should be made available anymore; the author tells people to use libopenmpt because of it having similar or better playback quality than it, and it's not exactly maintained.

It can be maybe left as an option anyways, but libxmp should remain the default for now.

coelckers commented 1 month ago

Our Dumb version hasn't been updated for 10 years or so, so it doesn't really matter what the author says - but the fact remains that it can sound different and some people may be bothered by it. The option doesn't cost much except for a new entry in the menu, so why not?