Author Topic: List of differences in "ModPlug Mode"  (Read 9248 times)

saga

  • Posts: 2748
List of differences in "ModPlug Mode"
« on: 23 Dec '18 - 19:44 »
MO3 has a header flag that instructs the player to play the file "like ModPlug would" (0x10000). The problem in MO3 files created with MO3 2.4.0 and older is obviously that no exact version information is available in the MO3 file to determine which ModPlug engine quirks should apply.
Can you provide a list of playback behaviours that are affected by this header flag, and if this flag is still used if more accurate version information is available as part of the "VERS" chunk?

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: List of differences in "ModPlug Mode"
« Reply #1 on: 28 Dec '18 - 15:24 »
Most of the MPT tweaks are applied by the MO3 encoder while loading the original file, so they've already been applied in the MO3 file, but there are a few applied by XMPlay during playback:

1) Pitch envelope loop end positions are moved 1 tick back. (pre-1.20 MPT only)
2) Random panning amount is reduced to 25%. (pre-1.26 MPT only)
3) When an offset effect is at/beyond the sample length, playback begins at 0 (or the loop start if looped).
4) FT2 period limits aren't applied to XM files.

MO3 2.4.1 retains the tracker version in a "VERS" chunk. Older MO3 versions didn't retain the tracker version, so #1 and #2 would always be applied in those cases.

saga

  • Posts: 2748
Re: List of differences in "ModPlug Mode"
« Reply #2 on: 28 Dec '18 - 22:04 »
Thanks for the information.

There is one more playback quirk I am wondering about: I have received a bug report for a specific MO3 file not being played correctly in OpenMPT, mainly because one of its own old playback quirks (instrument numbers next to note-offs don't reset default volume and panning in IT files) is not emulated like in old versions of OpenMPT. XMPlay still applies this quirk in this MO3 v1 file, but the "made with modplug" flag is not actually being set in the header: https://www.dropbox.com/s/bsiobot8311srj4/menu.mo3?dl=1
The quirk can be observed on channels 13 to 18, at pattern 2, row 30. Why would XMPlay still apply this ModPlug quirk? Is it tied to the extended filter range flag, perhaps, or is there any other flag that indicates that the file was saved with ModPlug?

I should also mention that behaviour 3 and 4 are already fixed in OpenMPT (IT/XM offset beyond sample length since OpenMPT 1.17.03.02, FT2 period limits since 1.22.04.00), so they should not be applied to current files. Is this being accounted for by no longer setting the "made with modplug" flag?
« Last Edit: 28 Dec '18 - 22:31 by saga »

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: List of differences in "ModPlug Mode"
« Reply #3 on: 1 Jan '19 - 14:36 »
There is one more playback quirk I am wondering about: I have received a bug report for a specific MO3 file not being played correctly in OpenMPT, mainly because one of its own old playback quirks (instrument numbers next to note-offs don't reset default volume and panning in IT files) is not emulated like in old versions of OpenMPT. XMPlay still applies this quirk in this MO3 v1 file, but the "made with modplug" flag is not actually being set in the header: https://www.dropbox.com/s/bsiobot8311srj4/menu.mo3?dl=1
The quirk can be observed on channels 13 to 18, at pattern 2, row 30. Why would XMPlay still apply this ModPlug quirk? Is it tied to the extended filter range flag, perhaps, or is there any other flag that indicates that the file was saved with ModPlug?

I don't see any flags set in that file to explain a difference. For comparison, what happens if you convert it back to an IT file with UNMO3? Does that change how it sounds in XMPlay or OpenMPT?

I should also mention that behaviour 3 and 4 are already fixed in OpenMPT (IT/XM offset beyond sample length since OpenMPT 1.17.03.02, FT2 period limits since 1.22.04.00), so they should not be applied to current files.

Thanks, I'll add MPT version checks to that stuff in the next XMPlay update. XMPlay uses the "Cwt" IT header value to detect MPT version, which doesn't include minor version numbers, so I'll have it check for at least 1.18 and 1.23?

Is this being accounted for by no longer setting the "made with modplug" flag?

If the MPT flag isn't set in a MO3 file then none of the tweaks above will be applied. The MPT flag won't be set if the original file has "IT/XM compatible playback mode" enabled in a ".FSM" chunk, so they can be totally avoided that way.

saga

  • Posts: 2748
Re: List of differences in "ModPlug Mode"
« Reply #4 on: 1 Jan '19 - 23:36 »
Quote
I don't see any flags set in that file to explain a difference. For comparison, what happens if you convert it back to an IT file with UNMO3? Does that change how it sounds in XMPlay or OpenMPT?
Good idea... turns out that XMPlay seems to have its own little quirk here and doesn't behave the same as Impulse Tracker! I have attached the file trimmed down to the relevant section and re-saved it in Impulse Tracker to ensure the most compatible playback. In both OpenMPT and Impulse Tracker you should hear the volume being reset on the note-offs due to the instrument numbers next to it. If the instrument number is different from the previous instrument, the new instrument's default volume should be used, but the old sample should keep playing.
So my issue with getting this file to play right is actually that XMPlay itself also played the file incorrectly. :)
OpenMPT started playing this the same way as Impulse Tracker (i.e. recalling the default volume) with version 1.26. So to preserve compatibility with older MO3 soundtracks like the example I provided, I suggest to keep using the ModPlug behaviour if the "made with modplug" flag is set and no version information is present, or if the version info indicates version 1.25 or older.

Quote
Thanks, I'll add MPT version checks to that stuff in the next XMPlay update. XMPlay uses the "Cwt" IT header value to detect MPT version, which doesn't include minor version numbers, so I'll have it check for at least 1.18 and 1.23?
That sounds correct.

Quote
If the MPT flag isn't set in a MO3 file then none of the tweaks above will be applied. The MPT flag won't be set if the original file has "IT/XM compatible playback mode" enabled in a ".FSM" chunk, so they can be totally avoided that way.
Since the flag is basically always set these days (no way to disable it in the GUI anymore since version 1.26), I guess we're safe here.
« Last Edit: 2 Jan '19 - 11:33 by saga »

saga

  • Posts: 2748
Re: List of differences in "ModPlug Mode"
« Reply #5 on: 3 Jan '19 - 18:34 »
In addition to the first part of my post... I suppose that given the "made with modplug" flag is actually not set (and thus the proposed version checks won't be applied), the "extended filter range" flag and/or stereo samples (not all files in the same soundtrack use extended filter range, but they have the same issue) could be used as an additional indicator for legacy ModPlug files, perhaps?
This should probably not happen if any of the recent MO3 2.4.1 additions are found, though. It should probably also not be applied to any of the other ModPlug hacks, because these already have a well-defined behaviour.
The only alternative I can think of right now would be applying this quirk to any MO3 files with a version older than 5, as those would most likely have been created and verified during a time that a buggy XMPlay version was around.
I can't think of any other heuristics to make this file play as intended after fixing this playback quirk. What do you think?
« Last Edit: 3 Jan '19 - 18:54 by saga »

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: List of differences in "ModPlug Mode"
« Reply #6 on: 4 Jan '19 - 14:47 »
Good idea... turns out that XMPlay seems to have its own little quirk here and doesn't behave the same as Impulse Tracker! I have attached the file trimmed down to the relevant section and re-saved it in Impulse Tracker to ensure the most compatible playback. In both OpenMPT and Impulse Tracker you should hear the volume being reset on the note-offs due to the instrument numbers next to it. If the instrument number is different from the previous instrument, the new instrument's default volume should be used, but the old sample should keep playing.
So my issue with getting this file to play right is actually that XMPlay itself also played the file incorrectly. :)

Ah, XMPlay was only using the new instrument's volume in that scenario when the "Old Effects" flag is set in the IT file's header. Unfortunately, I didn't make a note of the reason for that, so I'm not sure if there were any files that needed it that way. Perhaps it was MPT files. Anyway, here's an XMPlay update that will apply the new instrument's volume to all IT files except pre-1.26 MPT files:

   www.un4seen.com/stuff/xmplay.exe

Let me know if you find it breaks any files :)

saga

  • Posts: 2748
Re: List of differences in "ModPlug Mode"
« Reply #7 on: 4 Jan '19 - 20:03 »
It seems like the note-off is not processed at all now? Going back to the original file I reported, there are now some pretty loud notes right at the start which you don't hear in IT or OpenMPT.

Quote
Anyway, here's an XMPlay update that will apply the new instrument's volume to all IT files except pre-1.26 MPT files:
Just to make sure, it doesn't seem like this is applied to MO3 files with the modplug flag set. Shouldn't it be applied the same way as the other playback modifications described in your first post?
« Last Edit: 4 Jan '19 - 20:17 by saga »

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: List of differences in "ModPlug Mode"
« Reply #8 on: 7 Jan '19 - 15:36 »
Oops! The MPT version check was all wrong there, and the processing was a bit wrong too. Here's another update for you to try:

   www.un4seen.com/stuff/xmplay.exe

I think I also found why the "Old Effects" flag check was there. If that flag's enabled then the envelopes get reset too in this scenario.

saga

  • Posts: 2748
Re: List of differences in "ModPlug Mode"
« Reply #9 on: 7 Jan '19 - 17:52 »
Yup, that sounds better now. :)