<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://moddingwiki.shikadi.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=OmarAlJabbar</id>
	<title>ModdingWiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://moddingwiki.shikadi.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=OmarAlJabbar"/>
	<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/wiki/Special:Contributions/OmarAlJabbar"/>
	<updated>2026-05-14T05:48:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=God_of_Thunder_Music_Format&amp;diff=10169</id>
		<title>God of Thunder Music Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=God_of_Thunder_Music_Format&amp;diff=10169"/>
		<updated>2021-10-12T14:07:41Z</updated>

		<summary type="html">&lt;p&gt;OmarAlJabbar: Some more info about the format itself. The weird tempo for aliens.imf is likely a rounding error due to a the lower target rate.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&lt;br /&gt;
{{Music Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Instruments = OPL&lt;br /&gt;
 | NumChannels = 9 or 11&lt;br /&gt;
 | NumTracks = 1&lt;br /&gt;
 | NumPatterns = 1&lt;br /&gt;
 | NumOrders = 0&lt;br /&gt;
 | Tags = None&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|God of Thunder}}&lt;br /&gt;
}}&lt;br /&gt;
[[God of Thunder]] stores its music in this format.  It is a raw Adlib format, containing the exact register and data pairs to send to the OPL chip.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file begins with a header specifying the offset (in words) of the beginning of loop, that is, where to start playing the song after it finishes. By default it is set to 0x0001 and the song will restart from the very beginning.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] header || Loop start offset from beginning of file (in words)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is then immediately followed by a variable number of three byte chunks.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]] delay || Number of ticks to wait *after* the data has been sent&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]] reg || OPL register to write to&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]] val || Value to write&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to use delays larger than roughly 1 second, the format accepts a second delay byte when setting the MSB to 1 (it resembles [[MID_Format#MIDI_lengths|MIDI lengths]]). For example, &lt;br /&gt;
&lt;br /&gt;
  50      // Hex value 0x50&lt;br /&gt;
  80 D0   // Hex value 0xD0 ((0x80 &amp;amp; 0x7F) &amp;lt;&amp;lt; 8) | 0xD0&lt;br /&gt;
  81 50   // Hex value 0x150 ((0x81 &amp;amp; 0x7F) &amp;lt;&amp;lt; 8) | 0x50&lt;br /&gt;
  FF FF   // Hex value 0x7FFF (0xFF &amp;amp; 0x7F) &amp;lt;&amp;lt; 8) | 0xFF&lt;br /&gt;
&lt;br /&gt;
This allows a maximum delay of about 273 seconds (at 120 Hz).&lt;br /&gt;
&lt;br /&gt;
The very last chunk has all values set to zero, plus a final 0x00 byte. The zero register/data pair designates the end of the song, so a footer metadata is possible but currently unused.&lt;br /&gt;
&lt;br /&gt;
=== Timing ===&lt;br /&gt;
&lt;br /&gt;
Songs are played at a different tempo (i.e. each delay tick lasts a different length of time): &amp;lt;tt&amp;gt;menu.got&amp;lt;/tt&amp;gt; plays at 140 Hz, all other songs plays at 120 Hz.&lt;br /&gt;
Known song lengths (based on Teppic&#039;s PCM recordings of in-game Adlib playback) are:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Song !! Length !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| menu     || 1:15,759 || in got.exe, not in gotres.dat&lt;br /&gt;
|-&lt;br /&gt;
| song11   || 1:41,457 ||&lt;br /&gt;
|-&lt;br /&gt;
| song12   || 2:07,676 ||&lt;br /&gt;
|-&lt;br /&gt;
| song13   || 1:07,647 ||&lt;br /&gt;
|-&lt;br /&gt;
| song14   || 0:59,884 ||&lt;br /&gt;
|-&lt;br /&gt;
| song21   || 1:19,258 ||&lt;br /&gt;
|-&lt;br /&gt;
| song22   || 1:27,120 ||&lt;br /&gt;
|-&lt;br /&gt;
| song23   || 0:34,845 ||&lt;br /&gt;
|-&lt;br /&gt;
| song24   || 1:06,350 ||&lt;br /&gt;
|-&lt;br /&gt;
| song25   || 1:39,959 ||&lt;br /&gt;
|-&lt;br /&gt;
| song31   || 0:55,890 ||&lt;br /&gt;
|-&lt;br /&gt;
| song32   || 0:58,659 ||&lt;br /&gt;
|-&lt;br /&gt;
| opensong || 1:19,821 || Story song - slow version of song33&lt;br /&gt;
|-&lt;br /&gt;
| song33   || 1:13,730 || in-game version of the story song&lt;br /&gt;
|-&lt;br /&gt;
| song34   || 1:11,795 ||&lt;br /&gt;
|-&lt;br /&gt;
| song35   || 1:19,315 ||&lt;br /&gt;
|-&lt;br /&gt;
| song36   || 0:47,887 ||&lt;br /&gt;
|-&lt;br /&gt;
| winsong  || 0:32,918 ||&lt;br /&gt;
|-&lt;br /&gt;
| bosssong || 0:26,169 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- When some songs are converted to this format (e.g. Keen 6 aliens.imf), the tempo speeds up considerably towards the end of the file, so it would seem there is some way of adjusting the song tempo during playback. {{TODO|Check whether it&#039;s a conversion bug. Not a bug, but truncating down very small delays to a lower frequency will result in delays faster than expected. That particular song has very short delays for percussion. Let the converter try rounding instead}} --&amp;gt;&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes =  Incorrect tempo&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://grompe.org.ru/ GromPE&#039;s GoT unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; [[IMF Format|.imf]]&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes =  Incorrect tempo&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://grompe.org.ru/ GromPE&#039;s OPL2WAV]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; [[WAV Format|.wav]]&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes =  Incorrect tempo&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; [[IMF Format|.imf]]&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes =  Incorrect tempo&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Malvineous|Malvineous]].  If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;/div&gt;</summary>
		<author><name>OmarAlJabbar</name></author>
	</entry>
</feed>