<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openmpt.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Paper</id>
	<title>OpenMPT Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openmpt.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Paper"/>
	<link rel="alternate" type="text/html" href="https://wiki.openmpt.org/Special:Contributions/Paper"/>
	<updated>2026-05-01T14:58:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.openmpt.org/index.php?title=Development:_Formats/IT&amp;diff=4570</id>
		<title>Development: Formats/IT</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmpt.org/index.php?title=Development:_Formats/IT&amp;diff=4570"/>
		<updated>2024-06-14T14:10:30Z</updated>

		<summary type="html">&lt;p&gt;Paper: schism&amp;#039;s version.c is not dependent on CRT anymore&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;General information concerning the IT file format. Any variable names in this document refer to the original variable names from [https://github.com/schismtracker/schismtracker/wiki/ITTECH.TXT ITTECH.TXT]. Variable names and hexadecimal numbers (in little-endian formats) are indicated by a &amp;lt;tt&amp;gt;monospace font&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note: Impulse tracker is now open source! You can grab the [https://github.com/sagamusix/impulsetracker source code] at GitHub.&lt;br /&gt;
&lt;br /&gt;
== Tracker IDs ==&lt;br /&gt;
&lt;br /&gt;
The IT header contains a field, &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt;, which is used to identify the application that was used to create the file.&lt;br /&gt;
The following custom tracker IDs (read as little-endian hexadecimal numbers) are known to be found in the &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; field:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;0xyy&amp;lt;/tt&amp;gt; - Impulse Tracker x.yy - Many other trackers, like ModPlug Tracker, disguise as various versions of Impulse Tracker, so this is &amp;lt;strong&amp;gt;not&amp;lt;/strong&amp;gt; a reliable way to tell if a file was really made with Impulse Tracker. See [[#Detecting other trackers|below]] for detecting such trackers.&lt;br /&gt;
* &amp;lt;tt&amp;gt;1xyy&amp;lt;/tt&amp;gt; - Schism Tracker x.yy up to Schism Tracker v0.50, later versions encode a timestamp in the version number - see Schism Tracker’s &amp;lt;tt&amp;gt;[https://github.com/schismtracker/schismtracker/blob/master/schism/version.c version.c]&amp;lt;/tt&amp;gt; or OpenMPT’s &amp;lt;tt&amp;gt;[https://source.openmpt.org/browse/openmpt/trunk/OpenMPT/soundlib/Load_it.cpp Load_it.cpp]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;4xyy&amp;lt;/tt&amp;gt; - pyIT x.yy&lt;br /&gt;
* &amp;lt;tt&amp;gt;5xyy&amp;lt;/tt&amp;gt; - OpenMPT x.yy - lower two bytes of version number are stored in the &amp;quot;reserved&amp;quot; header field starting from OpenMPT 1.29.10.00 in compatible mode (otherwise OpenMPT song extensions are used as before).&lt;br /&gt;
* &amp;lt;tt&amp;gt;6xyy&amp;lt;/tt&amp;gt; - BeRoTracker x.yy&lt;br /&gt;
* &amp;lt;tt&amp;gt;7xyz&amp;lt;/tt&amp;gt; - ITMCK x.y.z (N.B. the user can override the value of the &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; header by the &amp;lt;tt&amp;gt;-w&amp;lt;/tt&amp;gt; command-line switch or the &amp;lt;tt&amp;gt;#TRACKER-VERSION&amp;lt;/tt&amp;gt; command in the input file)&lt;br /&gt;
* &amp;lt;tt&amp;gt;7FFF&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Cmwt = 0215&amp;lt;/tt&amp;gt;: munch.py&lt;br /&gt;
* &amp;lt;tt&amp;gt;8xyy&amp;lt;/tt&amp;gt; - Tralala x.yy; prealpha versions, built from svn, before the first release identify as version 0.00 (i.e. Cwt/v=8000)&lt;br /&gt;
* &amp;lt;tt&amp;gt;Cxyy&amp;lt;/tt&amp;gt; - ChickDune ChipTune Tracker x.yy (currently non-public alpha version)&lt;br /&gt;
* &amp;lt;tt&amp;gt;DAEB&amp;lt;/tt&amp;gt; - spc2it (after commit d3d1b524032f668be8ee20d25339e1c635fb9bcf)&lt;br /&gt;
&lt;br /&gt;
Are you a tracker developer and your tracker can save IT files? Please add your Tracker ID to this list!&lt;br /&gt;
&lt;br /&gt;
Once we run out of tracker IDs, a more sophisticated approach will have to be found. For example, the ID &amp;lt;tt&amp;gt;0FFF&amp;lt;/tt&amp;gt; could be reserved, and a pointer to extended tracker information could be placed in the &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; header field.&lt;br /&gt;
&lt;br /&gt;
== Detecting other trackers ==&lt;br /&gt;
&lt;br /&gt;
Some trackers disguise as Impulse Tracker 2, but there are ways to uncover this diguise:&lt;br /&gt;
&lt;br /&gt;
=== BeRoTracker ===&lt;br /&gt;
&lt;br /&gt;
Earlier versions of BeRoTracker, which did not use the tracker ID described above, can be identified by the four byte &amp;lt;tt&amp;gt;MODU&amp;lt;/tt&amp;gt; magic which can be found after the Edit History / MIDI Macro / ModPlug extension block. &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0217&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0214&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;0200&amp;lt;/tt&amp;gt; (overlaps with ModPlug Tracker). The edit history flag is set and there are always 0 entries in the edit history.&lt;br /&gt;
&lt;br /&gt;
=== CheeseTracker ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; are both &amp;lt;tt&amp;gt;0214&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Instrument mode flag is always set. The only other flags that can be optionally set are: Stereo Mode, Linear Slides, Old Effects, Compatible Gxx.&lt;br /&gt;
* The only &amp;lt;tt&amp;gt;special&amp;lt;/tt&amp;gt; flag ever set is the song message flag (even though row highlights are always written).&lt;br /&gt;
* &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;&lt;br /&gt;
* All sample and instrument filenames read &amp;lt;tt&amp;gt;XXXXXXXX.YYY&amp;lt;/tt&amp;gt; (obviously this should not be used as a stand-alone detection criterion, as files re-saved with other trackers will still use these filenames).&lt;br /&gt;
&lt;br /&gt;
=== ChibiTracker ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; are both &amp;lt;tt&amp;gt;0214&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; reads &amp;lt;tt&amp;gt;CHBI&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Further interesting criteria: Sample data is stored directly after header. All sample and instrument filenames read &amp;lt;tt&amp;gt;-DEPRECATED-&amp;lt;/tt&amp;gt; (obviously this should not be used as a stand-alone detection criterion, as files re-saved with other trackers will still use these filenames). ChibiTracker also uses a line feed character (&amp;lt;tt&amp;gt;0A&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;\n&amp;lt;/tt&amp;gt;) instead of a carriage return (&amp;lt;tt&amp;gt;0D&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;\r&amp;lt;/tt&amp;gt;) in the song message.&lt;br /&gt;
&lt;br /&gt;
=== ModPlug Tracker ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ModPlug Tracker 1.0 pre-alpha 4 (and possibly earlier) - 1.0 alpha 4&#039;&#039;&#039;: &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0202&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0200&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;, row highlights are both 0. These attributes alone are not enough to fingerprint these ModPlug Tracker versions, but luckily it also stores the remaining data in a very peculiar order: patterns first, then instrument headers, and then interleaves sample headers and their corresponding sample data. These versions also do not optimize empty 64-row patterns with a 0 parapointer, so they can be identified by checking if the first pattern parapointer is not 0 and less than the first sample parapointer.&lt;br /&gt;
* &#039;&#039;&#039;ModPlug Tracker 1.0 alpha 5&#039;&#039;&#039;: &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0214&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0200&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;. Pattern highlights and edit history flags are not set. Instruments are 560 bytes apart.&lt;br /&gt;
* &#039;&#039;&#039;ModPlug Tracker 1.0 alpha 6 / beta 1 / beta 2&#039;&#039;&#039;: &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0214&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0200&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;. Pattern highlights and edit history flags are set. Instruments are 560 bytes apart up to and including beta 1, in beta 2 they are 557 bytes apart.&lt;br /&gt;
* &#039;&#039;&#039;ModPlug Tracker 1.0 beta 3.2 - 1.07&#039;&#039;&#039;: &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0214&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0202&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;. Instruments are 557 bytes apart.&lt;br /&gt;
* Newer versions of &#039;&#039;&#039;ModPlug Tracker&#039;&#039;&#039;, &#039;&#039;&#039;OpenMPT 1.17 in compatible mode&#039;&#039;&#039;: &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0217&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0200&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;. If there are any instruments in the file, the instrument &amp;lt;tt&amp;gt;TrkVers&amp;lt;/tt&amp;gt; field is &amp;lt;tt&amp;gt;0211&amp;lt;/tt&amp;gt; for ModPlug Tracker and &amp;lt;tt&amp;gt;0220&amp;lt;/tt&amp;gt; for OpenMPT. ModPlug Tracker writes &amp;lt;tt&amp;gt;FF&amp;lt;/tt&amp;gt; for unused channels in the panning map, OpenMPT never does this. When an IT file uses all 64 channels (so the panning map cannot be used for distinction), the presence of ModPlug extensions (channel names, plugin chunks, etc.) can help telling MPT 1.16 and OpenMPT 1.17 compatibility export apart. The latter also does not save a final &amp;quot;---&amp;quot; order list item, while MPT 1.16 does.&lt;br /&gt;
&lt;br /&gt;
=== OpenMPT ===&lt;br /&gt;
&lt;br /&gt;
* OpenMPT 1.17.02.20 to OpenMPT 1.17.02.25 wrote the value &amp;lt;tt&amp;gt;0300&amp;lt;/tt&amp;gt; in both the &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; fields.&lt;br /&gt;
* OpenMPT 1.17.02.26 to OpenMPT 1.18 wrote the value &amp;lt;tt&amp;gt;0888&amp;lt;/tt&amp;gt; in both the &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; fields.&lt;br /&gt;
* Later versions of OpenMPT use the tracker ID provided above. In that case, the &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; field reads &amp;lt;tt&amp;gt;OMPT&amp;lt;/tt&amp;gt; if the file was saved in normal mode, and is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; (or the lower two bytes of version information starting from OpenMPT 1.29.10.00) if it was saved in compatible mode.&lt;br /&gt;
&lt;br /&gt;
=== OpenSPC conversions ===&lt;br /&gt;
&lt;br /&gt;
OpenSPC is a tool to convert SNES music from the SPC format to the IT format. If all the following conditions are true, you can be fairly sure that a module was written with OpenSPC:&lt;br /&gt;
* &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0214&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0200&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Flags&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;09&amp;lt;/tt&amp;gt; (Linear Slides, Stereo Playback).&lt;br /&gt;
* &amp;lt;tt&amp;gt;Special&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Both pattern highlight values are &amp;lt;tt&amp;gt;00&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* No instruments are used.&lt;br /&gt;
* &amp;lt;tt&amp;gt;PatNum&amp;lt;/tt&amp;gt; + 1 == &amp;lt;tt&amp;gt;OrdNum&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Global volume is 128 decimal.&lt;br /&gt;
* Master volume is 100 decimal.&lt;br /&gt;
* Initial Speed is 1.&lt;br /&gt;
* Pan Separation is 128 decimal.&lt;br /&gt;
* Pitch wheel depth is 0.&lt;br /&gt;
* There is no song message, i.e. message length and offset are 0.&lt;br /&gt;
* &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; is 0.&lt;br /&gt;
&lt;br /&gt;
Earlier versions of spc2it (before commit d3d1b524032f668be8ee20d25339e1c635fb9bcf) will be mis-identified as OpenSPC, as the tool closely follows the way its predecessor writes out IT files.&lt;br /&gt;
&lt;br /&gt;
=== Unknown XM to IT conversion tool ===&lt;br /&gt;
&lt;br /&gt;
There is a currently unknown XM to IT conversion tool which can be identified easily by the fact that it writes unsigned samples (which was the default only until Impulse Tracker 2.01). However, only sample slots with actual sample data should be considered for this test, as re-saving such a file in Impulse Tracker will not reset the unsigned flag for empty slots. If the following conditions are true, you can be fairly sure that a module was written with the unknown converter:&lt;br /&gt;
* &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0204&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0200&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Flags&amp;lt;/tt&amp;gt;: Stereo Playback, Instrument Mode, Old Effects are always set, Linear Slides are optional.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Special&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Both pattern highlight values are &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Global volume is 128 decimal.&lt;br /&gt;
* Master volume is 48 decimal.&lt;br /&gt;
* Pan Separation is 128 decimal.&lt;br /&gt;
* Pitch wheel depth is 0.&lt;br /&gt;
* There is no song message, i.e. message length and offset are 0.&lt;br /&gt;
* &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; is 0.&lt;br /&gt;
* Song title is no longer than 20 characters.&lt;br /&gt;
* All channels are panned centre (32) or muted, and their volume is 64 decimal.&lt;br /&gt;
&lt;br /&gt;
To be extra sure, you can check all of these properties, but just checking &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; and unsigned sample data is probably enough.&lt;br /&gt;
&lt;br /&gt;
=== UNMO3 ===&lt;br /&gt;
&lt;br /&gt;
UNMO3 is a tool to convert an MO3-compressed module file back into its original format.&lt;br /&gt;
&lt;br /&gt;
In IT files created with UNMO3, the following are always true:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Cwt/v&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Cmwt&amp;lt;/tt&amp;gt; are &amp;lt;tt&amp;gt;0214&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;pwd&amp;lt;/tt&amp;gt; is 0&lt;br /&gt;
* Both row highlights are 0&lt;br /&gt;
* Flags: Use MIDI Pitch Controller (bit 6) and Request embedded MIDI configuration (bit 7) are never set&lt;br /&gt;
&lt;br /&gt;
This partially overlaps with Impulse Tracker 2.14 and CheeseTracker fingerprints, however:&lt;br /&gt;
* CheeseTracker should write non-zero row highlights, even when resaving an UNMO3-ed file.&lt;br /&gt;
* It is highly unlikely that Impulse Tracker 2.14 writes a &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; value of &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;. If it writes zero row highlights, the row highlight &amp;lt;tt&amp;gt;special&amp;lt;/tt&amp;gt; flag is set.&lt;br /&gt;
* Impulse Tracker 2.14 never writes an empty edit history (see below).&lt;br /&gt;
* CheeseTracker always uses instrument mode.&lt;br /&gt;
&lt;br /&gt;
Some older versions of UNMO3 write out IT files that are malformed in some way or another, but it is easy to detect and work around. Some UNMO3-ed IT files are floating around in the wild, so it may be worthwile to implement those work-arounds:&lt;br /&gt;
&lt;br /&gt;
==== Special flags prior UNMO3 2.4.0.2 ====&lt;br /&gt;
&lt;br /&gt;
* UNMO3 2.4 (released in 2008) and older sets the &amp;lt;tt&amp;gt;special&amp;lt;/tt&amp;gt; flag bits 1 (edit history) and 2 (row highlights) whenever bit 3 (MIDI macros) is set as well.&lt;br /&gt;
* UNMO3 2.4.0.1 (January 2011) always sets the &amp;lt;tt&amp;gt;special&amp;lt;/tt&amp;gt; flag bit 1 (edit history), but the behaviour for bit 2 (row highlights) remains as in previous versions.&lt;br /&gt;
* UNMO3 2.4.0.2 (July 2011) never sets the row highlights flag.&lt;br /&gt;
&lt;br /&gt;
==== Sample mode prior to UNMO3 2.4.0.1 ====&lt;br /&gt;
&lt;br /&gt;
UNMO3 2.4 and older reserves space for the instrument parapointers (as many as there are samples) even when the IT file is in sample mode. This can be detected by the fact that 4 * &amp;lt;tt&amp;gt;SmpNum&amp;lt;/tt&amp;gt; zero bytes follow after the pattern parapointers. These bytes need to be skipped in order to be able to read MIDI macros and ModPlug plugin settings which may potentially follow.&lt;br /&gt;
&lt;br /&gt;
UNMO3 2.4.0.1 fixes this problem.&lt;br /&gt;
&lt;br /&gt;
==== Edit History prior to UNMO3 2.4.0.1 ====&lt;br /&gt;
&lt;br /&gt;
As mentioned above, UNMO3 older than version 2.4.0.1 may or may not set the edit history flag, but they always write two edit history length bytes (zeroes) in the file anyway. Keep this in mind, as MIDI Macros and ModPlug plugin settings will not load properly if you don’t.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Edit history flag is set&#039;&#039;&#039;: Nothing needs to be done. We can still use this for identifying UNMO3-saved IT files, because Impulse Tracker never writes an edit history of length 0.&lt;br /&gt;
* &#039;&#039;&#039;Edit history flag is not set&#039;&#039;&#039;: This is the troublesome case due to MIDI macros and plugin settings. However, a reliable way to detect such malformed IT files would be to try to read the edit history length if all of the above detection criteria for UNMO3 are fulfilled. For those old UNMO3 versions, you should read two zero bytes. If that is the case, it means that the first MIDI macro would be empty (if MIDI macros are embedded) or the first plugin chunk ID starts with two zero bytes (impossible). Since UNMO3 writes out default values for the nine global MIDI macros, the first MIDI macro would have to start with “FF” (MIDI Start) and not be empty, so it is clear that the two zero bytes belong to the (empty) edit history.&lt;br /&gt;
&lt;br /&gt;
Later version of UNMO3 set the correct header flag for the edit history and write the two zero length bytes.&lt;br /&gt;
&lt;br /&gt;
== Special Header Flags ==&lt;br /&gt;
&lt;br /&gt;
The following &amp;quot;Special&amp;quot; flags are not documented:&lt;br /&gt;
&lt;br /&gt;
* Bit 1 (&amp;lt;tt&amp;gt;02&amp;lt;/tt&amp;gt;): If set, edit history information (see [[#Edit History|below]]) is present.&lt;br /&gt;
* Bit 2 (&amp;lt;tt&amp;gt;04&amp;lt;/tt&amp;gt;): If set, the row highlights (at offset &amp;lt;tt&amp;gt;1E&amp;lt;/tt&amp;gt; - &amp;lt;tt&amp;gt;1F&amp;lt;/tt&amp;gt;) should be read. If not set, they should be ignored.&lt;br /&gt;
&lt;br /&gt;
== Edit History ==&lt;br /&gt;
    &lt;br /&gt;
It is little known that the latest versions of Impulse Tracker keep track of when an IT file is opened and how long it is left open.&lt;br /&gt;
The edit history can be found directly after the IT header and before the possibly present MIDI macro configuration.&lt;br /&gt;
&lt;br /&gt;
A 16-Bit integer &amp;lt;tt&amp;gt;num&amp;lt;/tt&amp;gt; tells how many edit history blocks are present. Every block is 8 bytes long, so the 16-bit integer is followed by &amp;lt;tt&amp;gt;8 * num&amp;lt;/tt&amp;gt; bytes of edit history information.&lt;br /&gt;
&lt;br /&gt;
Each history block consists of a 16-Bit FAT date, a 16-Bit FAT time and a 32-Bit DOS timer, which contains the time how long the file was open in the editor, in 1/18.2th seconds.&lt;br /&gt;
Information on how to decode the FAT date and time stamps can be found on the [https://msdn.microsoft.com/en-us/library/windows/desktop/ms724247%28v=vs.85%29.aspx MSDN].&lt;br /&gt;
&lt;br /&gt;
Note: Many programs don’t write an edit history, but they set the edit history flag in the header and write the two zero bytes for the history length. Many of them also ignore the edit history flag when loading files and always read the two &amp;lt;tt&amp;gt;num&amp;lt;/tt&amp;gt; num bytes (ignoring the special flag), so if you want to write out an IT file that does not have an edit history and do not mind about the two extra bytes, the safest (most compatible) way is to set the edit history flag and write two zero bytes for &amp;lt;tt&amp;gt;num&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Also note that none of this is really relevant if you are sure that you never write out the MIDI macro configuration or ModPlug extensions, since these are the only two things that could normally follow the edit history. So if you have no MIDI macros and no ModPlug extensions, it is always safe to not set the special flag and not write the two extra bytes.&lt;br /&gt;
&lt;br /&gt;
== Edit Timer ==&lt;br /&gt;
&lt;br /&gt;
Before the addition of the full Edit History, a simple Edit Timer was stored in the &amp;lt;tt&amp;gt;reserved&amp;lt;/tt&amp;gt; field of the file header. Starting from Impulse Tracker 2.07, this field contains the total edit time as a 32-Bit DOS timer (same resolution as in the Edit History). Starting from Impulse Tracker 2.08, the timer is encrypted. To decrypt:&lt;br /&gt;
&lt;br /&gt;
 editTime = editTime XOR &#039;ITRK&#039;&lt;br /&gt;
 editTime = editTime RoR 7&lt;br /&gt;
 editTime = -editTime&lt;br /&gt;
 editTime = editTime RoL 4&lt;br /&gt;
 editTime = editTime XOR &#039;JTHL&#039;&lt;br /&gt;
&lt;br /&gt;
== Proposed way to store compressed stereo samples ==&lt;br /&gt;
&lt;br /&gt;
Since Impulse Tracker itself does not support stereo samples, a common way of how to decode compressed stereo samples had to be found - After all, it is possible to just treat them as one continuous stream (not stopping the encoding / decoding process after the end of the left channel), or to treat them as two separate, consecutive streams. XMPlay was probably the only player that could handle compressed stereo samples even before there was a single implementation for saving compressed stereo samples. GreaseMonkey has decided to follow [https://www.un4seen.com/forum/?topic=12448.msg86479#msg86479 XMPlay&#039;s way] of decoding compressed stereo samples by treating them as two streams of the same length, so OpenMPT follows this example. If you intend to add IT sample compression support in your application, you should do the same to ensure compatibility across as many applications as possible.&lt;br /&gt;
&lt;br /&gt;
== OpenMPT Hacks ==&lt;br /&gt;
&lt;br /&gt;
For a list of all the file format hacks that ModPlug Tracker / OpenMPT added to the IT format over the years, see the [[Development: OpenMPT Format Extensions|OpenMPT Format Extensions]] article.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development|Formats/IT]]&lt;br /&gt;
[[Category:IT Format|Format Specification]]&lt;/div&gt;</summary>
		<author><name>Paper</name></author>
	</entry>
</feed>