<?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=Wohlstand</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=Wohlstand"/>
	<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/wiki/Special:Contributions/Wohlstand"/>
	<updated>2026-06-28T03:48:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=12637</id>
		<title>OP2 Bank Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=12637"/>
		<updated>2025-11-02T23:52:59Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Instrument */ Clarify note offsets descriptions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Type2 = MIDI&lt;br /&gt;
 | Count = 175&lt;br /&gt;
 | Names = Yes, 31 char&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Chex Quest}}&lt;br /&gt;
   {{Game|Chex Quest 2}}&lt;br /&gt;
   {{Game|Doom}}&lt;br /&gt;
   {{Game|Doom 2}}&lt;br /&gt;
   {{Game|Heretic}}&lt;br /&gt;
   {{Game|Hexen}}&lt;br /&gt;
   {{Game|Raptor}}&lt;br /&gt;
   {{Game|Strife}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;OP2 Bank Format&#039;&#039;&#039; is an instrument bank format used by the DMX sound library developed by Paul Radek of Digital Expressions, Inc. The 128 melodic and 47 percussion instrument limit was most likely chosen so that a single OP2 file could store all the instruments for a General MIDI song. This bank has support for two-voice instruments to provide support for pseudo four-operator instruments. File of this format usually has &amp;lt;tt&amp;gt;GENMIDI&amp;lt;/tt&amp;gt; name without extension as embedded WAD resource, but also can have &amp;lt;tt&amp;gt;.OP2&amp;lt;/tt&amp;gt; extension.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][8] || magic || &amp;lt;tt&amp;gt;#OPL_II#&amp;lt;/tt&amp;gt; signature, doesn&#039;t null terminated&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][175][36] || instrument || Set of 175 instrument entry&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][175][32] || names || Instrument names per every instrument entry, must be null terminated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument===&lt;br /&gt;
&lt;br /&gt;
Each bank contains 128 melodic and 47 percussion instruments.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || flags || N/A || Instrument flags: 0x01 - fixed note, 0x02 - delayed vibrato (unused), 0x04 - Double-voice mode&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || fineTune ||  N/A || Second voice detune level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || noteNum ||  N/A || Percussion note number, or the note to play when fixed note flag is enabled (between 0 and 128)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|First voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar1     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack1   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain1  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel1  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale1    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel1    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback1    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar1     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack1   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain1  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel1  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale1    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel1    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved1     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset1 || N/A || MIDI note offset for a first voice (ignored when &amp;quot;fixed note&amp;quot; flag is set)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|Second voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar2     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack2   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain2  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel2  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale2    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel2    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback2    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar2     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack2   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain2  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel2  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale2    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel2    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved2     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset2 || N/A || MIDI note offset for a second voice (ignored when &amp;quot;fixed note&amp;quot; flag is set)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument names===&lt;br /&gt;
After 175&#039;th instrument is folowing an array of 32-byte null-terminated instrument names&lt;br /&gt;
&lt;br /&gt;
=== Fine tune ===&lt;br /&gt;
Fine tune value is an index offset of frequencies table. 128 is a center, i.e. don&#039;t detune. Formula of index offset is: &amp;lt;tt&amp;gt;(fine_tune / 2) - 64&amp;lt;/tt&amp;gt;. Each unit of fine tune field is approximately equal to 1/0.015625 of tone. &lt;br /&gt;
&lt;br /&gt;
=== Percussion instruments ===&lt;br /&gt;
Percussion instruments are in range between 35 (Bass drum 1) and 81 (Open Triangle) MIDI indeces.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.vgmpf.com/Wiki/index.php/IMF_Creator IMF Creator]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; .op2&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = Yes; delayed vibrato&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Utility by Adam Biser to create IMF music. Also includes OP2 bank editor.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DRO_Format&amp;diff=12451</id>
		<title>DRO Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DRO_Format&amp;diff=12451"/>
		<updated>2025-09-14T20:01:25Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Tools */ Added OPL3 Bank Editor that can import instruments from DRO files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Instruments = OPL&lt;br /&gt;
 | NumChannels = 9 or 11 (OPL2), 18 or 22 (Dual OPL2 and OPL3)&lt;br /&gt;
 | NumTracks = 1&lt;br /&gt;
}}&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;u&amp;gt;D&amp;lt;/u&amp;gt;OSBox &amp;lt;u&amp;gt;R&amp;lt;/u&amp;gt;aw &amp;lt;u&amp;gt;O&amp;lt;/u&amp;gt;PL (DRO)&amp;lt;/b&amp;gt; format is used for storing captured OPL data from a game running in the cross-platform DOS emulator [http://dosbox.sourceforge.net DOSBox].&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file begins with a header:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|BYTE[8]||cSignature||&amp;quot;DBRAWOPL&amp;quot; (not NULL-terminated)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iVersionMajor||Version number (high)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iVersionMinor||Version number (low)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The rest of the header depends on the version.  If iVersionMajor is 5 and iVersionMinor is 6, then the version would be called &amp;quot;5.6&amp;quot; here.&lt;br /&gt;
&lt;br /&gt;
=== Version 0.1 ===&lt;br /&gt;
&lt;br /&gt;
The first version of the DRO Format was used up to and including DOSBox version 0.72.  Note that the major and minor field names were swapped beginning with DOSBox 0.73, so this version used to be 1.0, but after DOSBox 0.73 it became 0.1 instead.&lt;br /&gt;
&lt;br /&gt;
==== Header ====&lt;br /&gt;
&lt;br /&gt;
The version 0.1 header follows on directly from the main file header.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT32LE||iLengthMS||Length of the song in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
|UINT32LE||iLengthBytes||Length of the song data in bytes&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iHardwareType||Flag listing the hardware used in the song&lt;br /&gt;
|-&lt;br /&gt;
|UINT8[3]||iHardwareExtra||Rest of hardware type or song data (see below)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;iHardwareType&#039;&#039; is one of the following values:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;iHardwareType&#039;&#039;!!Description&lt;br /&gt;
|-&lt;br /&gt;
|0||OPL2&lt;br /&gt;
|-&lt;br /&gt;
|1||OPL3&lt;br /&gt;
|-&lt;br /&gt;
|2||Dual OPL2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In early files, the field was a UINT8, however in most common (recent) files it is a UINT32LE with only the first byte used.  Unfortunately the version number was not changed between these revisions, so the only way to correctly identify the formats is to check the three &amp;lt;tt&amp;gt;iHardwareExtra&amp;lt;/tt&amp;gt; bytes.  If these are all zero then they can safely be ignored (iHardwareType was a UINT32.)  If any of the three bytes in &amp;lt;tt&amp;gt;iHardwareExtra&amp;lt;/tt&amp;gt; are non-zero, then this is an early revision of the format and those three bytes are actually song data&amp;lt;ref&amp;gt;In the [http://adplug.sourceforge.net AdPlug distribution], tests/samurai.dro is the early one-byte format, and doofus.dro is the later four-byte variant.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Song data ====&lt;br /&gt;
&lt;br /&gt;
Directly following the header is &#039;&#039;iLengthBytes&#039;&#039; bytes of OPL data.  The first byte in the song data will be the OPL register, followed by the byte to send to that register.  The &amp;quot;register&amp;quot; can also be one of these control values:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Register value!!Data size!!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x00||1||Delay.  The single data byte following should be incremented by one, and is then the delay in milliseconds.&lt;br /&gt;
|-&lt;br /&gt;
|0x01||2||Delay.  Same as above only there are two bytes following, in the form of a UINT16LE integer.&lt;br /&gt;
|-&lt;br /&gt;
|0x02||0||Switch to &amp;quot;low&amp;quot; OPL chip (#0)&lt;br /&gt;
|-&lt;br /&gt;
|0x03||0||Switch to &amp;quot;high&amp;quot; OPL chip (#1)&lt;br /&gt;
|-&lt;br /&gt;
|0x04||2||Escape - the next two bytes are normal register/value pairs even though the register might be 0x00-0x04&lt;br /&gt;
|-&lt;br /&gt;
|Other||1||Anything else should be treated as an OPL register, with the byte following being the data to send to that register.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The delays all need to be incremented by one, as having a delay of zero milliseconds would be a waste of space.  Codes 0x02 and 0x03 switch between two OPL chips in dual OPL2 mode, or between register banks in OPL3 mode.  These should only be used if the hardware flag in the header indicates the file is in dual-OPL2 or OPL3 format.&lt;br /&gt;
&lt;br /&gt;
All delays are in milliseconds (which can be treated as 1000Hz if converting between other formats.)&lt;br /&gt;
&lt;br /&gt;
=== Version 2.0 ===&lt;br /&gt;
&lt;br /&gt;
Version 2.0 of the DRO Format was introduced with DOSBox 0.73.&lt;br /&gt;
&lt;br /&gt;
==== Header ====&lt;br /&gt;
&lt;br /&gt;
The version 2.0 header also follows on directly from the main file header.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT32LE||iLengthPairs||Length of the song in register/value pairs (TODO: confirm - 1 == one register + one value, or two bytes)&lt;br /&gt;
|-&lt;br /&gt;
|UINT32LE||iLengthMS||Length of the song data (&amp;quot;chunk&amp;quot; -?) in milliseconds&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iHardwareType||Flag listing the hardware used in the song&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iFormat||Data arrangement&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCompression||Compression type, zero means no compression (currently only zero is used)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iShortDelayCode||Command code for short delay (1-256ms)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iLongDelayCode||Command code for short delay (&amp;gt; 256ms)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCodemapLength||Number of entries in codemap table&lt;br /&gt;
|-&lt;br /&gt;
|UINT8[iCodemapLength]||iCodemap||Codemap table (see below)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;iHardwareType&#039;&#039; is one of the following values: (which are different in v1.0 and v2.0)&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;iHardwareType&#039;&#039;!!Description&lt;br /&gt;
|-&lt;br /&gt;
|0||OPL2&lt;br /&gt;
|-&lt;br /&gt;
|1||Dual OPL2&lt;br /&gt;
|-&lt;br /&gt;
|2||OPL3&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;iFormat&#039;&#039; is one of the following values:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;iFormat&#039;&#039;!!Description&lt;br /&gt;
|-&lt;br /&gt;
|0||Commands and data are interleaved (default/as per v1.0)&lt;br /&gt;
|-&lt;br /&gt;
|1||Maybe all commands, followed by all data (unused? - TODO: Confirm)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* &#039;&#039;iLengthMS&#039;&#039; is at a different offset in v1.0 and v2.0&lt;br /&gt;
* The &#039;&#039;iShortDelayCode&#039;&#039; value must have one added to it, as per v1.0 (so a short delay of 2 == a 3ms delay)&lt;br /&gt;
* The &#039;&#039;iLongDelayCode&#039;&#039; value must have one added to it, then be multiplied by 256 (or &amp;quot;&amp;lt;&amp;lt; 8&amp;quot;), so a long delay of 2 == a 768ms delay&lt;br /&gt;
* Because the high bit in each codeword is used to refer to the second OPL2 chip (or the second set of registers in an OPL3), there are only 128 possible codewords (0-127).  Therefore &#039;&#039;iCodemapLength&#039;&#039; must always be 128 or less.&lt;br /&gt;
* DOSBox dumps a snapshot of the current register state at the beginning of a capture.  (Any other registers are assumed initialised to zero.)  This means that even an OPL2 only song will appear to have some data sent to the second OPL chip, because of this initial snapshot.  To really know whether the second OPL chip is in use, you can find out if it is actually making any sound, like so:&lt;br /&gt;
** Examine bit 5 (0x20) on registers 0xB0 to 0xB8.  If this bit is set, a note is playing and the chip is being used.&lt;br /&gt;
** Check whether bitmask 0x1F on register 0xBD is greater than 0x10 (i.e. &amp;lt;code&amp;gt;if (reg[0xBD] &amp;amp; 0x1F &amp;gt; 0x10) ...&amp;lt;/code&amp;gt;).  If so, the chip is in percussive mode and a rhythm instrument is being played, so the chip is being used.&lt;br /&gt;
&lt;br /&gt;
===== Codemap table =====&lt;br /&gt;
The codemap table maps index numbers to OPL registers.  As there are 256 possible OPL registers but only a subset of these actually used, the mapping table allows up to 128 OPL registers to be used in a song.  The other 128 (with the high bit set) are used for the second OPL2 chip in a dual-OPL2 capture.&lt;br /&gt;
&lt;br /&gt;
The table is a list of &#039;&#039;iCodemapLength&#039;&#039; bytes, with the index used later in the file.  For example this code table:&lt;br /&gt;
&lt;br /&gt;
 01 04 05 08 BD&lt;br /&gt;
&lt;br /&gt;
Means that when the song references register #0 the data should be sent to OPL register 0x01, when the song references register #4 the data should go to OPL register 0xBD.  If the song references register #128 (i.e. register 128+0), data should be sent to OPL register 0x01 on the &#039;&#039;&#039;second&#039;&#039;&#039; chip (in dual OPL2 mode) or the second set of registers (OPL3 mode).  Likewise register #132 (128+4) is OPL register 0xBD on the &#039;&#039;&#039;second&#039;&#039;&#039; chip.&lt;br /&gt;
&lt;br /&gt;
==== Song data ====&lt;br /&gt;
&lt;br /&gt;
Directly following the header is the song data in register index and value pairs.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iRegisterIndex||Register to write to.  This is an index into the codemap table.&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iValue||Value to write to the OPL register&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This structure is repeated &#039;&#039;iLengthPairs&#039;&#039; times.  Note that while &#039;&#039;iRegisterIndex&#039;&#039; is normally an index into the codemap table, it can also match &#039;&#039;iShortDelayCode&#039;&#039; or &#039;&#039;iLongDelayCode&#039;&#039; if &#039;&#039;iValue&#039;&#039; is to be treated as a delay length (see above.)  If the high bit is set (&amp;lt;code&amp;gt;iRegisterIndex &amp;amp; 0x80&amp;lt;/code&amp;gt;) then it is a register on the second OPL chip in a dual-OPL2 song (so the high bit should be removed and the value looked up as normal, but then sent to the second OPL chip instead.)&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[AdPlug]]&lt;br /&gt;
| Platform = Windows/Linux/DOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes = v1/v2&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&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 = v1/v2&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.dosbox.com/ DOSBox]&lt;br /&gt;
| Platform = Windows/Mac/Linux&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes = v2-only since 0.73.  Produces .dro files as a result of capturing Adlib data from DOS games and applications&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.jestarjokin.net/apps/drotrimmer DRO Trimmer]&lt;br /&gt;
| Platform = Any (Python)&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes = Edits .dro files to remove unwanted notes from the start and end&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.shikadi.net/utils/dro2imf DRO2IMF]&lt;br /&gt;
| Platform = Windows/Mac/Linux&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 = Converts v1/v2 .dro to .imf&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[DRO2MIDI]]&lt;br /&gt;
| Platform = Windows/Mac/Linux&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; [[MID Format|.mid]]&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes = Converts v1/v2 .dro and .imf to .mid&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OpenMPT]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes = OpenMPT 1.30 and newer can export a DRO v1 register dump for songs that use OPL instruments.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = OPL3 Bank Editor can import FM instruments from DRO files&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Similar formats ==&lt;br /&gt;
* [[RAW Format (Adlib)|Rdos&#039; RAW format]] serves the same purpose, only these files were originally created through the RAC (Rdos Adlib Capture) TSR running under native DOS.&lt;br /&gt;
* The [[IMF Format|id Software Music Format (IMF)]] stores Adlib data in a similar manner in order to provide background music in many Apogee games.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OPL3_Bank_Editor&amp;diff=11169</id>
		<title>OPL3 Bank Editor</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OPL3_Bank_Editor&amp;diff=11169"/>
		<updated>2023-08-03T01:52:58Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Slightly tweaked the list of features.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tool Infobox&lt;br /&gt;
 | Platform = GNU/Linux, Windows, macOS&lt;br /&gt;
 | Release = 2016-06-09&lt;br /&gt;
 | Homepage = [https://github.com/Wohlstand/OPL3BankEditor/blob/master/README.md OPL3 Bank Editor]&lt;br /&gt;
 | Download = [https://github.com/Wohlstand/OPL3BankEditor github.com]&lt;br /&gt;
 | Edit1 = Instrument&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OPL3 Bank Editor&#039;&#039;&#039; is a free and open-source utility to create and edit various music instrument bank formats, developed by [[User:Wohlstand|Wohlstand]]. Various bank formats are had no own bank editor (For example, [[TMB Format]] which is a result of a generating by merging and chopping of two IBK files by official MAKETMB utility, or [[Junglevision Patch File Format]] which has proprietary bank editor that wasn&#039;t available in public), or had them be inconvenient. This bank editor allows working with all those formats by having same and friendly UI.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
* Support for 2-operator, pseudo-4-operator, and 4-operator instruments and banks.&lt;br /&gt;
* Instrument testing through Nuked OPL3, DosBox OPL3, Opal, Java OPL3, and YMFM emulators.&lt;br /&gt;
* Instrument testing on hardware using various Serial Port protocols, C-Media chips, and through the Windows 98 version to test on real Sound Blaster or compatible sound cards.&lt;br /&gt;
* Playing single notes and various chords.&lt;br /&gt;
* Mouse-clickable piano claves to test various notes.&lt;br /&gt;
* Keyboard can be used to test instruments like on a piano.&lt;br /&gt;
* &amp;quot;Shut-up&amp;quot; button which allows to quickly mute all chip&#039;s channels.&lt;br /&gt;
* Tool-tips are describing purposes of every field.&lt;br /&gt;
* Import/Export of single instrument files.&lt;br /&gt;
* Instrument import from music files such as from [[IMF Format|IMF]] and [[CMF Format|CMF]].&lt;br /&gt;
* Ability to toggle global Deep Tremolo and Deep Vibrato flags.&lt;br /&gt;
* Support for both melodic and rhythm mode percussions.&lt;br /&gt;
* Performance benchmark of supported emulators.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.vogons.org/viewtopic.php?f=9&amp;amp;t=48513 Support thread on VOGONS forum]&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=File:OPL3_Bank_Editor.png&amp;diff=11168</id>
		<title>File:OPL3 Bank Editor.png</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=File:OPL3_Bank_Editor.png&amp;diff=11168"/>
		<updated>2023-08-03T01:50:02Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Wohlstand uploaded a new version of File:OPL3 Bank Editor.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OPL3_Bank_Editor&amp;diff=9946</id>
		<title>OPL3 Bank Editor</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OPL3_Bank_Editor&amp;diff=9946"/>
		<updated>2021-08-16T14:54:43Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Minor fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tool Infobox&lt;br /&gt;
 | Platform = GNU/Linux, Windows, macOS&lt;br /&gt;
 | Release = 2016-06-09&lt;br /&gt;
 | Homepage = [https://github.com/Wohlstand/OPL3BankEditor/blob/master/README.md OPL3 Bank Editor]&lt;br /&gt;
 | Download = [https://github.com/Wohlstand/OPL3BankEditor github.com]&lt;br /&gt;
 | Edit1 = Instrument&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OPL3 Bank Editor&#039;&#039;&#039; is a free and open-source utility to create and edit various music instrument bank formats, developed by [[User:Wohlstand|Wohlstand]]. Various bank formats are had no own bank editor (For example, [[TMB Format]] which is a result of a generating by merging and chopping of two IBK files by official MAKETMB utility, or [[Junglevision Patch File Format]] which has proprietary bank editor that wasn&#039;t available in public), or had them be inconvenient. This bank editor allows working with all those formats by having same and friendly UI.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
* Support for 2-operator, pseudo-4-operator, and 4-operator instruments and banks&lt;br /&gt;
* Instrument testing through Nuked OPL3 emulator&lt;br /&gt;
* Playing single notes and various chords&lt;br /&gt;
* Mouse-clickable piano claves to test various notes&lt;br /&gt;
* Keyboard can be used to test instruments like on a piano&lt;br /&gt;
* &amp;quot;Shut-up&amp;quot; button which allows to quickly mute all chip&#039;s channels&lt;br /&gt;
* Tool-tips are describing purposes of every field&lt;br /&gt;
* Import/Export of single instrument files&lt;br /&gt;
* Instrument import from music files such as from [[IMF Format|IMF]] and [[CMF Format|CMF]]&lt;br /&gt;
* Ability to toggle global Deep Tremolo and Deep Vibrato flags&lt;br /&gt;
* Support for both melodic and rhythm mode percussions&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.vogons.org/viewtopic.php?f=9&amp;amp;t=48513 Support thread on VOGONS forum]&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=9138</id>
		<title>OP2 Bank Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=9138"/>
		<updated>2020-08-16T14:33:12Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Type2 = MIDI&lt;br /&gt;
 | Count = 175&lt;br /&gt;
 | Names = Yes, 31 char&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Chex Quest}}&lt;br /&gt;
   {{Game|Chex Quest 2}}&lt;br /&gt;
   {{Game|Doom}}&lt;br /&gt;
   {{Game|Doom 2}}&lt;br /&gt;
   {{Game|Heretic}}&lt;br /&gt;
   {{Game|Hexen}}&lt;br /&gt;
   {{Game|Raptor}}&lt;br /&gt;
   {{Game|Strife}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;OP2 Bank Format&#039;&#039;&#039; is an instrument bank format used by the DMX sound library developed by Paul Radek of Digital Expressions, Inc. The 128 melodic and 47 percussion instrument limit was most likely chosen so that a single OP2 file could store all the instruments for a General MIDI song. This bank has support for two-voice instruments to provide support for pseudo four-operator instruments. File of this format usually has &amp;lt;tt&amp;gt;GENMIDI&amp;lt;/tt&amp;gt; name without extension as embedded WAD resource, but also can have &amp;lt;tt&amp;gt;.OP2&amp;lt;/tt&amp;gt; extension.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][8] || magic || &amp;lt;tt&amp;gt;#OPL_II#&amp;lt;/tt&amp;gt; signature, doesn&#039;t null terminated&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][175][36] || instrument || Set of 175 instrument entry&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][175][32] || names || Instrument names per every instrument entry, must be null terminated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument===&lt;br /&gt;
&lt;br /&gt;
Each bank contains 128 melodic and 47 percussion instruments.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || flags || N/A || Instrument flags: 0x01 - fixed pitch, 0x02 - delayed vibrato (unused), 0x04 - Double-voice mode&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || fineTune ||  N/A || Second voice detune level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || noteNum ||  N/A || Percussion note number (between 0 and 128)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|First voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar1     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack1   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain1  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel1  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale1    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel1    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback1    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar1     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack1   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain1  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel1  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale1    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel1    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved1     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset1 || N/A || MIDI note offset for a first voice&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|Second voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar2     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack2   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain2  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel2  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale2    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel2    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback2    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar2     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack2   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain2  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel2  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale2    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel2    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved2     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset2 || N/A || MIDI note offset for a second voice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument names===&lt;br /&gt;
After 175&#039;th instrument is folowing an array of 32-byte null-terminated instrument names&lt;br /&gt;
&lt;br /&gt;
=== Fine tune ===&lt;br /&gt;
Fine tune value is an index offset of frequencies table. 128 is a center, i.e. don&#039;t detune. Formula of index offset is: &amp;lt;tt&amp;gt;(fine_tune / 2) - 64&amp;lt;/tt&amp;gt;. Each unit of fine tune field is approximately equal to 1/0.015625 of tone. &lt;br /&gt;
&lt;br /&gt;
=== Percussion instruments ===&lt;br /&gt;
Percussion instruments are in range between 35 (Bass drum 1) and 81 (Open Triangle) MIDI indeces.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.vgmpf.com/Wiki/index.php/IMF_Creator IMF Creator]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; .op2&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = Yes; delayed vibrato&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Utility by Adam Biser to create IMF music. Also includes OP2 bank editor.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=9137</id>
		<title>OP2 Bank Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=9137"/>
		<updated>2020-08-16T14:27:32Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: The true sense of 0x02 instrument flag is &amp;quot;DELAYED_VIB&amp;quot; (Delayed vibrato), however, it&amp;#039;s unused.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Type2 = MIDI&lt;br /&gt;
 | Count = 175&lt;br /&gt;
 | Names = Yes, 31 char&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Chex Quest}}&lt;br /&gt;
   {{Game|Chex Quest 2}}&lt;br /&gt;
   {{Game|Doom}}&lt;br /&gt;
   {{Game|Doom 2}}&lt;br /&gt;
   {{Game|Heretic}}&lt;br /&gt;
   {{Game|Hexen}}&lt;br /&gt;
   {{Game|Raptor}}&lt;br /&gt;
   {{Game|Strife}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;OP2 Bank Format&#039;&#039;&#039; is an instrument bank format used by the DMX sound library developed by Paul Radek of Digital Expressions, Inc. The 128 melodic and 47 percussion instrument limit was most likely chosen so that a single OP2 file could store all the instruments for a General MIDI song. This bank has support for two-voice instruments to provide support for pseudo four-operator instruments. File of this format usually has &amp;lt;tt&amp;gt;GENMIDI&amp;lt;/tt&amp;gt; name without extension as embedded WAD resource, but also can have &amp;lt;tt&amp;gt;.OP2&amp;lt;/tt&amp;gt; extension.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][8] || magic || &amp;lt;tt&amp;gt;#OPL_II#&amp;lt;/tt&amp;gt; signature, doesn&#039;t null terminated&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][175][36] || instrument || Set of 175 instrument entry&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][175][32] || names || Instrument names per every instrument entry, must be null terminated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument===&lt;br /&gt;
&lt;br /&gt;
Each bank contains 128 melodic and 47 percussion instruments.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || flags || N/A || Instrument flags: 0x01 - fixed pitch, 0x02 - delayed vibrato (unused), 0x04 - Double-voice mode&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || fineTune ||  N/A || Second voice detune level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || noteNum ||  N/A || Percussion note number (between 0 and 128)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|First voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar1     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack1   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain1  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel1  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale1    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel1    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback1    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar1     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack1   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain1  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel1  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale1    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel1    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved1     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset1 || N/A || MIDI note offset for a first voice&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|Second voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar2     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack2   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain2  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel2  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale2    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel2    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback2    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar2     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack2   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain2  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel2  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale2    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel2    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved2     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset2 || N/A || MIDI note offset for a second voice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument names===&lt;br /&gt;
After 175&#039;th instrument is folowing an array of 32-byte null-terminated instrument names&lt;br /&gt;
&lt;br /&gt;
=== Fine tune ===&lt;br /&gt;
Fine tune value is an index offset of frequencies table. 128 is a center, i.e. don&#039;t detune. Formula of index offset is: &amp;lt;tt&amp;gt;(fine_tune / 2) - 64&amp;lt;/tt&amp;gt;. Each unit of fine tune field is approximately equal to 1/0.015625 of tone. &lt;br /&gt;
&lt;br /&gt;
=== Percussion instruments ===&lt;br /&gt;
Percussion instruments are in range between 35 (Bass drum 1) and 81 (Open Triangle) MIDI indeces.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.vgmpf.com/Wiki/index.php/IMF_Creator IMF Creator]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; .op2&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = Yes; Unknown flag&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Utility by Adam Biser to create IMF music. Also includes OP2 bank editor.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=8060</id>
		<title>Apogee Sound System Timbre Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=8060"/>
		<updated>2018-09-12T12:03:00Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added &amp;quot;Rise of the Triad&amp;quot; game&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Type2 = MIDI&lt;br /&gt;
 | Count = 256&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Duke Nukem 3D}}&lt;br /&gt;
   {{Game|Blood}}&lt;br /&gt;
   {{Game|Shadow Warrior}}&lt;br /&gt;
   {{Game|NAM}}&lt;br /&gt;
   {{Game|Rise of the Triad}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Apogee Sound System Timbre Format&#039;&#039;&#039; is an instrument bank format used by the Apogee Sound System library developed by 3D Realms. The 128 melodic and 128 percussion instrument limit was most likely chosen so that a single TMB file could store all the instruments for a General MIDI song. Files of this format are has &amp;lt;tt&amp;gt;.tmb&amp;lt;/tt&amp;gt; extension.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
TMB files have no header and signature. The file contains 256 13-byte instrument entries (first 128 are melodic, and next 128 are percussion).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || SAVEK[0] ||  0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || SAVEK[1] ||  0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[0] ||  0x40 || Modulator key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[1] ||  0x43 || Carrier key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[0]  ||  0x60 || Modulator attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[1]  ||  0x63 || Carrier attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[0]  ||  0x80 || Modulator sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[1]  ||  0x83 || Carrier sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[0]  ||  0xE0 || Modulator wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[1]  ||  0xE3 || Carrier wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Feedback ||  0xC0 || Feedback/connection&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Transpose ||  N/A  || Note offset for melodic instruments, and key number for percussion&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Velocity  ||  N/A  || Velocity offset&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The TMB format is directly based on [[IBK Format]], and has first 12 bytes be same as in the IBK Format. Official &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt; utility (can be found with the source code of 3D Realms games in the Audio Library public folder) generates TMB files from the set of IBK files.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; .tmb&lt;br /&gt;
| canImport = Yes; [[IBK Format|.ibk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;Apogee Sound System&#039;&#039; SDK&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=IMF_Format&amp;diff=7176</id>
		<title>IMF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=IMF_Format&amp;diff=7176"/>
		<updated>2017-08-06T12:47:18Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Timing */ Major Stryker has 560 Hz&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
 | Tags = Unofficial: Title, Composer, Remarks, Program name&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Blake Stone}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Commander Keen 4-6}}&lt;br /&gt;
   {{Game|Corridor 7 Alien Invasion}}&lt;br /&gt;
   {{Game|Cosmo&#039;s Cosmic Adventures}}&lt;br /&gt;
   {{Game|Duke Nukem II}}&lt;br /&gt;
   {{Game|Hocus Pocus}}&lt;br /&gt;
   {{Game|Major Stryker}}&lt;br /&gt;
   {{Game|Monster Bash}}&lt;br /&gt;
   {{Game|Operation Body Count}}&lt;br /&gt;
   {{Game|Realms of Chaos}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;u&amp;gt;i&amp;lt;/u&amp;gt;d Software &amp;lt;u&amp;gt;M&amp;lt;/u&amp;gt;usic &amp;lt;u&amp;gt;F&amp;lt;/u&amp;gt;ormat (IMF)&amp;lt;/b&amp;gt; is a raw music format that stores the actual bytes sent to the Adlib&#039;s [[OPL2]] chip.  For this reason it is a very simple format to process.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
There are two versions of the IMF format: &amp;lt;b&amp;gt;Type-0&amp;lt;/b&amp;gt; format and &amp;lt;b&amp;gt;Type-1&amp;lt;/b&amp;gt; format.  In a Type-0 file, the whole file is Adlib data that is played until the end of the file is reached.  Type-1 files are actually ripped chunks from an [[AudioT Format]] file. No game ever actually used Type-1 IMFs that were not stored inside an AudioT file. The two initial bytes contain the size of the Adlib data (not including the two bytes themselves), so only this much data is played.  This means it&#039;s possible to store arbitrary data in a Type-1 IMF file after the song data (see [[#Tag Data]] below.)&lt;br /&gt;
&lt;br /&gt;
As a matter of luck, the first two data bytes in a Type-0 files are almost always 0x00 0x00, so this can be used to detect the file format version.  If the first two bytes match the length of the file it is likely Type-1, but be aware that trailing data will mean this is not always true.  Otherwise the only other way is to parse all the register/value pairs in the file and ensure the register is [[OPL chip#Register Map|within range]] (e.g. registers 0xA0 to 0xA9 are valid, but 0xAA to 0xAF should never be used.)  Note that 0x00 is actually an invalid register, but must be treated as valid since the files usually begin by writing 0x00 to register 0x00.&lt;br /&gt;
&lt;br /&gt;
Another way to detect the type of an IMF file is to examine the first few instructions in the IMF file. The idea is that the first few IMF commands set up the AdLib registers and therefore should have no delay. Even if there is a delay, it would normally be relatively low compared to the combined 16-bit value of the (register, value) pair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
UINT16 ReadInt16LE(FILE* in)&lt;br /&gt;
{&lt;br /&gt;
	UINT8 buf[2];&lt;br /&gt;
	fread(buf, 1, 2, in);&lt;br /&gt;
	return (buf[0] | (buf[1] &amp;lt;&amp;lt; 8));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int IMF_IsChunk(FILE* in)&lt;br /&gt;
{&lt;br /&gt;
	UINT16 chunksize, buff, i=42;&lt;br /&gt;
	UINT32 sum1=0, sum2=0;&lt;br /&gt;
&lt;br /&gt;
	if(!in)&lt;br /&gt;
		return 0;&lt;br /&gt;
&lt;br /&gt;
	if (!feof(in))&lt;br /&gt;
	{&lt;br /&gt;
		chunksize = ReadInt16LE(in);&lt;br /&gt;
		if ((chunksize == 0) || (chunksize &amp;amp; 3))&lt;br /&gt;
			return 0;&lt;br /&gt;
&lt;br /&gt;
		while(!feof(in) &amp;amp;&amp;amp; i)&lt;br /&gt;
		{&lt;br /&gt;
			buff = ReadInt16LE(in);&lt;br /&gt;
			sum1 += buff;&lt;br /&gt;
			buff = ReadInt16LE(in);&lt;br /&gt;
			sum2 += buff;&lt;br /&gt;
			i--;&lt;br /&gt;
		}&lt;br /&gt;
		fseek(in, 0, SEEK_SET);&lt;br /&gt;
		return (sum1 &amp;gt; sum2);&lt;br /&gt;
	}&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code given above, if the file is a chunk (Type-1), then &amp;lt;tt&amp;gt;sum1&amp;lt;/tt&amp;gt; contains the sum of all (register, value) pairs and &amp;lt;tt&amp;gt;sum2&amp;lt;/tt&amp;gt; contains the sum of all delays. If it&#039;s a plain IMF file (Type-0), the sums are swapped.&lt;br /&gt;
&lt;br /&gt;
The only case in which this detection would fail is IMF data that writes a bunch of zeroes to register zero (which would be pointless since that register is undefined) and/or has very large delays (which would be pointless because it would lead to delays of up to a minute before the next IMF command would be processed, resulting in multiple minutes of silence before the song actually starts playing notes).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT16LE]]||iLength||Song data length in bytes (Type-1 format only)&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][iLength]||cAdlibData||Song data (see below) - &amp;lt;code&amp;gt;iLength&amp;lt;/code&amp;gt; bytes long if Type-1, or until EOF if Type-0&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][]||cExtraData||Arbitrary data/tags (Type-1 format only, see [[#Tag Data]] below)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The earliest version of the IMF data in the [[AudioT Format]] actually starts with a [[UINT32LE]] length value. The Commander Keen 4 Demo uses that early version. Just extracting the IMF chunk from the &amp;lt;tt&amp;gt;AUDIOT.CK4&amp;lt;/tt&amp;gt; file will most likely confuse programs, since the file does not start with two 0&#039;s. Programs that only check the first two bytes will assume that the file is a ripped chunk, but will swap the delays and register/data pairs because of the length value being stored in the first four bytes instead of just the first two. That means the song will not play the intended notes. Programs that use the detection code given above will identify the file as plain IMF data and treat the length value as an IMF command. That means the song will play correctly at first, but any trailing data present in the file will also be interpreted as IMF data, most likely leading to long delays at the end of the song.&lt;br /&gt;
&lt;br /&gt;
Note that for Type-1 files, the initial two bytes (the &amp;quot;song data length&amp;quot;) are likely to be the filesize minus two, as the two initial bytes aren&#039;t counted.  The obvious exception to this is if there is trailing data at the end of the OPL data, such as an info tag.&lt;br /&gt;
&lt;br /&gt;
The song data is composed of four-byte &amp;quot;units&amp;quot;:&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]]||Adlib register&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]]||Adlib data&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT16LE]]||Delay&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data byte is sent to the specified register on the Adlib card, followed by a delay for the specified number of cycles.  For a 560Hz IMF file, there are 560 cycles in one second (see [[#Timing]] below), so a delay of 560 would result in one second of silence (and likewise in a 700Hz IMF the delay value would need to be 700 to produce one second of silence.)  A delay of 1 would wait for a single cycle, and a delay of zero means the next register/data pair should be sent immediately (so in a single &#039;cycle&#039;, data would be sent continuously until the next non-zero delay value is reached.)&lt;br /&gt;
&lt;br /&gt;
=== Timing ===&lt;br /&gt;
&lt;br /&gt;
IMF files exist at three known speeds.  Unfortunately this is determined by the game, not the IMF file, so tempo cannot be determined from the music files alone. Extracted IMFs can be compared to discern their speeds.  The known speeds are:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Speed!!Game&lt;br /&gt;
|-&lt;br /&gt;
|280Hz||[[Duke Nukem II]]&lt;br /&gt;
|-&lt;br /&gt;
|560Hz||[[Bio Menace]], [[Commander Keen]], [[Cosmo&#039;s Cosmic Adventures]], [[Monster Bash]], [[Major Stryker]]&lt;br /&gt;
|-&lt;br /&gt;
|700Hz||[[Blake Stone]], [[Operation Body Count]], [[Wolfenstein 3-D]], [[Corridor 7]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The easiest method to tell the files apart is to treat all files with a .WLF extension as 700Hz and all .IMF files as 560Hz.  Since Duke II is the odd one out, it is usually ignored since doubling the value of all the delay bytes conveniently turns it into a 560Hz .IMF.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
As IMF files contain Adlib music for games that may also have Adlib sound effects, care must be taken to ensure that IMF music and any sound effects can share the OPL chip without conflict.  This is done by reserving the OPL&#039;s first channel for sound effects, leaving eight remaining channels available for use in IMF files.  This has been confirmed by automated inspection of the IMF files from the following games, all of which have no data on OPL channel #0 beyond 2-3 initialisation commands: [[Bio Menace]], [[Blake Stone]], [[Commander Keen 4-6]], [[Cosmo&#039;s Cosmic Adventures]], [[Duke Nukem II]], [[Major Stryker]], [[Monster Bash]], [[Operation Body Count]], [[Wolfenstein 3-D]].&lt;br /&gt;
&lt;br /&gt;
In situations where channel #0 is not reserved and is used by the IMF file, when it is placed back into the game it interferes with the sound effects causing distortion, transposition, and otherwise resulting in broken sound effects.  This can happen when an IMF file is created using a utility that does not take into account the fact that channel #0 must be left unused.  See the end of this page for a list of utilities that can create IMF files and whether they treat channel #0 correctly.&lt;br /&gt;
&lt;br /&gt;
It is worth noting that channel #0 is unused even in games such as Cosmo and Monster Bash, which do not use Adlib sound effects (Cosmo has PC speaker effects only and Monster Bash has PC speaker and digitised PCM audio.)  It is also worth mentioning that some IMF songs from [[Monster Bash]] make use of the OPL&#039;s rhythm-mode, which trades three note-producing channels for five percussion channels. The IMF songs from the Keen 4 Demo also use rhythm-mode.&lt;br /&gt;
&lt;br /&gt;
=== Tag Data ===&lt;br /&gt;
&lt;br /&gt;
In a Type-1 IMF file it&#039;s possible to store data after the end of a song (as per the length given in the first two bytes of the file.)  There are a few uses for this - some games store additional (unused) data there generated when the files were added to the game&#039;s group file, and others have repurposed this area to store information about the song itself (title, artist, etc.)&lt;br /&gt;
&lt;br /&gt;
The tag data was originally written to the AudioT files by Id Software&#039;s tool [[Muse]] and was probably only processed by that tool. The [[Wolfenstein 3-D]] source code reads the entire chunk from the [[AudioT Format|AudioT]] file (including any tag data), but it only ever uses the song length and the song data.&lt;br /&gt;
&lt;br /&gt;
==== Official data ====&lt;br /&gt;
For those files which were distributed with additional data in this area, it is not entirely clear what the purpose of this data is.  It was apparently added when the source IMF files were compiled into a group audio file by [[Muse]]. (They appear not to be part of the source IMF files as there are occurrences where a file consists solely of tag data.) The format appears to be the same in all games that use it (such as Bio Menace or Wolfenstein 3-D) but it is not supported by any IMF players.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT16LE]]||Unknown||&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][16]||strTitle||Song title&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][64]||strRemarks||Song comment/message, usually source file name.&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][6]||cProg||Data from the compiler?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Unofficial uses ====&lt;br /&gt;
It is also possible to store tags there, and this simple format is supported by most IMF players:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]]||cSignature||0x1A&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][256]||strTitle||Song title&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][256]||strComposer||Song composer&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][256]||strRemarks||Song comment/message&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][9]||cProg||Name of the first program that added these tags (eight bytes + terminating NULL, pad out with NULLs if necessary.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the char[256] strings are variable-length NULL-terminated strings.  Their maximum length is 256 bytes *including* the terminating NULL, meaning the string will only ever contain 255 characters or less, plus the terminating-NULL.  Of course the string will normally be much shorter, and an empty string will consist of a single 0x00 byte.&lt;br /&gt;
&lt;br /&gt;
This tag format is supported by AdPlug when playing IMFs.  The tag format can also be used with .raw files, but no players officially support it yet.&lt;br /&gt;
&lt;br /&gt;
Note that the tags should begin directly after the IMF data, so in other words reading in the first two bytes of the file (the &amp;quot;song length&amp;quot;) and then seeking forward that many bytes, should put the file pointer at the start of the tag block (so the next byte that will be read in should be 0x1A, if the tags are present.)&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://adplug.sourceforge.net AdPlug]&lt;br /&gt;
| Platform = All&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; [[RAW Format (Adlib)|.raw]]&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&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 = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.shikadi.net/utils/cmf2imf CMF2IMF]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = Yes; [[CMF Format|.cmf]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Doesn&#039;t leave channel 0 clear for SFX&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.shikadi.net/utils/dro2imf DRO2IMF]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = Yes; [[DRO Format|.dro]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Doesn&#039;t leave channel 0 clear for SFX&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[DRO2MIDI]]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; [[MID Format|.mid]]&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://winwolf3d.dugtrio17.com/download/IMFCreator IMFCreator]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = Yes; [[MID Format|.mid]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = MUS2IMF&lt;br /&gt;
| Platform = DOS?&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = Yes; [[MUS Format|.mus]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = OPL3 Bank Editor can import FM instruments from IMF files&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Raptor&amp;diff=7152</id>
		<title>Raptor</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Raptor&amp;diff=7152"/>
		<updated>2017-07-26T15:33:07Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Mark GENMIDI as known format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&lt;br /&gt;
{{Game Infobox&lt;br /&gt;
 | Levels = No&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = Edit&lt;br /&gt;
 | Text = Edit&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Some&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
* Raptor&#039;s creators have [http://mking.com/raptor_game.html ported it to other platforms] including iPhone and Windows&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.glb&lt;br /&gt;
 | Format = [[GLB Format (Raptor)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive file storing most of the game data files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.ini&lt;br /&gt;
 | Format = ASCII text&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Configuration file storing game settings&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *_agx&lt;br /&gt;
 | Format = ?&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Unknown&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = genmidi_op2&lt;br /&gt;
 | Format = [[OP2 Bank Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = [[OPL]] FM patches for MIDI instruments&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = lastscr?_txt&lt;br /&gt;
 | Format = [[B800 Text]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Text-mode exit screens&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *_dat&lt;br /&gt;
 | Format = [[VGA Palette]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 6-bit VGA palette&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *_fx&lt;br /&gt;
 | Format = 8-bit PCM, unknown header&lt;br /&gt;
 | KnownFormat = Partial&lt;br /&gt;
 | Desc = Sound effects&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *_itm&lt;br /&gt;
 | Format = ?&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Unknown&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *_map&lt;br /&gt;
 | Format = [[Raptor Level Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Game levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *_mus&lt;br /&gt;
 | Format = [[MUS Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Background music&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *_pic&lt;br /&gt;
 | Format = [[Raptor PIC Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Various images and full-screen graphics&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *_rec&lt;br /&gt;
 | Format = [[Raptor Demo Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Pre-recorded demo macros&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = startg?tiles .. endg?tiles&lt;br /&gt;
 | Format = [[Raptor Tileset Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Tiles used to draw game levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *_txt&lt;br /&gt;
 | Format = ASCII text&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Text for various game screens&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Overhead]]&lt;br /&gt;
[[Category:Space Invaders]]&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Doom&amp;diff=7151</id>
		<title>Doom</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Doom&amp;diff=7151"/>
		<updated>2017-07-26T15:31:54Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added GENMIDI file&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&lt;br /&gt;
&lt;br /&gt;
{{Game Infobox&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = Edit&lt;br /&gt;
 | Music = Edit&lt;br /&gt;
 | Text = Edit&lt;br /&gt;
 | Story = Edit&lt;br /&gt;
 | Interface = Edit&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Windows/Linux&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://eureka-editor.sourceforge.net/ Eureka]&lt;br /&gt;
| Platform = Windows/Mac/Linux&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://slade.mancubus.net SLADE]&lt;br /&gt;
| Platform = Windows/Mac&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&lt;br /&gt;
| sfx = Edit&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = DeHackEd&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = Edit&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = Edit&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== More detail ==&lt;br /&gt;
&lt;br /&gt;
There is extensive information already on the [http://doom.wikia.com/wiki/ Doom wiki]&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = N/A&lt;br /&gt;
 | Format = [[B800 Text]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Exit text screens&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = N/A&lt;br /&gt;
 | Format = [[MUS Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Background music&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = GENMIDI&lt;br /&gt;
 | Format = [[OP2 Bank Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = FM patches for MUS/MIDI music&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = N/A&lt;br /&gt;
 | Format = [[VOC Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Sound effects&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.wad&lt;br /&gt;
 | Format = [[WAD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing most of the game&#039;s data files&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=7148</id>
		<title>OP2 Bank Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=7148"/>
		<updated>2017-07-24T20:55:26Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Instrument names */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Type2 = MIDI&lt;br /&gt;
 | Count = 175&lt;br /&gt;
 | Names = Yes, 31 char&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Chex Quest}}&lt;br /&gt;
   {{Game|Chex Quest 2}}&lt;br /&gt;
   {{Game|Doom}}&lt;br /&gt;
   {{Game|Doom 2}}&lt;br /&gt;
   {{Game|Heretic}}&lt;br /&gt;
   {{Game|Hexen}}&lt;br /&gt;
   {{Game|Raptor}}&lt;br /&gt;
   {{Game|Strife}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;OP2 Bank Format&#039;&#039;&#039; is an instrument bank format used by the DMX sound library developed by Paul Radek of Digital Expressions, Inc. The 128 melodic and 47 percussion instrument limit was most likely chosen so that a single OP2 file could store all the instruments for a General MIDI song. This bank has support for two-voice instruments to provide support for pseudo four-operator instruments. File of this format usually has &amp;lt;tt&amp;gt;GENMIDI&amp;lt;/tt&amp;gt; name without extension as embedded WAD resource, but also can have &amp;lt;tt&amp;gt;.OP2&amp;lt;/tt&amp;gt; extension.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][8] || magic || &amp;lt;tt&amp;gt;#OPL_II#&amp;lt;/tt&amp;gt; signature, doesn&#039;t null terminated&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][175][36] || instrument || Set of 175 instrument entry&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][175][32] || names || Instrument names per every instrument entry, must be null terminated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument===&lt;br /&gt;
&lt;br /&gt;
Each bank contains 128 melodic and 47 percussion instruments.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || flags || N/A || Instrument flags: 0x01 - fixed pitch, 0x02 - Unknown flag, 0x04 - Double-voice mode&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || fineTune ||  N/A || Second voice detune level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || noteNum ||  N/A || Percussion note number (between 0 and 128)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|First voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar1     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack1   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain1  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel1  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale1    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel1    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback1    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar1     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack1   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain1  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel1  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale1    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel1    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved1     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset1 || N/A || MIDI note offset for a first voice&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|Second voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar2     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack2   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain2  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel2  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale2    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel2    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback2    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar2     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack2   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain2  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel2  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale2    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel2    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved2     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset2 || N/A || MIDI note offset for a second voice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument names===&lt;br /&gt;
After 175&#039;th instrument is folowing an array of 32-byte null-terminated instrument names&lt;br /&gt;
&lt;br /&gt;
=== Fine tune ===&lt;br /&gt;
Fine tune value is an index offset of frequencies table. 128 is a center, i.e. don&#039;t detune. Formula of index offset is: &amp;lt;tt&amp;gt;(fine_tune / 2) - 64&amp;lt;/tt&amp;gt;. Each unit of fine tune field is approximately equal to 1/0.015625 of tone. &lt;br /&gt;
&lt;br /&gt;
=== Percussion instruments ===&lt;br /&gt;
Percussion instruments are in range between 35 (Bass drum 1) and 81 (Open Triangle) MIDI indeces.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.vgmpf.com/Wiki/index.php/IMF_Creator IMF Creator]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; .op2&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = Yes; Unknown flag&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Utility by Adam Biser to create IMF music. Also includes OP2 bank editor.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=7147</id>
		<title>OP2 Bank Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=7147"/>
		<updated>2017-07-24T07:47:23Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Type2 = MIDI&lt;br /&gt;
 | Count = 175&lt;br /&gt;
 | Names = Yes, 31 char&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Chex Quest}}&lt;br /&gt;
   {{Game|Chex Quest 2}}&lt;br /&gt;
   {{Game|Doom}}&lt;br /&gt;
   {{Game|Doom 2}}&lt;br /&gt;
   {{Game|Heretic}}&lt;br /&gt;
   {{Game|Hexen}}&lt;br /&gt;
   {{Game|Raptor}}&lt;br /&gt;
   {{Game|Strife}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;OP2 Bank Format&#039;&#039;&#039; is an instrument bank format used by the DMX sound library developed by Paul Radek of Digital Expressions, Inc. The 128 melodic and 47 percussion instrument limit was most likely chosen so that a single OP2 file could store all the instruments for a General MIDI song. This bank has support for two-voice instruments to provide support for pseudo four-operator instruments. File of this format usually has &amp;lt;tt&amp;gt;GENMIDI&amp;lt;/tt&amp;gt; name without extension as embedded WAD resource, but also can have &amp;lt;tt&amp;gt;.OP2&amp;lt;/tt&amp;gt; extension.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][8] || magic || &amp;lt;tt&amp;gt;#OPL_II#&amp;lt;/tt&amp;gt; signature, doesn&#039;t null terminated&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][175][36] || instrument || Set of 175 instrument entry&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][175][32] || names || Instrument names per every instrument entry, must be null terminated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument===&lt;br /&gt;
&lt;br /&gt;
Each bank contains 128 melodic and 47 percussion instruments.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || flags || N/A || Instrument flags: 0x01 - fixed pitch, 0x02 - Unknown flag, 0x04 - Double-voice mode&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || fineTune ||  N/A || Second voice detune level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || noteNum ||  N/A || Percussion note number (between 0 and 128)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|First voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar1     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack1   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain1  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel1  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale1    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel1    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback1    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar1     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack1   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain1  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel1  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale1    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel1    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved1     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset1 || N/A || MIDI note offset for a first voice&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|Second voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar2     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack2   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain2  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel2  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale2    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel2    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback2    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar2     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack2   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain2  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel2  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale2    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel2    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved2     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset2 || N/A || MIDI note offset for a second voice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument names===&lt;br /&gt;
&lt;br /&gt;
=== Fine tune ===&lt;br /&gt;
Fine tune value is an index offset of frequencies table. 128 is a center, i.e. don&#039;t detune. Formula of index offset is: &amp;lt;tt&amp;gt;(fine_tune / 2) - 64&amp;lt;/tt&amp;gt;. Each unit of fine tune field is approximately equal to 1/0.015625 of tone. &lt;br /&gt;
&lt;br /&gt;
=== Percussion instruments ===&lt;br /&gt;
Percussion instruments are in range between 35 (Bass drum 1) and 81 (Open Triangle) MIDI indeces.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.vgmpf.com/Wiki/index.php/IMF_Creator IMF Creator]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; .op2&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = Yes; Unknown flag&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Utility by Adam Biser to create IMF music. Also includes OP2 bank editor.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7146</id>
		<title>Apogee Sound System Timbre Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7146"/>
		<updated>2017-07-24T07:44:18Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Type2 = MIDI&lt;br /&gt;
 | Count = 256&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Duke Nukem 3D}}&lt;br /&gt;
   {{Game|Blood}}&lt;br /&gt;
   {{Game|Shadow Warrior}}&lt;br /&gt;
   {{Game|NAM}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Apogee Sound System Timbre Format&#039;&#039;&#039; is an instrument bank format used by the Apogee Sound System library developed by 3D Realms. The 128 melodic and 128 percussion instrument limit was most likely chosen so that a single TMB file could store all the instruments for a General MIDI song. Files of this format are has &amp;lt;tt&amp;gt;.tmb&amp;lt;/tt&amp;gt; extension.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
TMB files have no header and signature. The file contains 256 13-byte instrument entries (first 128 are melodic, and next 128 are percussion).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || SAVEK[0] ||  0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || SAVEK[1] ||  0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[0] ||  0x40 || Modulator key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[1] ||  0x43 || Carrier key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[0]  ||  0x60 || Modulator attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[1]  ||  0x63 || Carrier attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[0]  ||  0x80 || Modulator sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[1]  ||  0x83 || Carrier sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[0]  ||  0xE0 || Modulator wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[1]  ||  0xE3 || Carrier wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Feedback ||  0xC0 || Feedback/connection&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Transpose ||  N/A  || Note offset for melodic instruments, and key number for percussion&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Velocity  ||  N/A  || Velocity offset&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The TMB format is directly based on [[IBK Format]], and has first 12 bytes be same as in the IBK Format. Official &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt; utility (Can be found with the source code of 3D Realms games in the Audio Library public folder) generates TMB files from the set of IBK files.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; .tmb&lt;br /&gt;
| canImport = Yes; [[IBK Format|.ibk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;Apogee Sound System&#039;&#039; SDK&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=AdLib_Timbre_Bank_Format&amp;diff=7145</id>
		<title>AdLib Timbre Bank Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=AdLib_Timbre_Bank_Format&amp;diff=7145"/>
		<updated>2017-07-23T22:36:27Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added OPL3 Bank Editor into tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Count = 65535&lt;br /&gt;
 | Names = Yes, 8 chars&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Vinyl Goddess From Mars}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;AdLib Timbre Bank Format&#039;&#039;&#039; is used to store the FM instruments used when playing songs in [[AdLib MIDI Format]].  The official documentation uses both the &amp;lt;tt&amp;gt;.snd&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;.tim&amp;lt;/tt&amp;gt; extensions for files in this format.&lt;br /&gt;
&lt;br /&gt;
This format is an early (1988) method of combining individual instrument files into one &amp;quot;bank&amp;quot; file.  As this format was only designed to include the instruments needed to play a single song, in 1989 AdLib created the [[BNK Format (Ad Lib)|BNK Format]], giving it the &amp;lt;tt&amp;gt;.bnk&amp;lt;/tt&amp;gt; extension.  The differences are minor - compared to the Timbre format, the later Bank format includes a signature in the header, indicators for percussive vs melodic patches, and halves the capacity used for storing instruments by placing them in bytes instead of 16-bit integers.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file begins with a header:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || majorVersion || Always 1&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || minorVersion || Always 0&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || nrTimbre || Number of instruments in the file&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || offsetDef || Offset where instrument data begins&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is followed by a list of instrument names, repeated &amp;lt;tt&amp;gt;nrTimbre&amp;lt;/tt&amp;gt; times:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| char[9] || timbreName || Instrument name - must be null terminated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At this point, the current position should be the same as &amp;lt;tt&amp;gt;offsetDef&amp;lt;/tt&amp;gt;.  The actual instrument data follows, again repeated once for each instrument.  The instrument data is in the following format, which is almost identical to the [[AdLib Instrument Format]].&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
| OPLREGS || oplModulator || Register values for the Modulator (0) operator&lt;br /&gt;
|-&lt;br /&gt;
| OPLREGS || oplCarrier || Register values for the Carrier (1) operator&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iModWaveSel || Modulator wave select (only bits 0-1 recognised, OPL register 0xE0)&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iCarWaveSel || Carrier wave select (only bits 0-1 recognised, OPL register 0xE0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;OPLREGS&#039;&#039; structure is defined as:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description !! OPL base register !! Value range&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iKSL || Key scaling level || 0x40 (bits 6-7) ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iMultiple || Frequency multiplier || 0x20 (bits 0-3) || iMultiple &amp;amp; 0x0F is sent to OPL register [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iFeedback || Feedback || 0xC0 (bits 1-3) || Although only bits 1-3 are valid, Vinyl doesn&#039;t limit the output to three bits wide.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iAttack || Attack rate || 0x60 (upper four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iSustain || Sustain level || 0x80 (upper four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iEG || Envelope gain (nonzero value is on) || 0x20 (bit 5) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iDecay || Decay rate || 0x60 (lower four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iReleaseRate || Release rate || 0x80 (lower four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iTotalLevel || Total output level || 0x40 (bit 0-5) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iAM || Amplitude modulation (Tremolo) || 0x20 (bit 7) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iVIB || Frequency Vibrato || 0x20 (bit 6) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iKSR || Key scaling/envelope rate || 0x20 (bit 4) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iCONoff || Connector [OP0 only] || 0xC0 (bit 0, inverted) || 0: OPL bit set to 1&amp;lt;br&amp;gt;other: OPL bit set to 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Percussive instruments ===&lt;br /&gt;
&lt;br /&gt;
There is no distinction between percussive and melodic instruments.  This is controlled at playback time, depending on which channel the instrument is loaded into.  This rules for this are described in [[AdLib MIDI Format]].&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = AdLib &amp;lt;tt&amp;gt;play.exe&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Only with an associated .mus file.  Part of AdLib Programmer&#039;s Guide.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = AdLib &amp;lt;tt&amp;gt;convert.exe&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = Yes; [[AdLib Instrument Format|.ins]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Loads .ins specified in .rol when producing .mus + .tim.  Part of AdLib Programmer&#039;s Guide.&lt;br /&gt;
}}&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 = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Only with an associated .mus file&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was originally reverse engineered by [[User:Malvineous|Malvineous]] as the [[Vinyl Goddess From Mars]] instrument format, until [[User:binarymaster|binarymaster]] discovered it was the same as an early AdLib music format, and supplied the documentation on which this article is now based.  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>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=SBI_Format&amp;diff=7144</id>
		<title>SBI Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=SBI_Format&amp;diff=7144"/>
		<updated>2017-07-23T21:05:35Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Tools */ Improve table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = Instrument-only&lt;br /&gt;
 | Instruments = OPL&lt;br /&gt;
 | NumChannels = 1&lt;br /&gt;
 | NumTracks = 0&lt;br /&gt;
 | Tags = Title&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;SBI (Sound Blaster Instrument) Format&#039;&#039;&#039; stores a single instrument suitable for playback on a sound card with an OPL2 or OPL3 chip.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is structured as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][4] || signature || &amp;quot;SBI&amp;quot; followed by 0x1A&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][32] || name || Instrument title (must be NULL-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][16] || inst || Instrument settings (see below)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Instrument settings ===&lt;br /&gt;
&lt;br /&gt;
The instrument is in the following format.  This is identical to the format used for each instrument in [[CMF Format]] songs and [[IBK Format]] instrument banks.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!OPL base register!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModChar||0x20||Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarChar||0x23||Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModScale||0x40||Modulator key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarScale||0x43||Carrier key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModAttack||0x60||Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarAttack||0x63||Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModSustain||0x80||Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarSustain||0x83||Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModWaveSel||0xE0||Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarWaveSel||0xE3||Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iFeedback||0xC0||Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][5]&lt;br /&gt;
|colspan=3|Padding to bring instrument definition up to 16 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Percussive instruments ====&lt;br /&gt;
&lt;br /&gt;
There is no indication as to whether a given instrument should be played in melodic or percussive mode.  Playing an instrument destined for one mode in the other usually sounds quite bad.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[SBTimbre]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; [[SBI Format|.sbi]]&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Can import or export instruments in SBI format&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[SBANK]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&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 = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Сan convert SBI between [[AdLib Instrument Format|AdLib INS]] format&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&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 = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Can import or export instruments in SBI format&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=CMF_Format&amp;diff=7143</id>
		<title>CMF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=CMF_Format&amp;diff=7143"/>
		<updated>2017-07-23T20:59:13Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Tools */ Using new table style&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = MIDI&lt;br /&gt;
 | Instruments = OPL&lt;br /&gt;
 | NumChannels = 16&lt;br /&gt;
 | NumTracks = 1&lt;br /&gt;
 | NumPatterns = 1&lt;br /&gt;
 | NumOrders = 0&lt;br /&gt;
 | Tags = Title, Artist, Remarks&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Jill of the Jungle}}&lt;br /&gt;
   {{Game|Kiloblaster}}&lt;br /&gt;
   {{Game|Scud Atak}}&lt;br /&gt;
   {{Game|Solar Winds}}&lt;br /&gt;
   {{Game|Traffic Department 2192}}&lt;br /&gt;
   {{Game|Math Rescue}}&lt;br /&gt;
   {{Game|Word Rescue}}&lt;br /&gt;
   {{Game|Xargon}}&lt;br /&gt;
}}&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;u&amp;gt;C&amp;lt;/u&amp;gt;reative &amp;lt;u&amp;gt;M&amp;lt;/u&amp;gt;usic &amp;lt;u&amp;gt;F&amp;lt;/u&amp;gt;ormat (CMF)&amp;lt;/b&amp;gt; was created by Creative Labs for use with their SoundBlaster series of sound cards.  It is a cut-down version of the [[MID Format|MIDI format]] (only one track) but unlike MIDI it allows custom instruments to be stored in the file itself (and unlike the Module formats that preceeded it, the instruments were not sampled but were synthesised using the Adlib/SoundBlaster OPL chips.)&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file begins with a header:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|BYTE[4]||cSignature||&amp;quot;CTMF&amp;quot; (not NULL-terminated)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iVersionMinor||Minor version number (normally 0x01)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iVersionMajor||Major version number (normally 0x01)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iOffsetInstruments||Offset of the instrument block, from the start of the file&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iOffsetMusic||Offset of the music block, from the start of the file&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iTicksPerQuarter||Clock ticks per quarter note (one beat)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iTicksPerSecond||Clock ticks per second&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iOffsetTitle||Offset of the song title string, zero if no title&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iOffsetComposer||Offset of the composer&#039;s name, zero if not listed&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iOffsetRemarks||Offset of the &amp;quot;remarks&amp;quot; string, zero if no remarks&lt;br /&gt;
|-&lt;br /&gt;
|UINT8[16]||iChannelInUse||Channel in use table (0x00 == channel not used, 0x01 == channel used in song)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The rest of the header depends on the version:&lt;br /&gt;
&lt;br /&gt;
==== Version 1.0 ====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iInstrumentCount||Number of instruments used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Version 1.1 ====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iInstrumentCount||Number of instruments used&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iTempo||Basic tempo (BPM?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The song title, composer and remarks (if present) should follow this header and the instrument block should follow that (although there is no requirement for them to be located here, as long as the offsets in the header point to the correct location.)  These three strings are NULL-terminated ASCII.&lt;br /&gt;
&lt;br /&gt;
It is worth noting that the header stores both a tempo value and a &amp;quot;ticks per quarter note&amp;quot; value, however the only field that seems to be used for timing during playback is the &amp;quot;ticks per second&amp;quot; field.  The tempo field doesn&#039;t even exist in version 1.0 files.  It is assumed &amp;quot;basic tempo&amp;quot; means BPM (beats per minute) as this is the meaning of the &amp;quot;basic tempo&amp;quot; field in the earlier [[AdLib MIDI Format]].&lt;br /&gt;
&lt;br /&gt;
It is also worth noting that between v1.0 and v1.1, the number of possible instruments expanded from a maximum of 256 (UINT8) to 65536 (UINT16.)  However the MIDI data itself is only capable of addressing up to 128 instruments, so any extras cannot be used.  Perhaps there was originally an intention to make these available through instrument banks like MIDI does.&lt;br /&gt;
&lt;br /&gt;
Be aware that the title/composer/remarks fields are supposed to be zero if there is no metadata, but [[Highway Hunter]] sets them to invalid values (past EOF), so you may wish to check that these fields are within range and ignore them otherwise.&lt;br /&gt;
&lt;br /&gt;
=== Instrument block ===&lt;br /&gt;
&lt;br /&gt;
The instrument block contains all the instruments used in the song.  The first instrument is referred to in the song data as instrument zero (MIDI patch #0.)  The following table lists the fields used to define one instrument - it is repeated &#039;&#039;iInstrumentCount&#039;&#039; times.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!OPL base register!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iModChar||0x20||Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCarChar||0x23||Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iModScale||0x40||Modulator key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCarScale||0x43||Carrier key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iModAttack||0x60||Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCarAttack||0x63||Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iModSustain||0x80||Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCarSustain||0x83||Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iModWaveSel||0xE0||Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCarWaveSel||0xE3||Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iFeedback||0xC0||Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
|BYTE[5]&lt;br /&gt;
|colspan=3|Padding to bring instrument definition up to 16 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There are 16 default instruments, repeated into the 128 available MIDI instruments (so instrument 0, 16, 32, etc. all refer to this first default instrument.  See [[#Default instruments]] below)  The instrument block then overrides these defaults.  [[Word Rescue]] is notable for having CMFs that rely on these default instruments being present and correct.&lt;br /&gt;
&lt;br /&gt;
==== Percussive instruments ====&lt;br /&gt;
Since each CMF instrument contains both OPL modulator and OPL carrier settings, when an instrument is selected in a CMF file, both the modulator and carrier settings are loaded into the OPL chip for that channel.&lt;br /&gt;
&lt;br /&gt;
When the CMF is in percussive mode however (see [[#Controller 0x67: Rhythm mode]] below), most of the percussive instruments only occupy either a modulator or a carrier (i.e. half an instrument.)  This means that loading these instruments must be treated slightly differently, as a whole instrument is supplied but only half of it will be loaded into the OPL chip, and not necessarily the expected half.&lt;br /&gt;
&lt;br /&gt;
When percussive mode is active and an instrument change event (MIDI event 0xC0) is received on a percussive channel (12-16 inclusive), the instruments should be loaded as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!CMF channel!!Instrument!!Instrument source!!OPL cell&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;12&amp;lt;/center&amp;gt;||Bass drum||Modulator&amp;lt;br&amp;gt;Carrier||13 - Channel 7 Modulator&amp;lt;br&amp;gt;16 - Channel 7 Carrier&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;13&amp;lt;/center&amp;gt;||Snare drum||Modulator||17 - Channel 8 Carrier&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;14&amp;lt;/center&amp;gt;||Tom tom||Modulator||15 - Channel 9 Modulator&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;15&amp;lt;/center&amp;gt;||Top cymbal||Modulator||18 - Channel 9 Carrier&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;16&amp;lt;/center&amp;gt;||Hi-hat||Modulator||14 - Channel 8 Modulator&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Despite some documentation suggesting that certain instruments cannot have their pitch set, the Creative Labs SBFMDRV will play all percussive instruments at the requested pitch.  Note however that as only one pitch can be set per channel, playing both a snare and hi-hat, or both a tom tom and top cymbal, at the same time, will cause a conflict, potentially changing the pitch of an already-playing note.  The Creative Labs SBFMDRV simply writes the pitch as each note is played, changing the pitch of any currently playing note on the shared channel.&lt;br /&gt;
&lt;br /&gt;
Be aware that some songs (e.g. [[Kiloblaster]]&#039;s &amp;lt;tt&amp;gt;song_2&amp;lt;/tt&amp;gt;) play two different percussive instruments simultaneously, when those two instruments share the same OPL channel (e.g. hi-hat and snare drum.)  The notes are actually played at different pitches, which introduces a conflict, as only one note frequency is available for the channel and it must be shared by both instruments.  In this case the order of events is important, as the pitch of the last event at that instant is the one that gets set for the channel.  Normally with MIDI, if notes are played at the same instant in time it does not matter which order they are issued in, however in this case the song is quite different if the order is not maintained.&lt;br /&gt;
&lt;br /&gt;
Essentially SBFMDRV writes the pitch to the OPL channel as the events are encountered, so whichever note is played last is the frequency the channel will be set to.&lt;br /&gt;
&lt;br /&gt;
=== Song data ===&lt;br /&gt;
&lt;br /&gt;
The song data itself is in standard MIDI format - identical to the &#039;&#039;data&#039;&#039; stored in a MIDI MTrk block (but without the &amp;quot;MTrk&amp;quot; header of course.)  For details on this, see the [[MID Format#MIDI data|MIDI data description]].&lt;br /&gt;
&lt;br /&gt;
One difference worth noting is that the official Creative Labs CMF player does not support pitch bends (code 0xE0) and those events are simply ignored.  Simple sysex data appears to be ignored also, however its use in a CMF file can cause problems with other players.&lt;br /&gt;
&lt;br /&gt;
==== MIDI controllers ====&lt;br /&gt;
&lt;br /&gt;
In addition to the standard MIDI controllers (which are actually rarely used in CMF files), the following controllers have special meaning in a CMF file.  Each controller has one data byte (the &amp;quot;controller value&amp;quot;, 0-127), and the meaning of this byte will of course depend on which controller was selected.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Controller!!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x63||Non-standard extension: AM+VIB depth control (see below)&lt;br /&gt;
|-&lt;br /&gt;
|0x66||Set marker byte (used as a status flag readable by a music player)&lt;br /&gt;
|-&lt;br /&gt;
|0x67||Switch OPL between melody and rhythm mode (see below)&lt;br /&gt;
|-&lt;br /&gt;
|0x68||Transpose up by given number of 1/128 semitones&lt;br /&gt;
|-&lt;br /&gt;
|0x69||Transpose down by given number of 1/128 semitones&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Controller 0x63: Depth control =====&lt;br /&gt;
MIDI controller 0x63 is a nonstandard extension to allow the OPL&#039;s AM+VIB depth control to be adjusted (normal CMF playback has both the AM and VIB depth control fixed in the on state.)  When this controller is set to zero, the depth control is switched off (i.e. amplitude depth is 1 dB, vibrato depth is 7 cents.)  Setting the controller to a value of one increases the vibrato to a depth of 14 cents (OPL port 0xBD has bit 6 set), and setting the control to a value of two increases the amplitude depth to 4.8 dB (OPL port 0xBD has bit 7 set).  Setting the control to a value of three increases both depth controllers, which is the CMF default setting (OPL port 0xBD has bits 6 and 7 set.)&lt;br /&gt;
&lt;br /&gt;
Since this setting is global and affects the entire OPL chip, it does not matter which channel the controller change is issued on.&lt;br /&gt;
&lt;br /&gt;
===== Controller 0x66: Song markers =====&lt;br /&gt;
Controller 0x66 is used to set a marker byte in the song.  This can be used to notify the music player that a certain point in a song has been reached, or to trigger some kind of action in time with the music.&lt;br /&gt;
&lt;br /&gt;
===== Controller 0x67: Rhythm mode =====&lt;br /&gt;
MIDI controller 0x67 is used to switch between &amp;quot;melody mode&amp;quot; and OPL &amp;quot;rhythm mode.&amp;quot;  In melody mode, nine-channel FM music is possible.  In rhythm-mode, six-channel FM music is possible, with an additional five channels used for percussion (allowing 11 sounds to be played simultaneously.)  In this mode, the last five MIDI channels are reserved for the percussive instruments as shown below.&lt;br /&gt;
&lt;br /&gt;
Since this setting is global and affects the entire OPL chip, it does not matter which channel the controller change is issued on.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Hex channel!!MIDI channel!!Use in melody mode!!Use in rhythm mode&lt;br /&gt;
|-&lt;br /&gt;
|0x00||1||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x01||2||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x02||3||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x03||4||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x04||5||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x05||6||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x06||7||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x07||8||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x08||9||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x09||10||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x0A||11||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x0B||12||Normal instrument||Bass drum&lt;br /&gt;
|-&lt;br /&gt;
|0x0C||13||Normal instrument||Snare drum&lt;br /&gt;
|-&lt;br /&gt;
|0x0D||14||Normal instrument||Tom-tom&lt;br /&gt;
|-&lt;br /&gt;
|0x0E||15||Normal instrument||Top cymbal&lt;br /&gt;
|-&lt;br /&gt;
|0x0F||16||Normal instrument||Hi-hat cymbal&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [[#CMF/MIDI vs Adlib channels]] below for more details.&lt;br /&gt;
&lt;br /&gt;
===== Controller 0x68: Transpose up =====&lt;br /&gt;
This controller transposes all following notes on the channel up by the given number of 1/128 semitones.  Since the controller value must be between 0 and 127, it will allow a song to be transposed up anywhere between zero and almost a full semitone.  The value is absolute, so a controller requesting a transpose up by 127 followed by a transpose up by 64, will initially be transposed up by almost a full semitone (127) but will then be transposed back by a half semitone (to 64).&lt;br /&gt;
&lt;br /&gt;
A value of zero resets back to &amp;quot;not transposed.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===== Controller 0x69: Transpose down =====&lt;br /&gt;
Identical to controller 0x68 (Transpose up) only of course in the opposite direction, and again only affecting the channel the controller is issued on.&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
==== Keyon/off handling ====&lt;br /&gt;
Some songs don&#039;t always send keyoffs after a keyon, or they send them out of order (e.g. note 1 on, delay, note 2 on, note 1 off, delay, note 2 off.)  If you don&#039;t check this you&#039;ll end up switching a note off too early (in the above example the &amp;quot;note 1 off&amp;quot; should *not* switch off &amp;quot;note 2&amp;quot; that was switched on just before it.)  &amp;lt;tt&amp;gt;song_9.xr1&amp;lt;/tt&amp;gt; from the first episode of Xargon is an excellent example of this, right at the start of the song.&lt;br /&gt;
&lt;br /&gt;
The best way of handling this when playing through an OPL chip seems to be to remember the last note played on a channel, and upon receiving a keyoff, only process it if the keyoff is for the note currently playing on the channel (otherwise it can be discarded.)  If a keyon is received and a note is already being played on a channel, the old note should be switched off just before playing the new note.&lt;br /&gt;
&lt;br /&gt;
==== Keyon/off timing ====&lt;br /&gt;
Some songs play a note-on, then immediately (with no delay) have a corresponding note-off.  If this is played faithfully, then the note will not be heard, however the Creative Labs player still plays these notes.  The correct solution is {{TODO|currently unknown - wait for one tick or use the emulator callback between events?}}.  A good example of this is the first few notes in &amp;lt;tt&amp;gt;song_32.xr1&amp;lt;/tt&amp;gt;.  ([https://github.com/adplug/adplug/issues/41 Discussion])&lt;br /&gt;
&lt;br /&gt;
==== Default instruments ====&lt;br /&gt;
Although no documentation exists about this, it seems that the Creative Labs player sets the 128 available instruments based on 16 defaults looped/repeated to fill the 128 slots.  They do not appear to be based on any MIDI instrument specification.  Any instruments included in the CMF file then override these defaults.  Some songs (e.g. the [[Word Rescue]] background music) rely on these default instruments and don&#039;t play properly if only their custom instruments are set.&lt;br /&gt;
&lt;br /&gt;
There appear to be a different set of default instruments used for the percussion channels when rhythm mode is active.  More investigation needs to be done to determine what these are and if they are related to the 16 default melody instruments.&lt;br /&gt;
&lt;br /&gt;
{{TODO|Post a set of OPL settings here (perhaps in [[IBK Format]]) that provides these default parameters.}}&lt;br /&gt;
&lt;br /&gt;
{{TODO|Confirm whether it&#039;s possible to set more than 16 custom instruments, without them looping and overwriting the earlier ones.}}&lt;br /&gt;
&lt;br /&gt;
==== CMF/MIDI vs Adlib channels ====&lt;br /&gt;
MIDI (and consequently CMF) supports up to 16 channels.  The OPL2 synth on the Adlib only supports a maximum of nine channels in normal mode, or six channels plus five percussion instruments in rhythm mode.&lt;br /&gt;
&lt;br /&gt;
This means that any CMF player must correctly map up to 16 MIDI channels to only nine OPL channels.  Many songs from games work correctly with a 1:1 mapping (i.e. the game music doesn&#039;t go beyond MIDI channel 9), however there are some songs that use channels beyond this (e.g. [[Word Rescue]] again, which, given the Voyetra credit, has probably been minimally converted from MIDI.)&lt;br /&gt;
&lt;br /&gt;
At the time of writing, there are no known songs that use more than nine MIDI channels simultaneously, however [[Word Rescue]]&#039;s E1L1 song appears to sound more than nine notes simultaneously across a smaller number of channels, so if all these notes should be heard, the extended OPL3 channels probably need to be used.  [[Xargon]] &amp;lt;tt&amp;gt;song9&amp;lt;/tt&amp;gt; also sounds multiple notes simultaneously in a single channel.  Either of these will result in lost notes unless the available channels are cleverly managed.&lt;br /&gt;
&lt;br /&gt;
As an aside, it would be interesting to test this with Creative&#039;s driver to see how it behaves.&lt;br /&gt;
&lt;br /&gt;
==== Note velocity ====&lt;br /&gt;
The velocity values are loaded more or less directly into the OPL chip.  This means unlike MIDI, the velocity is not a linear scale from 0 to 127, but logarithmic.  A value of 1 is almost silent, and rapidly increase in volume so that values 2 and 3 are much louder.  At the other end of the scale, 127 is full volume, but 126 and 125 are barely any quieter.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.hitsquad.com/smm/programs/cmf2mid/ CMF2MID]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; .mid&lt;br /&gt;
| canImport = Yes; [[CMF Format|.cmf]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Convert CMF files into MIDI&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://adplug.sourceforge.net AdPlug/AdPlay]&lt;br /&gt;
| Platform = DOS, Linux, Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Plugins for various audio players (plus a command line player) that mostly supports CMF files&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.shikadi.net/utils/xmms.html Malvineous&#039; Adlib plugin]&lt;br /&gt;
| Platform = Linux&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Plugin for XMMS and Audacious that plays most CMF files more accurately than AdPlug&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Import instruments from CMF files to use them in banks&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Similar formats ==&lt;br /&gt;
* The CMF song data is stored in the same format as used by [[MID Format|MIDI files]]&lt;br /&gt;
* The [[SBI Format]] (SoundBlaster Instrument) is the same as used in the CMF instrument block, with a header on the front.&lt;br /&gt;
* The [[IBK Format]] (Instrument Bank) is a group of SBI instruments, similar to the whole CMF instrument block.&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=7142</id>
		<title>OP2 Bank Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=7142"/>
		<updated>2017-07-23T19:37:22Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: small fix of categories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Type2 = MIDI&lt;br /&gt;
 | Count = 175&lt;br /&gt;
 | Names = Yes, 31 char&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Chex Quest}}&lt;br /&gt;
   {{Game|Chex Quest 2}}&lt;br /&gt;
   {{Game|Doom}}&lt;br /&gt;
   {{Game|Doom 2}}&lt;br /&gt;
   {{Game|Heretic}}&lt;br /&gt;
   {{Game|Hexen}}&lt;br /&gt;
   {{Game|Raptor}}&lt;br /&gt;
   {{Game|Strife}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;OP2 Bank Format&#039;&#039;&#039; is an instrument bank format used by the DMX sound library developed by Paul Radek of Digital Expressions, Inc. The 128 melodic and 47 percussion instrument limit was most likely chosen so that a single OP2 file could store all the instruments for a General MIDI song. This bank has support for two-voice instruments to provide support for pseudo four-operator instruments.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][8] || magic || &amp;lt;tt&amp;gt;#OPL_II#&amp;lt;/tt&amp;gt; signature, doesn&#039;t null terminated&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][175][36] || instrument || Set of 175 instrument entry&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][175][32] || names || Instrument names per every instrument entry, must be null terminated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument===&lt;br /&gt;
&lt;br /&gt;
Each bank contains 128 melodic and 47 percussion instruments.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || flags || N/A || Instrument flags: 0x01 - fixed pitch, 0x02 - Unknown flag, 0x04 - Double-voice mode&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || fineTune ||  N/A || Second voice detune level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || noteNum ||  N/A || Percussion note number (between 0 and 128)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|First voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar1     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack1   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain1  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel1  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale1    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel1    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback1    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar1     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack1   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain1  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel1  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale1    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel1    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved1     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset1 || N/A || MIDI note offset for a first voice&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|Second voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar2     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack2   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain2  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel2  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale2    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel2    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback2    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar2     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack2   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain2  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel2  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale2    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel2    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved2     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset2 || N/A || MIDI note offset for a second voice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument names===&lt;br /&gt;
&lt;br /&gt;
=== Fine tune ===&lt;br /&gt;
Fine tune value is an index offset of frequencies table. 128 is a center, i.e. don&#039;t detune. Formula of index offset is: &amp;lt;tt&amp;gt;(fine_tune / 2) - 64&amp;lt;/tt&amp;gt;. Each unit of fine tune field is approximately equal to 1/0.015625 of tone. &lt;br /&gt;
&lt;br /&gt;
=== Percussion instruments ===&lt;br /&gt;
Percussion instruments are in range between 35 (Bass drum 1) and 81 (Open Triangle) MIDI indeces.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.vgmpf.com/Wiki/index.php/IMF_Creator IMF Creator]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; .op2&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = Yes; Unknown flag&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Utility by Adam Biser to create IMF music. Also includes OP2 bank editor.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7141</id>
		<title>Apogee Sound System Timbre Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7141"/>
		<updated>2017-07-23T19:36:43Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: small fix of categories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Type2 = MIDI&lt;br /&gt;
 | Count = 256&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Duke Nukem 3D}}&lt;br /&gt;
   {{Game|Blood}}&lt;br /&gt;
   {{Game|Shadow Warrior}}&lt;br /&gt;
   {{Game|NAM}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Apogee Sound System Timbre Format&#039;&#039;&#039; is an instrument bank format used by the Apogee Sound System library developed by 3D Realms. The 128 melodic and 128 percussion instrument limit was most likely chosen so that a single TMB file could store all the instruments for a General MIDI song.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
TMB files have no header and signature. The file contains 256 13-byte instrument entries (first 128 are melodic, and next 128 are percussion).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || SAVEK[0] ||  0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || SAVEK[1] ||  0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[0] ||  0x40 || Modulator key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[1] ||  0x43 || Carrier key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[0]  ||  0x60 || Modulator attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[1]  ||  0x63 || Carrier attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[0]  ||  0x80 || Modulator sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[1]  ||  0x83 || Carrier sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[0]  ||  0xE0 || Modulator wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[1]  ||  0xE3 || Carrier wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Feedback ||  0xC0 || Feedback/connection&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Transpose ||  N/A  || Note offset for melodic instruments, and key number for percussion&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Velocity  ||  N/A  || Velocity offset&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The TMB format is directly based on [[IBK Format]], and has first 12 bytes be same as in the IBK Format. Official &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt; utility (Can be found with the source code of 3D Realms games in the Audio Library public folder) generates TMB files from the set of IBK files.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; .tmb&lt;br /&gt;
| canImport = Yes; [[IBK Format|.ibk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;Apogee Sound System&#039;&#039; SDK&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Category:Instrument_tools&amp;diff=7140</id>
		<title>Category:Instrument tools</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Category:Instrument_tools&amp;diff=7140"/>
		<updated>2017-07-23T19:34:50Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added &amp;quot;Modding tools&amp;quot; category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Modding Tools]]&lt;br /&gt;
This category holds all tools that able to work with instrument banks and files.&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Category:Instrument_tools&amp;diff=7139</id>
		<title>Category:Instrument tools</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Category:Instrument_tools&amp;diff=7139"/>
		<updated>2017-07-23T19:33:40Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Created page with &amp;quot;This category holds all tools that able to work with instrument banks and files.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This category holds all tools that able to work with instrument banks and files.&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OPL3_Bank_Editor&amp;diff=7138</id>
		<title>OPL3 Bank Editor</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OPL3_Bank_Editor&amp;diff=7138"/>
		<updated>2017-07-23T19:31:01Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Change category into &amp;quot;Instrument&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tool Infobox&lt;br /&gt;
 | Platform = GNU/Linux, Windows, macOS&lt;br /&gt;
 | Release = 2016-06-09&lt;br /&gt;
 | Homepage = [https://github.com/Wohlstand/OPL3BankEditor/blob/master/README.md OPL3 Bank Editor]&lt;br /&gt;
 | Download = [https://github.com/Wohlstand/OPL3BankEditor github.com]&lt;br /&gt;
 | Edit1 = Instrument&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OPL3 Bank Editor&#039;&#039;&#039; is a free and open source utility to create and edit various music instrument bank formats, developed by [[User:Wohlstand|Wohlstand]]. Various bank formats are had no own bank editor (For example, [[TMB Format]] which is originally is generating by merging and chopping of two IBK files by official MAKETMB utility, or [[Junglevision Patch File Format]] which has proprietary bank editor that wasn&#039;t available in public), or had them be inconvenient. This bank editor allows working with all those formats by having same and friendly UI.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
* Support for 2-operator, pseudo-4-operator, and 4-operator instruments and banks&lt;br /&gt;
* Instrument testing through Nuked OPL3 emulator&lt;br /&gt;
* Playing single note and various chords&lt;br /&gt;
* Mouse-clickable piano claves to test various notes&lt;br /&gt;
* Keyboard can be used to test instrument like on piano&lt;br /&gt;
* &amp;quot;Shut-up&amp;quot; button which allows to quickly mute all chip&#039;s channels&lt;br /&gt;
* Tool-tips are describing purposes of every field&lt;br /&gt;
* Import/Export of single instrument files&lt;br /&gt;
* Instrument import from music files such as from [[IMF Format|IMF]] and [[CMF Format|CMF]]&lt;br /&gt;
* Ability to toggle global Deep Tremolo and Deep Vibrato flags&lt;br /&gt;
* Support for both melodic and rhythm mode percussions&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.vogons.org/viewtopic.php?f=9&amp;amp;t=48513 Support thread on VOGONS forum]&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Global_Timbre_Library&amp;diff=7137</id>
		<title>Global Timbre Library</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Global_Timbre_Library&amp;diff=7137"/>
		<updated>2017-07-23T19:25:33Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added &amp;quot;Tools&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&lt;br /&gt;
{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Type2 = MIDI&lt;br /&gt;
 | Count = 65535&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Syndicate}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The Global Timbre Library is an instrument bank format used by the Miles Sound System developed by John Miles.&lt;br /&gt;
&lt;br /&gt;
The file defines a number of &amp;quot;timbres&amp;quot; (instruments) in the form of OPL register values. The instruments are indexed by MIDI bank and patch numbers, and are intended to be used for the playback of [[XMI Format]] MIDI tracks.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file consists of two arrays:&lt;br /&gt;
&lt;br /&gt;
# The header array&lt;br /&gt;
# The timbre (instrument) data array&lt;br /&gt;
&lt;br /&gt;
=== Header array ===&lt;br /&gt;
&lt;br /&gt;
The header array is a packed array of 6-octet header structs. There is one header per timbre (patch). Each header contains the following data:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[INT8]] || patch || MIDI Patch number&lt;br /&gt;
|-&lt;br /&gt;
| [[INT8]] || bank || MIDI Bank number&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE][offset] || offset || The offset of the data for this instrument, relative to the start of the file.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The array is terminated by a 2-octet marker, 0xFFFF.&lt;br /&gt;
&lt;br /&gt;
=== Timbre data ===&lt;br /&gt;
&lt;br /&gt;
Immediately following the header array is the timbre data array. It has the same number of entries as the header array. Each timbre has the following structure (OPL2 format):&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || length || - || Struct length, including the length field itself. Value is always 14 for OPL2 instruments, and 25(?) for OPL3.&lt;br /&gt;
|-&lt;br /&gt;
| [[U(?)INT8]] || transpose || - || {{TODO|Precise meaning unknown}}&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || mod_AVEKM || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || mod_KSLTL || 0x40|| Modulator key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || mod_AD || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || mod_SR || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || mod_WS || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || fb_c || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || car_AVEKM || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || car_KSLTL || 0x43 || Carrier key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || car_AD || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || car_SR || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || car_WS || 0xE4 || Carrier wave select&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.thegleam.com/ke5fx/misc/AIL2.ZIP Open Source release of Miles Sound System version 2 for DOS] by John Miles. See XPLAY.C and YAMAHA.INC.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = XPLAY&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Official example utility to play XMI files by using of GTL banks&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=SBI_Format&amp;diff=7136</id>
		<title>SBI Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=SBI_Format&amp;diff=7136"/>
		<updated>2017-07-23T19:21:19Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added &amp;quot;Tools&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = Instrument-only&lt;br /&gt;
 | Instruments = OPL&lt;br /&gt;
 | NumChannels = 1&lt;br /&gt;
 | NumTracks = 0&lt;br /&gt;
 | Tags = Title&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;SBI (Sound Blaster Instrument) Format&#039;&#039;&#039; stores a single instrument suitable for playback on a sound card with an OPL2 or OPL3 chip.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is structured as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][4] || signature || &amp;quot;SBI&amp;quot; followed by 0x1A&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][32] || name || Instrument title (must be NULL-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][16] || inst || Instrument settings (see below)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Instrument settings ===&lt;br /&gt;
&lt;br /&gt;
The instrument is in the following format.  This is identical to the format used for each instrument in [[CMF Format]] songs and [[IBK Format]] instrument banks.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!OPL base register!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModChar||0x20||Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarChar||0x23||Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModScale||0x40||Modulator key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarScale||0x43||Carrier key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModAttack||0x60||Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarAttack||0x63||Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModSustain||0x80||Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarSustain||0x83||Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModWaveSel||0xE0||Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarWaveSel||0xE3||Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iFeedback||0xC0||Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][5]&lt;br /&gt;
|colspan=3|Padding to bring instrument definition up to 16 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Percussive instruments ====&lt;br /&gt;
&lt;br /&gt;
There is no indication as to whether a given instrument should be played in melodic or percussive mode.  Playing an instrument destined for one mode in the other usually sounds quite bad.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
* [[SBTimbre]] - can import or export instruments in SBI format&lt;br /&gt;
* [[SBANK]] - can convert SBI between [[AdLib Instrument Format|AdLib INS]] format&lt;br /&gt;
* [[OPL3 Bank Editor]] - can import or export instruments in SBI format&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=CMF_Format&amp;diff=7135</id>
		<title>CMF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=CMF_Format&amp;diff=7135"/>
		<updated>2017-07-23T19:19:20Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added OPL3 Bank Editor into tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = MIDI&lt;br /&gt;
 | Instruments = OPL&lt;br /&gt;
 | NumChannels = 16&lt;br /&gt;
 | NumTracks = 1&lt;br /&gt;
 | NumPatterns = 1&lt;br /&gt;
 | NumOrders = 0&lt;br /&gt;
 | Tags = Title, Artist, Remarks&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Jill of the Jungle}}&lt;br /&gt;
   {{Game|Kiloblaster}}&lt;br /&gt;
   {{Game|Scud Atak}}&lt;br /&gt;
   {{Game|Solar Winds}}&lt;br /&gt;
   {{Game|Traffic Department 2192}}&lt;br /&gt;
   {{Game|Math Rescue}}&lt;br /&gt;
   {{Game|Word Rescue}}&lt;br /&gt;
   {{Game|Xargon}}&lt;br /&gt;
}}&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;u&amp;gt;C&amp;lt;/u&amp;gt;reative &amp;lt;u&amp;gt;M&amp;lt;/u&amp;gt;usic &amp;lt;u&amp;gt;F&amp;lt;/u&amp;gt;ormat (CMF)&amp;lt;/b&amp;gt; was created by Creative Labs for use with their SoundBlaster series of sound cards.  It is a cut-down version of the [[MID Format|MIDI format]] (only one track) but unlike MIDI it allows custom instruments to be stored in the file itself (and unlike the Module formats that preceeded it, the instruments were not sampled but were synthesised using the Adlib/SoundBlaster OPL chips.)&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file begins with a header:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|BYTE[4]||cSignature||&amp;quot;CTMF&amp;quot; (not NULL-terminated)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iVersionMinor||Minor version number (normally 0x01)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iVersionMajor||Major version number (normally 0x01)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iOffsetInstruments||Offset of the instrument block, from the start of the file&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iOffsetMusic||Offset of the music block, from the start of the file&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iTicksPerQuarter||Clock ticks per quarter note (one beat)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iTicksPerSecond||Clock ticks per second&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iOffsetTitle||Offset of the song title string, zero if no title&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iOffsetComposer||Offset of the composer&#039;s name, zero if not listed&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iOffsetRemarks||Offset of the &amp;quot;remarks&amp;quot; string, zero if no remarks&lt;br /&gt;
|-&lt;br /&gt;
|UINT8[16]||iChannelInUse||Channel in use table (0x00 == channel not used, 0x01 == channel used in song)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The rest of the header depends on the version:&lt;br /&gt;
&lt;br /&gt;
==== Version 1.0 ====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iInstrumentCount||Number of instruments used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Version 1.1 ====&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iInstrumentCount||Number of instruments used&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iTempo||Basic tempo (BPM?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The song title, composer and remarks (if present) should follow this header and the instrument block should follow that (although there is no requirement for them to be located here, as long as the offsets in the header point to the correct location.)  These three strings are NULL-terminated ASCII.&lt;br /&gt;
&lt;br /&gt;
It is worth noting that the header stores both a tempo value and a &amp;quot;ticks per quarter note&amp;quot; value, however the only field that seems to be used for timing during playback is the &amp;quot;ticks per second&amp;quot; field.  The tempo field doesn&#039;t even exist in version 1.0 files.  It is assumed &amp;quot;basic tempo&amp;quot; means BPM (beats per minute) as this is the meaning of the &amp;quot;basic tempo&amp;quot; field in the earlier [[AdLib MIDI Format]].&lt;br /&gt;
&lt;br /&gt;
It is also worth noting that between v1.0 and v1.1, the number of possible instruments expanded from a maximum of 256 (UINT8) to 65536 (UINT16.)  However the MIDI data itself is only capable of addressing up to 128 instruments, so any extras cannot be used.  Perhaps there was originally an intention to make these available through instrument banks like MIDI does.&lt;br /&gt;
&lt;br /&gt;
Be aware that the title/composer/remarks fields are supposed to be zero if there is no metadata, but [[Highway Hunter]] sets them to invalid values (past EOF), so you may wish to check that these fields are within range and ignore them otherwise.&lt;br /&gt;
&lt;br /&gt;
=== Instrument block ===&lt;br /&gt;
&lt;br /&gt;
The instrument block contains all the instruments used in the song.  The first instrument is referred to in the song data as instrument zero (MIDI patch #0.)  The following table lists the fields used to define one instrument - it is repeated &#039;&#039;iInstrumentCount&#039;&#039; times.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!OPL base register!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iModChar||0x20||Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCarChar||0x23||Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iModScale||0x40||Modulator key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCarScale||0x43||Carrier key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iModAttack||0x60||Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCarAttack||0x63||Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iModSustain||0x80||Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCarSustain||0x83||Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iModWaveSel||0xE0||Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iCarWaveSel||0xE3||Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
|UINT8||iFeedback||0xC0||Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
|BYTE[5]&lt;br /&gt;
|colspan=3|Padding to bring instrument definition up to 16 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There are 16 default instruments, repeated into the 128 available MIDI instruments (so instrument 0, 16, 32, etc. all refer to this first default instrument.  See [[#Default instruments]] below)  The instrument block then overrides these defaults.  [[Word Rescue]] is notable for having CMFs that rely on these default instruments being present and correct.&lt;br /&gt;
&lt;br /&gt;
==== Percussive instruments ====&lt;br /&gt;
Since each CMF instrument contains both OPL modulator and OPL carrier settings, when an instrument is selected in a CMF file, both the modulator and carrier settings are loaded into the OPL chip for that channel.&lt;br /&gt;
&lt;br /&gt;
When the CMF is in percussive mode however (see [[#Controller 0x67: Rhythm mode]] below), most of the percussive instruments only occupy either a modulator or a carrier (i.e. half an instrument.)  This means that loading these instruments must be treated slightly differently, as a whole instrument is supplied but only half of it will be loaded into the OPL chip, and not necessarily the expected half.&lt;br /&gt;
&lt;br /&gt;
When percussive mode is active and an instrument change event (MIDI event 0xC0) is received on a percussive channel (12-16 inclusive), the instruments should be loaded as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!CMF channel!!Instrument!!Instrument source!!OPL cell&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;12&amp;lt;/center&amp;gt;||Bass drum||Modulator&amp;lt;br&amp;gt;Carrier||13 - Channel 7 Modulator&amp;lt;br&amp;gt;16 - Channel 7 Carrier&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;13&amp;lt;/center&amp;gt;||Snare drum||Modulator||17 - Channel 8 Carrier&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;14&amp;lt;/center&amp;gt;||Tom tom||Modulator||15 - Channel 9 Modulator&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;15&amp;lt;/center&amp;gt;||Top cymbal||Modulator||18 - Channel 9 Carrier&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;16&amp;lt;/center&amp;gt;||Hi-hat||Modulator||14 - Channel 8 Modulator&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Despite some documentation suggesting that certain instruments cannot have their pitch set, the Creative Labs SBFMDRV will play all percussive instruments at the requested pitch.  Note however that as only one pitch can be set per channel, playing both a snare and hi-hat, or both a tom tom and top cymbal, at the same time, will cause a conflict, potentially changing the pitch of an already-playing note.  The Creative Labs SBFMDRV simply writes the pitch as each note is played, changing the pitch of any currently playing note on the shared channel.&lt;br /&gt;
&lt;br /&gt;
Be aware that some songs (e.g. [[Kiloblaster]]&#039;s &amp;lt;tt&amp;gt;song_2&amp;lt;/tt&amp;gt;) play two different percussive instruments simultaneously, when those two instruments share the same OPL channel (e.g. hi-hat and snare drum.)  The notes are actually played at different pitches, which introduces a conflict, as only one note frequency is available for the channel and it must be shared by both instruments.  In this case the order of events is important, as the pitch of the last event at that instant is the one that gets set for the channel.  Normally with MIDI, if notes are played at the same instant in time it does not matter which order they are issued in, however in this case the song is quite different if the order is not maintained.&lt;br /&gt;
&lt;br /&gt;
Essentially SBFMDRV writes the pitch to the OPL channel as the events are encountered, so whichever note is played last is the frequency the channel will be set to.&lt;br /&gt;
&lt;br /&gt;
=== Song data ===&lt;br /&gt;
&lt;br /&gt;
The song data itself is in standard MIDI format - identical to the &#039;&#039;data&#039;&#039; stored in a MIDI MTrk block (but without the &amp;quot;MTrk&amp;quot; header of course.)  For details on this, see the [[MID Format#MIDI data|MIDI data description]].&lt;br /&gt;
&lt;br /&gt;
One difference worth noting is that the official Creative Labs CMF player does not support pitch bends (code 0xE0) and those events are simply ignored.  Simple sysex data appears to be ignored also, however its use in a CMF file can cause problems with other players.&lt;br /&gt;
&lt;br /&gt;
==== MIDI controllers ====&lt;br /&gt;
&lt;br /&gt;
In addition to the standard MIDI controllers (which are actually rarely used in CMF files), the following controllers have special meaning in a CMF file.  Each controller has one data byte (the &amp;quot;controller value&amp;quot;, 0-127), and the meaning of this byte will of course depend on which controller was selected.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Controller!!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x63||Non-standard extension: AM+VIB depth control (see below)&lt;br /&gt;
|-&lt;br /&gt;
|0x66||Set marker byte (used as a status flag readable by a music player)&lt;br /&gt;
|-&lt;br /&gt;
|0x67||Switch OPL between melody and rhythm mode (see below)&lt;br /&gt;
|-&lt;br /&gt;
|0x68||Transpose up by given number of 1/128 semitones&lt;br /&gt;
|-&lt;br /&gt;
|0x69||Transpose down by given number of 1/128 semitones&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Controller 0x63: Depth control =====&lt;br /&gt;
MIDI controller 0x63 is a nonstandard extension to allow the OPL&#039;s AM+VIB depth control to be adjusted (normal CMF playback has both the AM and VIB depth control fixed in the on state.)  When this controller is set to zero, the depth control is switched off (i.e. amplitude depth is 1 dB, vibrato depth is 7 cents.)  Setting the controller to a value of one increases the vibrato to a depth of 14 cents (OPL port 0xBD has bit 6 set), and setting the control to a value of two increases the amplitude depth to 4.8 dB (OPL port 0xBD has bit 7 set).  Setting the control to a value of three increases both depth controllers, which is the CMF default setting (OPL port 0xBD has bits 6 and 7 set.)&lt;br /&gt;
&lt;br /&gt;
Since this setting is global and affects the entire OPL chip, it does not matter which channel the controller change is issued on.&lt;br /&gt;
&lt;br /&gt;
===== Controller 0x66: Song markers =====&lt;br /&gt;
Controller 0x66 is used to set a marker byte in the song.  This can be used to notify the music player that a certain point in a song has been reached, or to trigger some kind of action in time with the music.&lt;br /&gt;
&lt;br /&gt;
===== Controller 0x67: Rhythm mode =====&lt;br /&gt;
MIDI controller 0x67 is used to switch between &amp;quot;melody mode&amp;quot; and OPL &amp;quot;rhythm mode.&amp;quot;  In melody mode, nine-channel FM music is possible.  In rhythm-mode, six-channel FM music is possible, with an additional five channels used for percussion (allowing 11 sounds to be played simultaneously.)  In this mode, the last five MIDI channels are reserved for the percussive instruments as shown below.&lt;br /&gt;
&lt;br /&gt;
Since this setting is global and affects the entire OPL chip, it does not matter which channel the controller change is issued on.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Hex channel!!MIDI channel!!Use in melody mode!!Use in rhythm mode&lt;br /&gt;
|-&lt;br /&gt;
|0x00||1||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x01||2||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x02||3||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x03||4||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x04||5||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x05||6||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x06||7||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x07||8||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x08||9||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x09||10||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x0A||11||Normal instrument||Normal instrument&lt;br /&gt;
|-&lt;br /&gt;
|0x0B||12||Normal instrument||Bass drum&lt;br /&gt;
|-&lt;br /&gt;
|0x0C||13||Normal instrument||Snare drum&lt;br /&gt;
|-&lt;br /&gt;
|0x0D||14||Normal instrument||Tom-tom&lt;br /&gt;
|-&lt;br /&gt;
|0x0E||15||Normal instrument||Top cymbal&lt;br /&gt;
|-&lt;br /&gt;
|0x0F||16||Normal instrument||Hi-hat cymbal&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [[#CMF/MIDI vs Adlib channels]] below for more details.&lt;br /&gt;
&lt;br /&gt;
===== Controller 0x68: Transpose up =====&lt;br /&gt;
This controller transposes all following notes on the channel up by the given number of 1/128 semitones.  Since the controller value must be between 0 and 127, it will allow a song to be transposed up anywhere between zero and almost a full semitone.  The value is absolute, so a controller requesting a transpose up by 127 followed by a transpose up by 64, will initially be transposed up by almost a full semitone (127) but will then be transposed back by a half semitone (to 64).&lt;br /&gt;
&lt;br /&gt;
A value of zero resets back to &amp;quot;not transposed.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===== Controller 0x69: Transpose down =====&lt;br /&gt;
Identical to controller 0x68 (Transpose up) only of course in the opposite direction, and again only affecting the channel the controller is issued on.&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
==== Keyon/off handling ====&lt;br /&gt;
Some songs don&#039;t always send keyoffs after a keyon, or they send them out of order (e.g. note 1 on, delay, note 2 on, note 1 off, delay, note 2 off.)  If you don&#039;t check this you&#039;ll end up switching a note off too early (in the above example the &amp;quot;note 1 off&amp;quot; should *not* switch off &amp;quot;note 2&amp;quot; that was switched on just before it.)  &amp;lt;tt&amp;gt;song_9.xr1&amp;lt;/tt&amp;gt; from the first episode of Xargon is an excellent example of this, right at the start of the song.&lt;br /&gt;
&lt;br /&gt;
The best way of handling this when playing through an OPL chip seems to be to remember the last note played on a channel, and upon receiving a keyoff, only process it if the keyoff is for the note currently playing on the channel (otherwise it can be discarded.)  If a keyon is received and a note is already being played on a channel, the old note should be switched off just before playing the new note.&lt;br /&gt;
&lt;br /&gt;
==== Keyon/off timing ====&lt;br /&gt;
Some songs play a note-on, then immediately (with no delay) have a corresponding note-off.  If this is played faithfully, then the note will not be heard, however the Creative Labs player still plays these notes.  The correct solution is {{TODO|currently unknown - wait for one tick or use the emulator callback between events?}}.  A good example of this is the first few notes in &amp;lt;tt&amp;gt;song_32.xr1&amp;lt;/tt&amp;gt;.  ([https://github.com/adplug/adplug/issues/41 Discussion])&lt;br /&gt;
&lt;br /&gt;
==== Default instruments ====&lt;br /&gt;
Although no documentation exists about this, it seems that the Creative Labs player sets the 128 available instruments based on 16 defaults looped/repeated to fill the 128 slots.  They do not appear to be based on any MIDI instrument specification.  Any instruments included in the CMF file then override these defaults.  Some songs (e.g. the [[Word Rescue]] background music) rely on these default instruments and don&#039;t play properly if only their custom instruments are set.&lt;br /&gt;
&lt;br /&gt;
There appear to be a different set of default instruments used for the percussion channels when rhythm mode is active.  More investigation needs to be done to determine what these are and if they are related to the 16 default melody instruments.&lt;br /&gt;
&lt;br /&gt;
{{TODO|Post a set of OPL settings here (perhaps in [[IBK Format]]) that provides these default parameters.}}&lt;br /&gt;
&lt;br /&gt;
{{TODO|Confirm whether it&#039;s possible to set more than 16 custom instruments, without them looping and overwriting the earlier ones.}}&lt;br /&gt;
&lt;br /&gt;
==== CMF/MIDI vs Adlib channels ====&lt;br /&gt;
MIDI (and consequently CMF) supports up to 16 channels.  The OPL2 synth on the Adlib only supports a maximum of nine channels in normal mode, or six channels plus five percussion instruments in rhythm mode.&lt;br /&gt;
&lt;br /&gt;
This means that any CMF player must correctly map up to 16 MIDI channels to only nine OPL channels.  Many songs from games work correctly with a 1:1 mapping (i.e. the game music doesn&#039;t go beyond MIDI channel 9), however there are some songs that use channels beyond this (e.g. [[Word Rescue]] again, which, given the Voyetra credit, has probably been minimally converted from MIDI.)&lt;br /&gt;
&lt;br /&gt;
At the time of writing, there are no known songs that use more than nine MIDI channels simultaneously, however [[Word Rescue]]&#039;s E1L1 song appears to sound more than nine notes simultaneously across a smaller number of channels, so if all these notes should be heard, the extended OPL3 channels probably need to be used.  [[Xargon]] &amp;lt;tt&amp;gt;song9&amp;lt;/tt&amp;gt; also sounds multiple notes simultaneously in a single channel.  Either of these will result in lost notes unless the available channels are cleverly managed.&lt;br /&gt;
&lt;br /&gt;
As an aside, it would be interesting to test this with Creative&#039;s driver to see how it behaves.&lt;br /&gt;
&lt;br /&gt;
==== Note velocity ====&lt;br /&gt;
The velocity values are loaded more or less directly into the OPL chip.  This means unlike MIDI, the velocity is not a linear scale from 0 to 127, but logarithmic.  A value of 1 is almost silent, and rapidly increase in volume so that values 2 and 3 are much louder.  At the other end of the scale, 127 is full volume, but 126 and 125 are barely any quieter.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
* CMF2MID - convert CMF files into MIDI ([http://www.hitsquad.com/smm/programs/cmf2mid/ Link 1])&lt;br /&gt;
* [http://adplug.sourceforge.net AdPlug/AdPlay] - Plugins for various audio players (plus a command line player) that mostly supports CMF files&lt;br /&gt;
* [http://www.shikadi.net/utils/xmms.html Malvineous&#039; Adlib plugin] - Plugin for XMMS and Audacious that plays most CMF files more accurately than AdPlug&lt;br /&gt;
* [[OPL3 Bank Editor]] - import instruments from CMF files to use them in banks&lt;br /&gt;
&lt;br /&gt;
== Similar formats ==&lt;br /&gt;
* The CMF song data is stored in the same format as used by [[MID Format|MIDI files]]&lt;br /&gt;
* The [[SBI Format]] (SoundBlaster Instrument) is the same as used in the CMF instrument block, with a header on the front.&lt;br /&gt;
* The [[IBK Format]] (Instrument Bank) is a group of SBI instruments, similar to the whole CMF instrument block.&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=IMF_Format&amp;diff=7134</id>
		<title>IMF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=IMF_Format&amp;diff=7134"/>
		<updated>2017-07-23T19:17:56Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
 | Tags = Unofficial: Title, Composer, Remarks, Program name&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Blake Stone}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Commander Keen 4-6}}&lt;br /&gt;
   {{Game|Corridor 7 Alien Invasion}}&lt;br /&gt;
   {{Game|Cosmo&#039;s Cosmic Adventures}}&lt;br /&gt;
   {{Game|Duke Nukem II}}&lt;br /&gt;
   {{Game|Hocus Pocus}}&lt;br /&gt;
   {{Game|Major Stryker}}&lt;br /&gt;
   {{Game|Monster Bash}}&lt;br /&gt;
   {{Game|Operation Body Count}}&lt;br /&gt;
   {{Game|Realms of Chaos}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;u&amp;gt;i&amp;lt;/u&amp;gt;d Software &amp;lt;u&amp;gt;M&amp;lt;/u&amp;gt;usic &amp;lt;u&amp;gt;F&amp;lt;/u&amp;gt;ormat (IMF)&amp;lt;/b&amp;gt; is a raw music format that stores the actual bytes sent to the Adlib&#039;s [[OPL2]] chip.  For this reason it is a very simple format to process.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
There are two versions of the IMF format: &amp;lt;b&amp;gt;Type-0&amp;lt;/b&amp;gt; format and &amp;lt;b&amp;gt;Type-1&amp;lt;/b&amp;gt; format.  In a Type-0 file, the whole file is Adlib data that is played until the end of the file is reached.  Type-1 files are actually ripped chunks from an [[AudioT Format]] file. No game ever actually used Type-1 IMFs that were not stored inside an AudioT file. The two initial bytes contain the size of the Adlib data (not including the two bytes themselves), so only this much data is played.  This means it&#039;s possible to store arbitrary data in a Type-1 IMF file after the song data (see [[#Tag Data]] below.)&lt;br /&gt;
&lt;br /&gt;
As a matter of luck, the first two data bytes in a Type-0 files are almost always 0x00 0x00, so this can be used to detect the file format version.  If the first two bytes match the length of the file it is likely Type-1, but be aware that trailing data will mean this is not always true.  Otherwise the only other way is to parse all the register/value pairs in the file and ensure the register is [[OPL chip#Register Map|within range]] (e.g. registers 0xA0 to 0xA9 are valid, but 0xAA to 0xAF should never be used.)  Note that 0x00 is actually an invalid register, but must be treated as valid since the files usually begin by writing 0x00 to register 0x00.&lt;br /&gt;
&lt;br /&gt;
Another way to detect the type of an IMF file is to examine the first few instructions in the IMF file. The idea is that the first few IMF commands set up the AdLib registers and therefore should have no delay. Even if there is a delay, it would normally be relatively low compared to the combined 16-bit value of the (register, value) pair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
UINT16 ReadInt16LE(FILE* in)&lt;br /&gt;
{&lt;br /&gt;
	UINT8 buf[2];&lt;br /&gt;
	fread(buf, 1, 2, in);&lt;br /&gt;
	return (buf[0] | (buf[1] &amp;lt;&amp;lt; 8));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int IMF_IsChunk(FILE* in)&lt;br /&gt;
{&lt;br /&gt;
	UINT16 chunksize, buff, i=42;&lt;br /&gt;
	UINT32 sum1=0, sum2=0;&lt;br /&gt;
&lt;br /&gt;
	if(!in)&lt;br /&gt;
		return 0;&lt;br /&gt;
&lt;br /&gt;
	if (!feof(in))&lt;br /&gt;
	{&lt;br /&gt;
		chunksize = ReadInt16LE(in);&lt;br /&gt;
		if ((chunksize == 0) || (chunksize &amp;amp; 3))&lt;br /&gt;
			return 0;&lt;br /&gt;
&lt;br /&gt;
		while(!feof(in) &amp;amp;&amp;amp; i)&lt;br /&gt;
		{&lt;br /&gt;
			buff = ReadInt16LE(in);&lt;br /&gt;
			sum1 += buff;&lt;br /&gt;
			buff = ReadInt16LE(in);&lt;br /&gt;
			sum2 += buff;&lt;br /&gt;
			i--;&lt;br /&gt;
		}&lt;br /&gt;
		fseek(in, 0, SEEK_SET);&lt;br /&gt;
		return (sum1 &amp;gt; sum2);&lt;br /&gt;
	}&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code given above, if the file is a chunk (Type-1), then &amp;lt;tt&amp;gt;sum1&amp;lt;/tt&amp;gt; contains the sum of all (register, value) pairs and &amp;lt;tt&amp;gt;sum2&amp;lt;/tt&amp;gt; contains the sum of all delays. If it&#039;s a plain IMF file (Type-0), the sums are swapped.&lt;br /&gt;
&lt;br /&gt;
The only case in which this detection would fail is IMF data that writes a bunch of zeroes to register zero (which would be pointless since that register is undefined) and/or has very large delays (which would be pointless because it would lead to delays of up to a minute before the next IMF command would be processed, resulting in multiple minutes of silence before the song actually starts playing notes).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT16LE]]||iLength||Song data length in bytes (Type-1 format only)&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][iLength]||cAdlibData||Song data (see below) - &amp;lt;code&amp;gt;iLength&amp;lt;/code&amp;gt; bytes long if Type-1, or until EOF if Type-0&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][]||cExtraData||Arbitrary data/tags (Type-1 format only, see [[#Tag Data]] below)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The earliest version of the IMF data in the [[AudioT Format]] actually starts with a [[UINT32LE]] length value. The Commander Keen 4 Demo uses that early version. Just extracting the IMF chunk from the &amp;lt;tt&amp;gt;AUDIOT.CK4&amp;lt;/tt&amp;gt; file will most likely confuse programs, since the file does not start with two 0&#039;s. Programs that only check the first two bytes will assume that the file is a ripped chunk, but will swap the delays and register/data pairs because of the length value being stored in the first four bytes instead of just the first two. That means the song will not play the intended notes. Programs that use the detection code given above will identify the file as plain IMF data and treat the length value as an IMF command. That means the song will play correctly at first, but any trailing data present in the file will also be interpreted as IMF data, most likely leading to long delays at the end of the song.&lt;br /&gt;
&lt;br /&gt;
Note that for Type-1 files, the initial two bytes (the &amp;quot;song data length&amp;quot;) are likely to be the filesize minus two, as the two initial bytes aren&#039;t counted.  The obvious exception to this is if there is trailing data at the end of the OPL data, such as an info tag.&lt;br /&gt;
&lt;br /&gt;
The song data is composed of four-byte &amp;quot;units&amp;quot;:&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]]||Adlib register&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]]||Adlib data&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT16LE]]||Delay&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data byte is sent to the specified register on the Adlib card, followed by a delay for the specified number of cycles.  For a 560Hz IMF file, there are 560 cycles in one second (see [[#Timing]] below), so a delay of 560 would result in one second of silence (and likewise in a 700Hz IMF the delay value would need to be 700 to produce one second of silence.)  A delay of 1 would wait for a single cycle, and a delay of zero means the next register/data pair should be sent immediately (so in a single &#039;cycle&#039;, data would be sent continuously until the next non-zero delay value is reached.)&lt;br /&gt;
&lt;br /&gt;
=== Timing ===&lt;br /&gt;
&lt;br /&gt;
IMF files exist at three known speeds.  Unfortunately this is determined by the game, not the IMF file, so tempo cannot be determined from the music files alone. Extracted IMFs can be compared to discern their speeds.  The known speeds are:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Speed!!Game&lt;br /&gt;
|-&lt;br /&gt;
|280Hz||[[Duke Nukem II]]&lt;br /&gt;
|-&lt;br /&gt;
|560Hz||[[Bio Menace]], [[Commander Keen]], [[Cosmo&#039;s Cosmic Adventures]], [[Monster Bash]]&lt;br /&gt;
|-&lt;br /&gt;
|700Hz||[[Blake Stone]], [[Major Stryker]], [[Operation Body Count]], [[Wolfenstein 3-D]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The easiest method to tell the files apart is to treat all files with a .WLF extension as 700Hz and all .IMF files as 560Hz.  Since Duke II is the odd one out, it is usually ignored since doubling the value of all the delay bytes conveniently turns it into a 560Hz .IMF.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
As IMF files contain Adlib music for games that may also have Adlib sound effects, care must be taken to ensure that IMF music and any sound effects can share the OPL chip without conflict.  This is done by reserving the OPL&#039;s first channel for sound effects, leaving eight remaining channels available for use in IMF files.  This has been confirmed by automated inspection of the IMF files from the following games, all of which have no data on OPL channel #0 beyond 2-3 initialisation commands: [[Bio Menace]], [[Blake Stone]], [[Commander Keen 4-6]], [[Cosmo&#039;s Cosmic Adventures]], [[Duke Nukem II]], [[Major Stryker]], [[Monster Bash]], [[Operation Body Count]], [[Wolfenstein 3-D]].&lt;br /&gt;
&lt;br /&gt;
In situations where channel #0 is not reserved and is used by the IMF file, when it is placed back into the game it interferes with the sound effects causing distortion, transposition, and otherwise resulting in broken sound effects.  This can happen when an IMF file is created using a utility that does not take into account the fact that channel #0 must be left unused.  See the end of this page for a list of utilities that can create IMF files and whether they treat channel #0 correctly.&lt;br /&gt;
&lt;br /&gt;
It is worth noting that channel #0 is unused even in games such as Cosmo and Monster Bash, which do not use Adlib sound effects (Cosmo has PC speaker effects only and Monster Bash has PC speaker and digitised PCM audio.)  It is also worth mentioning that some IMF songs from [[Monster Bash]] make use of the OPL&#039;s rhythm-mode, which trades three note-producing channels for five percussion channels. The IMF songs from the Keen 4 Demo also use rhythm-mode.&lt;br /&gt;
&lt;br /&gt;
=== Tag Data ===&lt;br /&gt;
&lt;br /&gt;
In a Type-1 IMF file it&#039;s possible to store data after the end of a song (as per the length given in the first two bytes of the file.)  There are a few uses for this - some games store additional (unused) data there generated when the files were added to the game&#039;s group file, and others have repurposed this area to store information about the song itself (title, artist, etc.)&lt;br /&gt;
&lt;br /&gt;
The tag data was originally written to the AudioT files by Id Software&#039;s tool [[Muse]] and was probably only processed by that tool. The [[Wolfenstein 3-D]] source code reads the entire chunk from the [[AudioT Format|AudioT]] file (including any tag data), but it only ever uses the song length and the song data.&lt;br /&gt;
&lt;br /&gt;
==== Official data ====&lt;br /&gt;
For those files which were distributed with additional data in this area, it is not entirely clear what the purpose of this data is.  It was apparently added when the source IMF files were compiled into a group audio file by [[Muse]]. (They appear not to be part of the source IMF files as there are occurrences where a file consists solely of tag data.) The format appears to be the same in all games that use it (such as Bio Menace or Wolfenstein 3-D) but it is not supported by any IMF players.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT16LE]]||Unknown||&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][16]||strTitle||Song title&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][64]||strRemarks||Song comment/message, usually source file name.&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][6]||cProg||Data from the compiler?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Unofficial uses ====&lt;br /&gt;
It is also possible to store tags there, and this simple format is supported by most IMF players:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]]||cSignature||0x1A&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][256]||strTitle||Song title&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][256]||strComposer||Song composer&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][256]||strRemarks||Song comment/message&lt;br /&gt;
|-&lt;br /&gt;
|[[char]][9]||cProg||Name of the first program that added these tags (eight bytes + terminating NULL, pad out with NULLs if necessary.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the char[256] strings are variable-length NULL-terminated strings.  Their maximum length is 256 bytes *including* the terminating NULL, meaning the string will only ever contain 255 characters or less, plus the terminating-NULL.  Of course the string will normally be much shorter, and an empty string will consist of a single 0x00 byte.&lt;br /&gt;
&lt;br /&gt;
This tag format is supported by AdPlug when playing IMFs.  The tag format can also be used with .raw files, but no players officially support it yet.&lt;br /&gt;
&lt;br /&gt;
Note that the tags should begin directly after the IMF data, so in other words reading in the first two bytes of the file (the &amp;quot;song length&amp;quot;) and then seeking forward that many bytes, should put the file pointer at the start of the tag block (so the next byte that will be read in should be 0x1A, if the tags are present.)&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://adplug.sourceforge.net AdPlug]&lt;br /&gt;
| Platform = All&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; [[RAW Format (Adlib)|.raw]]&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&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 = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.shikadi.net/utils/cmf2imf CMF2IMF]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = Yes; [[CMF Format|.cmf]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Doesn&#039;t leave channel 0 clear for SFX&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.shikadi.net/utils/dro2imf DRO2IMF]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = Yes; [[DRO Format|.dro]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Doesn&#039;t leave channel 0 clear for SFX&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[DRO2MIDI]]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; [[MID Format|.mid]]&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://winwolf3d.dugtrio17.com/download/IMFCreator IMFCreator]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = Yes; [[MID Format|.mid]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = MUS2IMF&lt;br /&gt;
| Platform = DOS?&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = Yes; [[MUS Format|.mus]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = OPL3 Bank Editor can import FM instruments from IMF files&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=7133</id>
		<title>OP2 Bank Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=7133"/>
		<updated>2017-07-23T19:14:22Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added OPL3 Bank Editor into tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL, MIDI&lt;br /&gt;
 | Count = 175&lt;br /&gt;
 | Names = Yes, 31 char&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Chex Quest}}&lt;br /&gt;
   {{Game|Chex Quest 2}}&lt;br /&gt;
   {{Game|Doom}}&lt;br /&gt;
   {{Game|Doom 2}}&lt;br /&gt;
   {{Game|Heretic}}&lt;br /&gt;
   {{Game|Hexen}}&lt;br /&gt;
   {{Game|Raptor}}&lt;br /&gt;
   {{Game|Strife}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;OP2 Bank Format&#039;&#039;&#039; is an instrument bank format used by the DMX sound library developed by Paul Radek of Digital Expressions, Inc. The 128 melodic and 47 percussion instrument limit was most likely chosen so that a single OP2 file could store all the instruments for a General MIDI song. This bank has support for two-voice instruments to provide support for pseudo four-operator instruments.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][8] || magic || &amp;lt;tt&amp;gt;#OPL_II#&amp;lt;/tt&amp;gt; signature, doesn&#039;t null terminated&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][175][36] || instrument || Set of 175 instrument entry&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][175][32] || names || Instrument names per every instrument entry, must be null terminated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument===&lt;br /&gt;
&lt;br /&gt;
Each bank contains 128 melodic and 47 percussion instruments.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || flags || N/A || Instrument flags: 0x01 - fixed pitch, 0x02 - Unknown flag, 0x04 - Double-voice mode&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || fineTune ||  N/A || Second voice detune level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || noteNum ||  N/A || Percussion note number (between 0 and 128)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|First voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar1     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack1   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain1  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel1  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale1    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel1    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback1    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar1     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack1   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain1  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel1  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale1    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel1    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved1     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset1 || N/A || MIDI note offset for a first voice&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|Second voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar2     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack2   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain2  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel2  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale2    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel2    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback2    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar2     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack2   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain2  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel2  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale2    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel2    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved2     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset2 || N/A || MIDI note offset for a second voice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument names===&lt;br /&gt;
&lt;br /&gt;
=== Fine tune ===&lt;br /&gt;
Fine tune value is an index offset of frequencies table. 128 is a center, i.e. don&#039;t detune. Formula of index offset is: &amp;lt;tt&amp;gt;(fine_tune / 2) - 64&amp;lt;/tt&amp;gt;. Each unit of fine tune field is approximately equal to 1/0.015625 of tone. &lt;br /&gt;
&lt;br /&gt;
=== Percussion instruments ===&lt;br /&gt;
Percussion instruments are in range between 35 (Bass drum 1) and 81 (Open Triangle) MIDI indeces.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.vgmpf.com/Wiki/index.php/IMF_Creator IMF Creator]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; .op2&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = Yes; Unknown flag&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Utility by Adam Biser to create IMF music. Also includes OP2 bank editor.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7132</id>
		<title>Apogee Sound System Timbre Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7132"/>
		<updated>2017-07-23T19:13:01Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added OPL3 Bank Editor into tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL, MIDI&lt;br /&gt;
 | Count = 256&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Duke Nukem 3D}}&lt;br /&gt;
   {{Game|Blood}}&lt;br /&gt;
   {{Game|Shadow Warrior}}&lt;br /&gt;
   {{Game|NAM}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Apogee Sound System Timbre Format&#039;&#039;&#039; is an instrument bank format used by the Apogee Sound System library developed by 3D Realms. The 128 melodic and 128 percussion instrument limit was most likely chosen so that a single TMB file could store all the instruments for a General MIDI song.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
TMB files have no header and signature. The file contains 256 13-byte instrument entries (first 128 are melodic, and next 128 are percussion).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || SAVEK[0] ||  0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || SAVEK[1] ||  0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[0] ||  0x40 || Modulator key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[1] ||  0x43 || Carrier key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[0]  ||  0x60 || Modulator attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[1]  ||  0x63 || Carrier attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[0]  ||  0x80 || Modulator sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[1]  ||  0x83 || Carrier sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[0]  ||  0xE0 || Modulator wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[1]  ||  0xE3 || Carrier wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Feedback ||  0xC0 || Feedback/connection&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Transpose ||  N/A  || Note offset for melodic instruments, and key number for percussion&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Velocity  ||  N/A  || Velocity offset&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The TMB format is directly based on [[IBK Format]], and has first 12 bytes be same as in the IBK Format. Official &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt; utility (Can be found with the source code of 3D Realms games in the Audio Library public folder) generates TMB files from the set of IBK files.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; .tmb&lt;br /&gt;
| canImport = Yes; [[IBK Format|.ibk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;Apogee Sound System&#039;&#039; SDK&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=AdLib_Instrument_Format&amp;diff=7131</id>
		<title>AdLib Instrument Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=AdLib_Instrument_Format&amp;diff=7131"/>
		<updated>2017-07-23T19:11:45Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added OPL3 Bank Editor into tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Count = 1&lt;br /&gt;
 | Names = No&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;AdLib Instrument Format&#039;&#039;&#039; was the original format developed by Ad Lib, Inc. in 1987 to store OPL instruments in individual files with the &amp;lt;tt&amp;gt;.ins&amp;lt;/tt&amp;gt; extension.  It went through a number of revisions as hardware capabilities were added to the OPL chip, but ultimately it was replaced by the [[AdLib Instrument Bank Format]], which combined multiple instruments into a single file with a &amp;lt;tt&amp;gt;.bnk&amp;lt;/tt&amp;gt; extension.&lt;br /&gt;
&lt;br /&gt;
For a short time before the BNK format was introduced, there was an early bank format called [[AdLib Timbre Bank Format]] which used a &amp;lt;tt&amp;gt;.snd&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;.tim&amp;lt;/tt&amp;gt; extension.  Each instrument in this bank format is stored in a structure almost identical to the structure used in the individual &amp;lt;tt&amp;gt;.ins&amp;lt;/tt&amp;gt; instrument files.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is in the following structure:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || unknown || {{TODO|Unknown purpose, always 0x0000}}&lt;br /&gt;
|-&lt;br /&gt;
| OPLREGS || oplModulator || Register values for the Modulator (0) operator&lt;br /&gt;
|-&lt;br /&gt;
| OPLREGS || oplCarrier || Register values for the Carrier (1) operator&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iModWaveSel || Modulator wave select (only bits 0-1 recognised, OPL register 0xE0)&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iCarWaveSel || Carrier wave select (only bits 0-1 recognised, OPL register 0xE0)&lt;br /&gt;
|-&lt;br /&gt;
| char[22] || unknown2 || {{TODO|Unknown purpose reserved space. Second to last byte usually always 0x01 or 0x00}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The last three fields (&amp;lt;tt&amp;gt;iModWaveSel&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iCarWaveSel&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;unknown2&amp;lt;/tt&amp;gt;) are not present in early 54-byte files in this format. Some files are also missing &amp;lt;tt&amp;gt;oplCarrier&amp;lt;/tt&amp;gt; entirely - presumably these are patches for single-operator percussive instruments. Possibly &amp;lt;tt&amp;gt;unknown2&amp;lt;/tt&amp;gt; is an instrument name, but the existing software doesn&#039;t use it and uses the base filename instead.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;OPLREGS&#039;&#039; structure is defined as:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description !! OPL base register !! Value range&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iKSL || Key scaling level || 0x40 (bits 6-7) ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iMultiple || Frequency multiplier || 0x20 (bits 0-3) || iMultiple &amp;amp; 0x0F is sent to OPL register [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iFeedback || Feedback || 0xC0 (bits 1-3) || Although only bits 1-3 are valid, Vinyl doesn&#039;t limit the output to three bits wide.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iAttack || Attack rate || 0x60 (upper four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iSustain || Sustain level || 0x80 (upper four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iEG || Envelope gain (nonzero value is on) || 0x20 (bit 5) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iDecay || Decay rate || 0x60 (lower four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iReleaseRate || Release rate || 0x80 (lower four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iTotalLevel || Total output level || 0x40 (bit 0-5) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iAM || Amplitude modulation (Tremolo) || 0x20 (bit 7) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iVIB || Frequency Vibrato || 0x20 (bit 6) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iKSR || Key scaling/envelope rate || 0x20 (bit 4) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iCONoff || Connector [OP0 only] || 0xC0 (bit 0, inverted) || 0: OPL bit set to 1&amp;lt;br&amp;gt;other: OPL bit set to 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Percussive instruments ===&lt;br /&gt;
&lt;br /&gt;
There is apparently no distinction between percussive and melodic instruments.  This is controlled at playback time, depending on which channel the instrument is loaded into.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = AdLib &amp;lt;tt&amp;gt;bankmng.exe&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; [[AdLib Instrument Bank Format|.bnk]]&lt;br /&gt;
| canImport = Yes; [[AdLib Instrument Bank Format|.bnk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;AdLib Programmer&#039;s Manual&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = No&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 = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was documented by [[User:Malvineous|Malvineous]] from reading code included with the &#039;&#039;AdLib Programmer&#039;s Manual&#039;&#039;.  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>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=IBK_Format&amp;diff=7130</id>
		<title>IBK Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=IBK_Format&amp;diff=7130"/>
		<updated>2017-07-23T19:10:44Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Tools */ Small fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL, MIDI&lt;br /&gt;
 | Count = 128&lt;br /&gt;
 | Names = Yes, 8 chars&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Drum Blaster}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;IBK (Instrument Bank) Format&#039;&#039;&#039; was created to store up to 128 instruments suitable for playback on a sound card with an OPL2 or OPL3 chip. The 128 instrument limit was most likely chosen so that a single IBK file could store all the instruments for a General MIDI song.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is structured as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][4] || signature || &amp;quot;IBK&amp;quot; followed by 0x1A&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][16][128] || inst || 128 instrument settings, 16 bytes each (see below)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][9][128] || names || 128 instrument titles (each must be NULL-terminated, giving 8 visible chars max)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Instruments ===&lt;br /&gt;
&lt;br /&gt;
Each instrument is in the following format.  This is identical to the format used for the instrument block in [[CMF Format]] files.  Each individual instrument is the same as in the [[SBI Format]].&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!OPL base register!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModChar||0x20||Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarChar||0x23||Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModScale||0x40||Modulator key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarScale||0x43||Carrier key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModAttack||0x60||Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarAttack||0x63||Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModSustain||0x80||Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarSustain||0x83||Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModWaveSel||0xE0||Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarWaveSel||0xE3||Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iFeedback||0xC0||Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iPercVoc||N/A||Percussion voice mode:&amp;lt;br&amp;gt;0 is melodic, 6 - bass drum, 7 - Snare, 8 - Tom-Tom, 9 - Cymbell, 10 - HiHat&lt;br /&gt;
|-&lt;br /&gt;
|[[INT8]]||iTranspos||N/A||Number of notes to transpose timbre, signed&lt;br /&gt;
|-&lt;br /&gt;
|[[INT8]]||iDPitch||N/A||Percussion pitch: MIDI Note 0 - 127&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][2]&lt;br /&gt;
|colspan=3|Padding to bring instrument definition up to 16 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Percussive instruments ====&lt;br /&gt;
&lt;br /&gt;
Percussive instruments are indicated by &amp;lt;tt&amp;gt;iPercvoc&amp;lt;/tt&amp;gt; field. Percussive instruments are using rhythm mode of the OPL2/OPL3 chip.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[SBTimbre]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; [[IBK Format|.ibk]]&lt;br /&gt;
| canImport = Yes; [[AdLib Instrument Bank Format|.bnk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Instrument editor using IBK as its primary format&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=IBK_Format&amp;diff=7129</id>
		<title>IBK Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=IBK_Format&amp;diff=7129"/>
		<updated>2017-07-23T19:10:11Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added OPL3 Bank Editor into tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL, MIDI&lt;br /&gt;
 | Count = 128&lt;br /&gt;
 | Names = Yes, 8 chars&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Drum Blaster}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;IBK (Instrument Bank) Format&#039;&#039;&#039; was created to store up to 128 instruments suitable for playback on a sound card with an OPL2 or OPL3 chip. The 128 instrument limit was most likely chosen so that a single IBK file could store all the instruments for a General MIDI song.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is structured as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][4] || signature || &amp;quot;IBK&amp;quot; followed by 0x1A&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][16][128] || inst || 128 instrument settings, 16 bytes each (see below)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][9][128] || names || 128 instrument titles (each must be NULL-terminated, giving 8 visible chars max)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Instruments ===&lt;br /&gt;
&lt;br /&gt;
Each instrument is in the following format.  This is identical to the format used for the instrument block in [[CMF Format]] files.  Each individual instrument is the same as in the [[SBI Format]].&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!OPL base register!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModChar||0x20||Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarChar||0x23||Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModScale||0x40||Modulator key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarScale||0x43||Carrier key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModAttack||0x60||Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarAttack||0x63||Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModSustain||0x80||Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarSustain||0x83||Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModWaveSel||0xE0||Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarWaveSel||0xE3||Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iFeedback||0xC0||Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iPercVoc||N/A||Percussion voice mode:&amp;lt;br&amp;gt;0 is melodic, 6 - bass drum, 7 - Snare, 8 - Tom-Tom, 9 - Cymbell, 10 - HiHat&lt;br /&gt;
|-&lt;br /&gt;
|[[INT8]]||iTranspos||N/A||Number of notes to transpose timbre, signed&lt;br /&gt;
|-&lt;br /&gt;
|[[INT8]]||iDPitch||N/A||Percussion pitch: MIDI Note 0 - 127&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][2]&lt;br /&gt;
|colspan=3|Padding to bring instrument definition up to 16 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Percussive instruments ====&lt;br /&gt;
&lt;br /&gt;
Percussive instruments are indicated by &amp;lt;tt&amp;gt;iPercvoc&amp;lt;/tt&amp;gt; field. Percussive instruments are using rhythm mode of the OPL2/OPL3 chip.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[SBTimbre]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; [[IBK Format|.ibk]]&lt;br /&gt;
| canImport = Yes; [[AdLib Instrument Bank Format|.bnk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Instrument editor using IBK as its primary format&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=AdLib_Instrument_Bank_Format&amp;diff=7128</id>
		<title>AdLib Instrument Bank Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=AdLib_Instrument_Bank_Format&amp;diff=7128"/>
		<updated>2017-07-23T19:07:57Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Added OPL3 Bank Editor into tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&lt;br /&gt;
{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Count = 65535&lt;br /&gt;
 | Names = Yes, 8 chars&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|SkyRoads}}&lt;br /&gt;
   {{Game|Super Tetris}}&lt;br /&gt;
   {{Game|Wordtris}}&lt;br /&gt;
   {{Game|Witchaven}}&lt;br /&gt;
   {{Game|Witchaven II}}&lt;br /&gt;
   {{Game|Dark Legions}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;Ad Lib BNK Format&#039;&#039;&#039; is an instrument bank file created by the Ad Lib Corporation. It was designed for version 1.5 of &#039;&#039;AdLib Visual Composer&#039;&#039; in 1989, to work in conjunction with [[ROL Format]] music files.  It had been discovered that the ~80-byte [[AdLib Instrument Format|individual instrument files]] were actually using closer to 1,024 bytes of disk space each, due to the way the DOS FAT filesystem allocates at least one cluster per file.  By combining all the instruments into a single &amp;lt;tt&amp;gt;.bnk&amp;lt;/tt&amp;gt; file, disk space could be drastically reduced.&lt;br /&gt;
&lt;br /&gt;
BNK files contain all of the custom instrument data for a set of ROL songs which contained the notes to play. Games that feature music composed with AdLib Visual Composer usually have BNK files as well, although in the case of [[:Category:id Software|id Software]] titles, the two files were converted into [[IMF Format]] during game development. Also this format used by [[Human Machine Interfaces MIDI Format|Human Machine Interfaces]] sound engine for music instruments in HMP and HMI files.&lt;br /&gt;
&lt;br /&gt;
The format can be opened and edited by the Instrument Maker program that came with AdLib Visual Composer.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file begins with a header:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || verMajor || Major version number&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || verMinor || Minor version number&lt;br /&gt;
|-&lt;br /&gt;
| [[char]] || signature || &amp;quot;ADLIB-&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || numUsed || Number of instrument records in use&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || numInstruments || Number of instrument records in the file&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]] || offsetName || Offset where instrument names begin&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]] || offsetData || Offset where instrument data begins&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][8] || pad || Padded with 0x00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is followed by a list of instrument names, repeated &amp;lt;tt&amp;gt;numInstruments&amp;lt;/tt&amp;gt; times:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || index || Index into data section&amp;lt;br&amp;gt;Calculation: &amp;lt;tt&amp;gt;offsetInstr = offsetData + (index * sizeof(PackedTimbre))&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || flags || 0 if this record is not used, else 1&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][9] || name || Instrument name - must be NULL-terminated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It&#039;s important that it must be sorted by instrument name in alphabetical order to be correctly processed by Ad Lib tools.&lt;br /&gt;
&lt;br /&gt;
At this point, the current position should be the same as &amp;lt;tt&amp;gt;offsetData&amp;lt;/tt&amp;gt;.  The actual instrument data follows, again repeated once for each instrument.  The instrument data is in the following format, which is almost identical to the [[AdLib Instrument Format]] except with only one byte to store each field instead of two.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iPercussive || 0: Melodic instrument&amp;lt;br&amp;gt;1: Percussive instrument&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iVoiceNum || Voice number (percussive only)&lt;br /&gt;
|-&lt;br /&gt;
| OPLREGS || oplModulator || Register values for the Modulator operator (op 0)&lt;br /&gt;
|-&lt;br /&gt;
| OPLREGS || oplCarrier || Register values for the Carrier operator (op 1)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel || Modulator wave select (OPL base register 0xE0)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel || Carrier wave select (OPL base register 0xE0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;OPLREGS&#039;&#039; structure is defined as:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description !! OPL base register !! Value range&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || ksl         || Key scaling level                   || 0x40 (bits 6-7)        ||&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || multiple    || Frequency multiplier                || 0x20 (bits 0-3)        || iMultiple &amp;amp; 0x0F is sent to OPL register [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || feedback    || Feedback [op 0 only, op 1 ignored]  || 0xC0 (bits 1-3)        ||&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || attack      || Attack rate                         || 0x60 (upper four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || sustain     || Sustain level                       || 0x80 (upper four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || eg          || Envelope gain (nonzero value is on) || 0x20 (bit 5)           || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || decay       || Decay rate                          || 0x60 (lower four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || releaseRate || Release rate                        || 0x80 (lower four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || totalLevel  || Total output level                  || 0x40 (bit 0-5)         || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || am          || Amplitude modulation (Tremolo)      || 0x20 (bit 7)           || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || vib         || Frequency Vibrato                   || 0x20 (bit 6)           || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || ksr         || Key scaling/envelope rate           || 0x20 (bit 4)           || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || con         || Connector [op 0 only, op 1 ignored] || 0xC0 (bit 0, inverted) || 0: OPL bit set to 1&amp;lt;br&amp;gt;other: OPL bit set to 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This structure is almost identical to an individual instrument in [[AdLib Instrument Format]], but with [[UINT8]] fields instead of [[UINT16LE]].&lt;br /&gt;
&lt;br /&gt;
== Human Machine Interfaces version (&amp;quot;Version 0.0&amp;quot;)==&lt;br /&gt;
&lt;br /&gt;
{{TODO|Find out more about what is altered and how this version could be worked with.}}&lt;br /&gt;
&lt;br /&gt;
The version of this format associated with HMP/HMI files is altered and incompatible with most tools that work with BNK files. Known differences include:&lt;br /&gt;
* The major and minor version numbers in the header are both zero.&lt;br /&gt;
* The flags byte in the instrument names list may have values other than 0 or 1, and a null flags byte might not be indicative of an unused sample.&lt;br /&gt;
The header and names list otherwise appear to follow the format spec.  The instrument data itself has not yet been inspected for differences.&lt;br /&gt;
&lt;br /&gt;
Known examples of games that include files of this version include two possibly standardized file names: DRUMS.BNK and MELODIC.BNK.  Dark Legions also includes a BNKDRUM.BNK.  All of the known &amp;quot;version 0.0&amp;quot; files are 5,404 bytes in length, with 128 instrument records reported in the header, but have differing contents.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = AdLib &amp;lt;tt&amp;gt;bankmng.exe&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; [[AdLib Instrument Format|.ins]]&lt;br /&gt;
| canImport = Yes; [[AdLib Instrument Format|.ins]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;AdLib Visual Composer&#039;&#039; and &#039;&#039;AdLib Programmer&#039;s Manual&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[SBTimbre]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; [[IBK Format|.ibk]]&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[OPL3 Bank Editor]]&lt;br /&gt;
| Platform = Linux, Windows, macOS&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; many&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes =&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OPL3_Bank_Editor&amp;diff=7127</id>
		<title>OPL3 Bank Editor</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OPL3_Bank_Editor&amp;diff=7127"/>
		<updated>2017-07-23T18:34:28Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Created page with &amp;quot;{{Tool Infobox  | Platform = GNU/Linux, Windows, macOS  | Release = 2016-06-09  | Homepage = [https://github.com/Wohlstand/OPL3BankEditor/blob/master/README.md OPL3 Bank Edito...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tool Infobox&lt;br /&gt;
 | Platform = GNU/Linux, Windows, macOS&lt;br /&gt;
 | Release = 2016-06-09&lt;br /&gt;
 | Homepage = [https://github.com/Wohlstand/OPL3BankEditor/blob/master/README.md OPL3 Bank Editor]&lt;br /&gt;
 | Download = [https://github.com/Wohlstand/OPL3BankEditor github.com]&lt;br /&gt;
 | Edit1 = Music&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OPL3 Bank Editor&#039;&#039;&#039; is a free and open source utility to create and edit various music instrument bank formats, developed by [[User:Wohlstand|Wohlstand]]. Various bank formats are had no own bank editor (For example, [[TMB Format]] which is originally is generating by merging and chopping of two IBK files by official MAKETMB utility, or [[Junglevision Patch File Format]] which has proprietary bank editor that wasn&#039;t available in public), or had them be inconvenient. This bank editor allows working with all those formats by having same and friendly UI.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
* Support for 2-operator, pseudo-4-operator, and 4-operator instruments and banks&lt;br /&gt;
* Instrument testing through Nuked OPL3 emulator&lt;br /&gt;
* Playing single note and various chords&lt;br /&gt;
* Mouse-clickable piano claves to test various notes&lt;br /&gt;
* Keyboard can be used to test instrument like on piano&lt;br /&gt;
* &amp;quot;Shut-up&amp;quot; button which allows to quickly mute all chip&#039;s channels&lt;br /&gt;
* Tool-tips are describing purposes of every field&lt;br /&gt;
* Import/Export of single instrument files&lt;br /&gt;
* Instrument import from music files such as from [[IMF Format|IMF]] and [[CMF Format|CMF]]&lt;br /&gt;
* Ability to toggle global Deep Tremolo and Deep Vibrato flags&lt;br /&gt;
* Support for both melodic and rhythm mode percussions&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.vogons.org/viewtopic.php?f=9&amp;amp;t=48513 Support thread on VOGONS forum]&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=File:OPL3_Bank_Editor.png&amp;diff=7126</id>
		<title>File:OPL3 Bank Editor.png</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=File:OPL3_Bank_Editor.png&amp;diff=7126"/>
		<updated>2017-07-23T14:02:42Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=7125</id>
		<title>OP2 Bank Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=OP2_Bank_Format&amp;diff=7125"/>
		<updated>2017-07-23T13:48:09Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Created page with &amp;quot;{{Instrument Infobox  | Type = OPL, MIDI  | Count = 175  | Names = Yes, 31 char  | Games =    {{Game|Chex Quest}}    {{Game|Chex Quest 2}}    {{Game|Doom}}    {{Game|Doom 2}}...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL, MIDI&lt;br /&gt;
 | Count = 175&lt;br /&gt;
 | Names = Yes, 31 char&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Chex Quest}}&lt;br /&gt;
   {{Game|Chex Quest 2}}&lt;br /&gt;
   {{Game|Doom}}&lt;br /&gt;
   {{Game|Doom 2}}&lt;br /&gt;
   {{Game|Heretic}}&lt;br /&gt;
   {{Game|Hexen}}&lt;br /&gt;
   {{Game|Raptor}}&lt;br /&gt;
   {{Game|Strife}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;OP2 Bank Format&#039;&#039;&#039; is an instrument bank format used by the DMX sound library developed by Paul Radek of Digital Expressions, Inc. The 128 melodic and 47 percussion instrument limit was most likely chosen so that a single OP2 file could store all the instruments for a General MIDI song. This bank has support for two-voice instruments to provide support for pseudo four-operator instruments.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][8] || magic || &amp;lt;tt&amp;gt;#OPL_II#&amp;lt;/tt&amp;gt; signature, doesn&#039;t null terminated&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][175][36] || instrument || Set of 175 instrument entry&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][175][32] || names || Instrument names per every instrument entry, must be null terminated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument===&lt;br /&gt;
&lt;br /&gt;
Each bank contains 128 melodic and 47 percussion instruments.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || flags || N/A || Instrument flags: 0x01 - fixed pitch, 0x02 - Unknown flag, 0x04 - Double-voice mode&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || fineTune ||  N/A || Second voice detune level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || noteNum ||  N/A || Percussion note number (between 0 and 128)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|First voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar1     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack1   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain1  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel1  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale1    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel1    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback1    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar1     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack1   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain1  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel1  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale1    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel1    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved1     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset1 || N/A || MIDI note offset for a first voice&lt;br /&gt;
|-&lt;br /&gt;
!colspan=4|Second voice&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModChar2     || 0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModAttack2   || 0x60 || Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModSustain2  || 0x80 || Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModWaveSel2  || 0xE0 || Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModScale2    || 0x40 || Modulator key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iModLevel2    || 0x40 || Modulator output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iFeedback2    || 0xC0 || Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarChar2     || 0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarAttack2   || 0x63 || Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarSustain2  || 0x83 || Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarWaveSel2  || 0xE3 || Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarScale2    || 0x43 || Carrier key scaling (first two bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || iCarLevel2    || 0x43 || Carrier output level (last six bits)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || reserved2     || N/A || Unused byte&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || noteOffset2 || N/A || MIDI note offset for a second voice&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Instrument names===&lt;br /&gt;
&lt;br /&gt;
=== Fine tune ===&lt;br /&gt;
Fine tune value is an index offset of frequencies table. 128 is a center, i.e. don&#039;t detune. Formula of index offset is: &amp;lt;tt&amp;gt;(fine_tune / 2) - 64&amp;lt;/tt&amp;gt;. Each unit of fine tune field is approximately equal to 1/0.015625 of tone. &lt;br /&gt;
&lt;br /&gt;
=== Percussion instruments ===&lt;br /&gt;
Percussion instruments are in range between 35 (Bass drum 1) and 81 (Open Triangle) MIDI indeces.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.vgmpf.com/Wiki/index.php/IMF_Creator IMF Creator]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; .op2&lt;br /&gt;
| canImport = Yes; many&lt;br /&gt;
| editHidden = Yes&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Utility by Adam Biser to create IMF music. Also includes OP2 bank editor.&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=AdLib_Instrument_Format&amp;diff=7124</id>
		<title>AdLib Instrument Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=AdLib_Instrument_Format&amp;diff=7124"/>
		<updated>2017-07-23T12:19:53Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* File format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Count = 1&lt;br /&gt;
 | Names = No&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;AdLib Instrument Format&#039;&#039;&#039; was the original format developed by Ad Lib, Inc. in 1987 to store OPL instruments in individual files with the &amp;lt;tt&amp;gt;.ins&amp;lt;/tt&amp;gt; extension.  It went through a number of revisions as hardware capabilities were added to the OPL chip, but ultimately it was replaced by the [[AdLib Instrument Bank Format]], which combined multiple instruments into a single file with a &amp;lt;tt&amp;gt;.bnk&amp;lt;/tt&amp;gt; extension.&lt;br /&gt;
&lt;br /&gt;
For a short time before the BNK format was introduced, there was an early bank format called [[AdLib Timbre Bank Format]] which used a &amp;lt;tt&amp;gt;.snd&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;.tim&amp;lt;/tt&amp;gt; extension.  Each instrument in this bank format is stored in a structure almost identical to the structure used in the individual &amp;lt;tt&amp;gt;.ins&amp;lt;/tt&amp;gt; instrument files.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is in the following structure:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || unknown || {{TODO|Unknown purpose, always 0x0000}}&lt;br /&gt;
|-&lt;br /&gt;
| OPLREGS || oplModulator || Register values for the Modulator (0) operator&lt;br /&gt;
|-&lt;br /&gt;
| OPLREGS || oplCarrier || Register values for the Carrier (1) operator&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iModWaveSel || Modulator wave select (only bits 0-1 recognised, OPL register 0xE0)&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iCarWaveSel || Carrier wave select (only bits 0-1 recognised, OPL register 0xE0)&lt;br /&gt;
|-&lt;br /&gt;
| char[22] || unknown2 || {{TODO|Unknown purpose reserved space. Second to last byte usually always 0x01 or 0x00}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The last three fields (&amp;lt;tt&amp;gt;iModWaveSel&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iCarWaveSel&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;unknown2&amp;lt;/tt&amp;gt;) are not present in early 54-byte files in this format. Some files are also missing &amp;lt;tt&amp;gt;oplCarrier&amp;lt;/tt&amp;gt; entirely - presumably these are patches for single-operator percussive instruments. Possibly &amp;lt;tt&amp;gt;unknown2&amp;lt;/tt&amp;gt; is an instrument name, but the existing software doesn&#039;t use it and uses the base filename instead.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;OPLREGS&#039;&#039; structure is defined as:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description !! OPL base register !! Value range&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iKSL || Key scaling level || 0x40 (bits 6-7) ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iMultiple || Frequency multiplier || 0x20 (bits 0-3) || iMultiple &amp;amp; 0x0F is sent to OPL register [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iFeedback || Feedback || 0xC0 (bits 1-3) || Although only bits 1-3 are valid, Vinyl doesn&#039;t limit the output to three bits wide.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iAttack || Attack rate || 0x60 (upper four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iSustain || Sustain level || 0x80 (upper four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iEG || Envelope gain (nonzero value is on) || 0x20 (bit 5) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iDecay || Decay rate || 0x60 (lower four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iReleaseRate || Release rate || 0x80 (lower four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iTotalLevel || Total output level || 0x40 (bit 0-5) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iAM || Amplitude modulation (Tremolo) || 0x20 (bit 7) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iVIB || Frequency Vibrato || 0x20 (bit 6) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iKSR || Key scaling/envelope rate || 0x20 (bit 4) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iCONoff || Connector [OP0 only] || 0xC0 (bit 0, inverted) || 0: OPL bit set to 1&amp;lt;br&amp;gt;other: OPL bit set to 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Percussive instruments ===&lt;br /&gt;
&lt;br /&gt;
There is apparently no distinction between percussive and melodic instruments.  This is controlled at playback time, depending on which channel the instrument is loaded into.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = AdLib &amp;lt;tt&amp;gt;bankmng.exe&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; [[AdLib Instrument Bank Format|.bnk]]&lt;br /&gt;
| canImport = Yes; [[AdLib Instrument Bank Format|.bnk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;AdLib Programmer&#039;s Manual&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = No&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 = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was documented by [[User:Malvineous|Malvineous]] from reading code included with the &#039;&#039;AdLib Programmer&#039;s Manual&#039;&#039;.  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>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=IBK_Format&amp;diff=7123</id>
		<title>IBK Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=IBK_Format&amp;diff=7123"/>
		<updated>2017-07-23T12:16:33Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Fix the infobox&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL, MIDI&lt;br /&gt;
 | Count = 128&lt;br /&gt;
 | Names = Yes, 8 chars&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Drum Blaster}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;IBK (Instrument Bank) Format&#039;&#039;&#039; was created to store up to 128 instruments suitable for playback on a sound card with an OPL2 or OPL3 chip. The 128 instrument limit was most likely chosen so that a single IBK file could store all the instruments for a General MIDI song.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is structured as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][4] || signature || &amp;quot;IBK&amp;quot; followed by 0x1A&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][16][128] || inst || 128 instrument settings, 16 bytes each (see below)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][9][128] || names || 128 instrument titles (each must be NULL-terminated, giving 8 visible chars max)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Instruments ===&lt;br /&gt;
&lt;br /&gt;
Each instrument is in the following format.  This is identical to the format used for the instrument block in [[CMF Format]] files.  Each individual instrument is the same as in the [[SBI Format]].&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!OPL base register!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModChar||0x20||Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarChar||0x23||Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModScale||0x40||Modulator key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarScale||0x43||Carrier key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModAttack||0x60||Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarAttack||0x63||Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModSustain||0x80||Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarSustain||0x83||Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModWaveSel||0xE0||Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarWaveSel||0xE3||Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iFeedback||0xC0||Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iPercVoc||N/A||Percussion voice mode:&amp;lt;br&amp;gt;0 is melodic, 6 - bass drum, 7 - Snare, 8 - Tom-Tom, 9 - Cymbell, 10 - HiHat&lt;br /&gt;
|-&lt;br /&gt;
|[[INT8]]||iTranspos||N/A||Number of notes to transpose timbre, signed&lt;br /&gt;
|-&lt;br /&gt;
|[[INT8]]||iDPitch||N/A||Percussion pitch: MIDI Note 0 - 127&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][2]&lt;br /&gt;
|colspan=3|Padding to bring instrument definition up to 16 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Percussive instruments ====&lt;br /&gt;
&lt;br /&gt;
Percussive instruments are indicated by &amp;lt;tt&amp;gt;iPercvoc&amp;lt;/tt&amp;gt; field. Percussive instruments are using rhythm mode of the OPL2/OPL3 chip.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
* [[SBTimbre]] - instrument editor using IBK as its primary format&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7122</id>
		<title>Apogee Sound System Timbre Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7122"/>
		<updated>2017-07-23T12:14:26Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL, MIDI&lt;br /&gt;
 | Count = 256&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Duke Nukem 3D}}&lt;br /&gt;
   {{Game|Blood}}&lt;br /&gt;
   {{Game|Shadow Warrior}}&lt;br /&gt;
   {{Game|NAM}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Apogee Sound System Timbre Format&#039;&#039;&#039; is an instrument bank format used by the Apogee Sound System library developed by 3D Realms. The 128 melodic and 128 percussion instrument limit was most likely chosen so that a single TMB file could store all the instruments for a General MIDI song.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
TMB files have no header and signature. The file contains 256 13-byte instrument entries (first 128 are melodic, and next 128 are percussion).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || SAVEK[0] ||  0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || SAVEK[1] ||  0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[0] ||  0x40 || Modulator key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[1] ||  0x43 || Carrier key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[0]  ||  0x60 || Modulator attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[1]  ||  0x63 || Carrier attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[0]  ||  0x80 || Modulator sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[1]  ||  0x83 || Carrier sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[0]  ||  0xE0 || Modulator wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[1]  ||  0xE3 || Carrier wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Feedback ||  0xC0 || Feedback/connection&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Transpose ||  N/A  || Note offset for melodic instruments, and key number for percussion&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Velocity  ||  N/A  || Velocity offset&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The TMB format is directly based on [[IBK Format]], and has first 12 bytes be same as in the IBK Format. Official &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt; utility (Can be found with the source code of 3D Realms games in the Audio Library public folder) generates TMB files from the set of IBK files.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; .tmb&lt;br /&gt;
| canImport = Yes; [[IBK Format|.ibk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;Apogee Sound System&#039;&#039; SDK&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7121</id>
		<title>Apogee Sound System Timbre Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7121"/>
		<updated>2017-07-23T12:12:22Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Tools */ Small fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&lt;br /&gt;
{{Instrument Infobox&lt;br /&gt;
 | Type = OPL, MIDI&lt;br /&gt;
 | Count = 256&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Duke Nukem 3D}}&lt;br /&gt;
   {{Game|Blood}}&lt;br /&gt;
   {{Game|Shadow Warrior}}&lt;br /&gt;
   {{Game|NAM}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Apogee Sound System Timbre Format&#039;&#039;&#039; is an instrument bank format used by the Apogee Sound System library developed by 3D Realms. The 128 melodic and 128 percussion instrument limit was most likely chosen so that a single TMB file could store all the instruments for a General MIDI song.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
TMB files have no header and signature. The file contains 256 13-byte instrument entries (first 128 are melodic, and next 128 are percussion).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || SAVEK[0] ||  0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || SAVEK[1] ||  0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[0] ||  0x40 || Modulator key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[1] ||  0x43 || Carrier key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[0]  ||  0x60 || Modulator attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[1]  ||  0x63 || Carrier attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[0]  ||  0x80 || Modulator sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[1]  ||  0x83 || Carrier sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[0]  ||  0xE0 || Modulator wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[1]  ||  0xE3 || Carrier wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Feedback ||  0xC0 || Feedback/connection&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Transpose ||  N/A  || Note offset for melodic instruments, and key number for percussion&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Velocity  ||  N/A  || Velocity offset&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The TMB format is directly based on [[IBK Format]], and has first 12 bytes be same as in the IBK Format. Official &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt; utility (Can be found with the source code of 3D Realms games in the Audio Library public folder) generates TMB files from the set of IBK files.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; .tmb&lt;br /&gt;
| canImport = Yes; [[IBK Format|.ibk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;Apogee Sound System&#039;&#039; SDK&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Shadow_Warrior&amp;diff=7120</id>
		<title>Shadow Warrior</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Shadow_Warrior&amp;diff=7120"/>
		<updated>2017-07-23T12:10:23Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Add missing TMB format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = Edit&lt;br /&gt;
 | Music = Edit&lt;br /&gt;
 | Text = Edit&lt;br /&gt;
 | Story = Edit&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shadow Warrior&#039;&#039;&#039; is an oriental-themed first-person shooter using the [[:Category:Build engine|Build engine]].  It is one of the final games to use this engine, and compared with the earlier [[Duke Nukem 3D]], has many improvements including 3D sprites, sector-over-sector, drivable vehicles and dozens of new interactive effects.  It also uses an updated version of the Build map editor, which can now modify many additional properties of map elements, beyond simply the lotag and hitag.  Many of these additional values are used for advanced interactive effects, such as deformable walls, used to design cars that crumple when hit by explosions.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Build]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = View&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = EditART&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Yes&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = Kextract/Kgroup&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://dukenukem.wikia.com/wiki/Shadow_Warrior Shadow Warrior on the Duke Nukem wiki]&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.anm&lt;br /&gt;
 | Format = [[ANM Format (Duke Nukem 3D)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Intro and story cutscenes&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.art&lt;br /&gt;
 | Format = [[ART Format (Build)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Level textures&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.bin&lt;br /&gt;
 | Format = [[B800 Text]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Exit text screens&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.dmo&lt;br /&gt;
 | Format = [[DMO Format (Build)]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Demo macros&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.grp&lt;br /&gt;
 | Format = [[GRP Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing most of the game&#039;s data files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.kvx&lt;br /&gt;
 | Format = [[KVX Format (Build)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Voxel (3D) sprites&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.map&lt;br /&gt;
 | Format = [[MAP Format (Build)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.mid&lt;br /&gt;
 | Format = [[MID Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Background music&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.rts&lt;br /&gt;
 | Format = [[RTS Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = &#039;&#039;RemoteRidicule&#039;&#039; multiplayer audio taunts&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = gmtimbre.tmb&lt;br /&gt;
 | Format = [[TMB Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = FM patches for MIDI music (Shareware version only)&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.voc&lt;br /&gt;
 | Format = [[VOC Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Sound effects&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:3DRealms]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Build engine]]&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Duke_Nukem_3D&amp;diff=7119</id>
		<title>Duke Nukem 3D</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Duke_Nukem_3D&amp;diff=7119"/>
		<updated>2017-07-23T12:09:19Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Add missing TMB format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&lt;br /&gt;
&lt;br /&gt;
{{Game Infobox&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = Edit&lt;br /&gt;
 | Music = Edit&lt;br /&gt;
 | Text = Edit&lt;br /&gt;
 | Story = Edit&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Build]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = View&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = EditART&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Yes&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [https://gist.github.com/jasonsperske/31324a0cdffd8edf9683 GRPParser.py]&lt;br /&gt;
| Platform = Python&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Convert to .svg&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = Kextract/Kgroup&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://dukenukem.wikia.com/wiki/Portal:Duke_Nukem_3D Duke Nukem 3D portal] on the Duke Nukem wiki&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.anm&lt;br /&gt;
 | Format = [[ANM Format (Duke Nukem 3D)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Intro and story cutscenes&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.art&lt;br /&gt;
 | Format = [[ART Format (Build)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Level textures&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.bin&lt;br /&gt;
 | Format = [[B800 Text]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Exit text screens&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.con&lt;br /&gt;
 | Format = ASCII text in [[CON Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game parameters and scripting&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.dmo&lt;br /&gt;
 | Format = [[DMO Format (Build)]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Demo macros&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.grp&lt;br /&gt;
 | Format = [[GRP Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing most of the game&#039;s data files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.map&lt;br /&gt;
 | Format = [[MAP Format (Build)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.mid&lt;br /&gt;
 | Format = [[MID Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Background music&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.rts&lt;br /&gt;
 | Format = [[RTS Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = &#039;&#039;RemoteRidicule&#039;&#039; multiplayer audio taunts&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = gmtimbre.tmb&lt;br /&gt;
 | Format = [[TMB Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = FM patches for MIDI music&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.voc&lt;br /&gt;
 | Format = [[VOC Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Sound effects&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
== Modding tips ==&lt;br /&gt;
* The game directory is searched for files before looking inside DUKE3D.GRP.  This means when you replace a file you don&#039;t need to copy it inside DUKE3D.GRP to test it.&lt;br /&gt;
* The game has a command-line option to load custom .GRP files.  This means you can package your mod into a single GRP file and distribute it easily.  Any game files not in your .GRP file will be loaded from the main DUKE3D.GRP.&lt;br /&gt;
&lt;br /&gt;
[[Category:3DRealms]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Build engine]]&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Blood&amp;diff=7118</id>
		<title>Blood</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Blood&amp;diff=7118"/>
		<updated>2017-07-23T12:08:11Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Mark TMB as known format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = Edit&lt;br /&gt;
 | Music = Edit&lt;br /&gt;
 | Text = Edit&lt;br /&gt;
 | Story = Edit&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Blood&#039;&#039;&#039; is a first-person shooter using the [[:Category:Build engine|Build engine]].  It uses a later version of the engine than that used for [[Duke Nukem 3D]], and includes new features such as 3D sprites and sector-over-sector.  These new features are somewhat early in development however, and lack the refinement later found in [[Shadow Warrior]].  This can be seen by the somewhat jerky transition between sector-over-sector rooms, with similar transitions being seamless in Shadow Warrior.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Build]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = View&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = EditART&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Yes&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.blood-wiki.org/index.php/Main_Page Blood wiki]&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.art&lt;br /&gt;
 | Format = [[ART Format (Build)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Level textures&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.dmo&lt;br /&gt;
 | Format = [[DMO Format (Build)]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Demo macros&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.kvx&lt;br /&gt;
 | Format = [[KVX Format (Build)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Voxel (3D) sprites&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.map&lt;br /&gt;
 | Format = [[MAP Format (Build)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.mid&lt;br /&gt;
 | Format = [[MID Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Background music&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.qav&lt;br /&gt;
 | Format = [[QAV Format (Blood)]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Some kind of animation scripts&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.qfn&lt;br /&gt;
 | Format = [[QFN Format (Blood)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Fonts&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.rff&lt;br /&gt;
 | Format = [[RFF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing most of the game&#039;s data files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.seq&lt;br /&gt;
 | Format = [[SEQ Format (Blood)]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = ?&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.smk&lt;br /&gt;
 | Format = [[SMK Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Cutscenes/intro movies&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = gmtimbre.tmb&lt;br /&gt;
 | Format = [[TMB Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = FM patches for MIDI music&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.wav&lt;br /&gt;
 | Format = [[WAV Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Intro sounds&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Monolith]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Build engine]]&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7117</id>
		<title>Apogee Sound System Timbre Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Apogee_Sound_System_Timbre_Format&amp;diff=7117"/>
		<updated>2017-07-23T12:07:23Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Created page with &amp;quot;{{NeedMoreInfo}} {{Instrument Infobox  | Type = OPL, MIDI  | Count = 256  | Names = No  | Games =     {{Game|Duke Nukem 3D}}    {{Game|Blood}}    {{Game|Shadow Warrior}}    {{...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&lt;br /&gt;
{{Instrument Infobox&lt;br /&gt;
 | Type = OPL, MIDI&lt;br /&gt;
 | Count = 256&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Duke Nukem 3D}}&lt;br /&gt;
   {{Game|Blood}}&lt;br /&gt;
   {{Game|Shadow Warrior}}&lt;br /&gt;
   {{Game|NAM}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Apogee Sound System Timbre Format&#039;&#039;&#039; is an instrument bank format used by the Apogee Sound System library developed by 3D Realms. The 128 melodic and 128 percussion instrument limit was most likely chosen so that a single TMB file could store all the instruments for a General MIDI song.&lt;br /&gt;
&lt;br /&gt;
==File format==&lt;br /&gt;
&lt;br /&gt;
TMB files have no header and signature. The file contains 256 13-byte instrument entries (first 128 are melodic, and next 128 are percussion).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! OPL base register !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || SAVEK[0] ||  0x20 || Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || SAVEK[1] ||  0x23 || Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[0] ||  0x40 || Modulator key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Level[1] ||  0x43 || Carrier key scaling/output level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[0]  ||  0x60 || Modulator attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env1[1]  ||  0x63 || Carrier attack/decay level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[0]  ||  0x80 || Modulator sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Env2[1]  ||  0x83 || Carrier sustain/release level&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[0]  ||  0xE0 || Modulator wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Wave[1]  ||  0xE3 || Carrier wave select&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[UINT8]] || Feedback ||  0xC0 || Feedback/connection&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Transpose ||  N/A  || Note offset for melodic instruments, and key number for percussion&lt;br /&gt;
|-                                  &lt;br /&gt;
| [[INT8]] || Velocity  ||  N/A  || Velocity offset&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The TMB format is directly based on [[IBK Format]], and has first 12 bytes be same as in the IBK Format. Official &amp;lt;tt&amp;gt;MAKETMB.EXE&amp;lt;/tt&amp;gt; utility (Can be found with the source code of 3D Realms games in the Audio Library public folder) generates TMB files from the set of IBK files.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = &amp;lt;tt&amp;gt;MAKETIM.EXE&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Yes; .tmb&lt;br /&gt;
| canImport = Yes; [[IBK Format|.ibk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;Apogee Sound System&#039;&#039; SDK&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=IBK_Format&amp;diff=7116</id>
		<title>IBK Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=IBK_Format&amp;diff=7116"/>
		<updated>2017-07-23T11:52:49Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Instruments */ Tiny fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = Instrument-only&lt;br /&gt;
 | Instruments = OPL&lt;br /&gt;
 | NumChannels = 9&lt;br /&gt;
 | NumTracks = 0&lt;br /&gt;
 | Tags = None&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Drum Blaster}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;IBK (Instrument Bank) Format&#039;&#039;&#039; was created to store up to 128 instruments suitable for playback on a sound card with an OPL2 or OPL3 chip.  The 128 instrument limit was most likely chosen so that a single IBK file could store all the instruments for a General MIDI song.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is structured as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][4] || signature || &amp;quot;IBK&amp;quot; followed by 0x1A&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][16][128] || inst || 128 instrument settings, 16 bytes each (see below)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][9][128] || names || 128 instrument titles (each must be NULL-terminated, giving 8 visible chars max)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Instruments ===&lt;br /&gt;
&lt;br /&gt;
Each instrument is in the following format.  This is identical to the format used for the instrument block in [[CMF Format]] files.  Each individual instrument is the same as in the [[SBI Format]].&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!OPL base register!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModChar||0x20||Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarChar||0x23||Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModScale||0x40||Modulator key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarScale||0x43||Carrier key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModAttack||0x60||Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarAttack||0x63||Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModSustain||0x80||Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarSustain||0x83||Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModWaveSel||0xE0||Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarWaveSel||0xE3||Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iFeedback||0xC0||Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iPercVoc||N/A||Percussion voice mode:&amp;lt;br&amp;gt;0 is melodic, 6 - bass drum, 7 - Snare, 8 - Tom-Tom, 9 - Cymbell, 10 - HiHat&lt;br /&gt;
|-&lt;br /&gt;
|[[INT8]]||iTranspos||N/A||Number of notes to transpose timbre, signed&lt;br /&gt;
|-&lt;br /&gt;
|[[INT8]]||iDPitch||N/A||Percussion pitch: MIDI Note 0 - 127&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][2]&lt;br /&gt;
|colspan=3|Padding to bring instrument definition up to 16 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Percussive instruments ====&lt;br /&gt;
&lt;br /&gt;
Percussive instruments are indicated by &amp;lt;tt&amp;gt;iPercvoc&amp;lt;/tt&amp;gt; field. Percussive instruments are using rhythm mode of the OPL2/OPL3 chip.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
* [[SBTimbre]] - instrument editor using IBK as its primary format&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=IBK_Format&amp;diff=7115</id>
		<title>IBK Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=IBK_Format&amp;diff=7115"/>
		<updated>2017-07-23T11:52:05Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: /* Instruments */ Fixed IBK specification, now it is more complete&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = Instrument-only&lt;br /&gt;
 | Instruments = OPL&lt;br /&gt;
 | NumChannels = 9&lt;br /&gt;
 | NumTracks = 0&lt;br /&gt;
 | Tags = None&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Drum Blaster}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;IBK (Instrument Bank) Format&#039;&#039;&#039; was created to store up to 128 instruments suitable for playback on a sound card with an OPL2 or OPL3 chip.  The 128 instrument limit was most likely chosen so that a single IBK file could store all the instruments for a General MIDI song.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is structured as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][4] || signature || &amp;quot;IBK&amp;quot; followed by 0x1A&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][16][128] || inst || 128 instrument settings, 16 bytes each (see below)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]][9][128] || names || 128 instrument titles (each must be NULL-terminated, giving 8 visible chars max)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Instruments ===&lt;br /&gt;
&lt;br /&gt;
Each instrument is in the following format.  This is identical to the format used for the instrument block in [[CMF Format]] files.  Each individual instrument is the same as in the [[SBI Format]].&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Name!!OPL base register!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModChar||0x20||Modulator characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarChar||0x23||Carrier characteristic (Mult, KSR, EG, VIB and AM flags)&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModScale||0x40||Modulator key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarScale||0x43||Carrier key scaling/output level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModAttack||0x60||Modulator attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarAttack||0x63||Carrier attack/decay level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModSustain||0x80||Modulator sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarSustain||0x83||Carrier sustain/release level&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iModWaveSel||0xE0||Modulator wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iCarWaveSel||0xE3||Carrier wave select&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iFeedback||0xC0||Feedback/connection&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT8]]||iPercvoc||N/A||Percussion voice mode:&amp;lt;br&amp;gt;0 is melodic, 6 - bass drum, 7 - Snare, 8 - Tom-Tom, 9 - Cymbell, 10 - HiHat&lt;br /&gt;
|-&lt;br /&gt;
|[[INT8]]||transpos||N/A||Number of notes to transpose timbre, signed&lt;br /&gt;
|-&lt;br /&gt;
|[[INT8]]||dpitch||N/A||Percussion pitch: MIDI Note 0 - 127&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]][2]&lt;br /&gt;
|colspan=3|Padding to bring instrument definition up to 16 bytes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Percussive instruments ====&lt;br /&gt;
&lt;br /&gt;
Percussive instruments are indicated by &amp;lt;tt&amp;gt;iPercvoc&amp;lt;/tt&amp;gt; field. Percussive instruments are using rhythm mode of the OPL2/OPL3 chip.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
* [[SBTimbre]] - instrument editor using IBK as its primary format&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=TMB_Format&amp;diff=7114</id>
		<title>TMB Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=TMB_Format&amp;diff=7114"/>
		<updated>2017-07-23T10:48:42Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Redirected page to Apogee Sound System Timbre Format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Apogee Sound System Timbre Format]]&lt;/div&gt;</summary>
		<author><name>Wohlstand</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=AdLib_Instrument_Format&amp;diff=7113</id>
		<title>AdLib Instrument Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=AdLib_Instrument_Format&amp;diff=7113"/>
		<updated>2017-07-23T10:40:01Z</updated>

		<summary type="html">&lt;p&gt;Wohlstand: Fixed incorrectness in the specification, researched by me from SBANK utility and old INS files are came with AdLib SDK&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Instrument Infobox&lt;br /&gt;
 | Type = OPL&lt;br /&gt;
 | Count = 1&lt;br /&gt;
 | Names = No&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;AdLib Instrument Format&#039;&#039;&#039; was the original format developed by Ad Lib, Inc. in 1987 to store OPL instruments in individual files with the &amp;lt;tt&amp;gt;.ins&amp;lt;/tt&amp;gt; extension.  It went through a number of revisions as hardware capabilities were added to the OPL chip, but ultimately it was replaced by the [[AdLib Instrument Bank Format]], which combined multiple instruments into a single file with a &amp;lt;tt&amp;gt;.bnk&amp;lt;/tt&amp;gt; extension.&lt;br /&gt;
&lt;br /&gt;
For a short time before the BNK format was introduced, there was an early bank format called [[AdLib Timbre Bank Format]] which used a &amp;lt;tt&amp;gt;.snd&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;.tim&amp;lt;/tt&amp;gt; extension.  Each instrument in this bank format is stored in a structure almost identical to the structure used in the individual &amp;lt;tt&amp;gt;.ins&amp;lt;/tt&amp;gt; instrument files.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is in the following structure:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || unknown || {{TODO|Unknown purpose, always 0x0000}}&lt;br /&gt;
|-&lt;br /&gt;
| OPLREGS || oplModulator || Register values for the Modulator (0) operator&lt;br /&gt;
|-&lt;br /&gt;
| OPLREGS || oplCarrier || Register values for the Carrier (1) operator&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iModWaveSel || Modulator wave select (only bits 0-1 recognised, OPL register 0xE0)&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iCarWaveSel || Carrier wave select (only bits 0-1 recognised, OPL register 0xE0)&lt;br /&gt;
|-&lt;br /&gt;
| char[22] || unknown2 || {{TODO|Unknown purpose reserved space. Second to last byte usually always 0x01 or 0x00}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The last four fields (&amp;lt;tt&amp;gt;iModWaveSel&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iCarWaveSel&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;unknown2&amp;lt;/tt&amp;gt;) are not present in early 54-byte files in this format. Some files are also missing &amp;lt;tt&amp;gt;oplCarrier&amp;lt;/tt&amp;gt; entirely - presumably these are patches for single-operator percussive instruments. Possibly &amp;lt;tt&amp;gt;unknown2&amp;lt;/tt&amp;gt; is an instrument name, but the existing software doesn&#039;t use it and uses the base filename instead.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;OPLREGS&#039;&#039; structure is defined as:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description !! OPL base register !! Value range&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iKSL || Key scaling level || 0x40 (bits 6-7) ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iMultiple || Frequency multiplier || 0x20 (bits 0-3) || iMultiple &amp;amp; 0x0F is sent to OPL register [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iFeedback || Feedback || 0xC0 (bits 1-3) || Although only bits 1-3 are valid, Vinyl doesn&#039;t limit the output to three bits wide.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iAttack || Attack rate || 0x60 (upper four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iSustain || Sustain level || 0x80 (upper four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iEG || Envelope gain (nonzero value is on) || 0x20 (bit 5) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iDecay || Decay rate || 0x60 (lower four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iReleaseRate || Release rate || 0x80 (lower four bits) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iTotalLevel || Total output level || 0x40 (bit 0-5) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iAM || Amplitude modulation (Tremolo) || 0x20 (bit 7) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iVIB || Frequency Vibrato || 0x20 (bit 6) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iKSR || Key scaling/envelope rate || 0x20 (bit 4) || [verify this]&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || iCONoff || Connector [OP0 only] || 0xC0 (bit 0, inverted) || 0: OPL bit set to 1&amp;lt;br&amp;gt;other: OPL bit set to 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Percussive instruments ===&lt;br /&gt;
&lt;br /&gt;
There is apparently no distinction between percussive and melodic instruments.  This is controlled at playback time, depending on which channel the instrument is loaded into.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = AdLib &amp;lt;tt&amp;gt;bankmng.exe&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| canPlay = No&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Yes; [[AdLib Instrument Bank Format|.bnk]]&lt;br /&gt;
| canImport = Yes; [[AdLib Instrument Bank Format|.bnk]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Part of &#039;&#039;AdLib Programmer&#039;s Manual&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Win&lt;br /&gt;
| canPlay = No&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 = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was documented by [[User:Malvineous|Malvineous]] from reading code included with the &#039;&#039;AdLib Programmer&#039;s Manual&#039;&#039;.  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>Wohlstand</name></author>
	</entry>
</feed>