ModPlug Central

Community => General Chatter => Topic started by: Slender on July 05, 2019, 22:24:06

Title: Detection of Saved With Info for files Extracted with Old unmo3 Versions
Post by: Slender on July 05, 2019, 22:24:06
Perhaps may not be appropriate for this forum? This is somewhat related to an earlier bug report of mine, https://bugs.openmpt.org/view.php?id=1132. I noticed that IT files generated by old versions of unmo3 appear to report unknown in the last saved with field, similar to the module in that bug report. TO reproduce, run the depack script in this music disk, which has unmo3 version 0.3 bundled with it. http://armagon.org/mods/buried/musicdisk/BuriED%20-%20Warfare.zip. Is it possible to detect those versions of unmo3? Or is there basically not much that can be done to detect them?
Title: Re: Detection of Saved With Info for files Extracted with Old unmo3 Versions
Post by: manx on July 06, 2019, 05:49:15
Maybe.


   const bool possiblyUNMO3 = fileHeader.cmwt == 0x0214 && fileHeader.cwtv == 0x0214 && fileHeader.highlight_major == 0 && fileHeader.highlight_minor == 0
      && fileHeader.pwd == 0 && fileHeader.reserved == 0 && (fileHeader.flags & (ITFileHeader::useMIDIPitchController | ITFileHeader::reqEmbeddedMIDIConfig)) == 0;


This version of unmo3 sets fileHeader.cwtv = 0, which causes us to skip all unmo3 detection logic.

I am not familiar enough with the IT format to come to any final conclusion here though.

Saga Musix?
Title: Re: Detection of Saved With Info for files Extracted with Old unmo3 Versions
Post by: LPChip on July 06, 2019, 08:45:44
This is a wild guess here, and Saga Musix is probably gonna shoot me for this, so take this with a grain of salt (unless I got it spot on, then yay!)

If I remember correctly, IT file does have compression but not using the MO3 format, and that was added later. I wouldn't be surprised if this bit is set for backwards compatibility.
Title: Re: Detection of Saved With Info for files Extracted with Old unmo3 Versions
Post by: manx on July 06, 2019, 09:00:48
Sorry, LPChip, but you are completely missing the point here ???

This has nothing to do with IT sample compression, or with MO3 sample compression (which does not even exist in IT files, but is native to MO3 files). The problem concerns the tracker that OpenMPT detects as having saved the IT file in question. It gets detected as unkown, if this particular old version of unmo3 wrote the IT file (decompressing it from a MO3 file).
Title: Re: Detection of Saved With Info for files Extracted with Old unmo3 Versions
Post by: LPChip on July 06, 2019, 09:46:48
Thanks for the heads up... It would've been shocking if I actually had gotten it right... :nuts: Oh well.
Title: Re: Detection of Saved With Info for files Extracted with Old unmo3 Versions
Post by: Saga Musix on July 06, 2019, 11:21:54
On first sight it does indeed seem like the file from bug report linked above was uncompressed with the same (or similarly old) UNMO3 version. The sample frequencies are all a couple of Hz off compared to the 8-bit version, which is a big hint that this IT file used to be an MO3 file (early MO3 format revisions didn't allow for the sample frequency in IT files to be stored accurately, it was an approximation similar to XM). I will have a more thorough look later or tomorrow, but I'm relatively certain that your observation is spot-on, and we can update our special case for v0.00 files to say UNMO3 instead of Unknown.
Title: Re: Detection of Saved With Info for files Extracted with Old unmo3 Versions
Post by: Slender on July 06, 2019, 17:22:29
If you do end up updating that special case, it would possibly be safer to just say unmo3 rather than trying to guess the version, unmo3 1.x also wrote 0s, as demonstrated by this disk. http://www.armagon.org/mods/infernal%20mods%20-%20a%20tribute%20to%20death%20(compilation)/Infernal%20Mods.zip
Title: Re: Detection of Saved With Info for files Extracted with Old unmo3 Versions
Post by: Saga Musix on July 07, 2019, 14:54:39
The files posted in this thread and also in that bug report are now all detected as UNMO3-ed files.