<?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=Corak</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=Corak"/>
	<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/wiki/Special:Contributions/Corak"/>
	<updated>2026-05-14T05:01:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DSIK_Module_Format&amp;diff=7108</id>
		<title>DSIK Module Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DSIK_Module_Format&amp;diff=7108"/>
		<updated>2017-06-21T20:10:11Z</updated>

		<summary type="html">&lt;p&gt;Corak: /* Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = Tracked&lt;br /&gt;
 | Instruments = PCM&lt;br /&gt;
 | NumChannels = 16&lt;br /&gt;
 | NumTracks = 1&lt;br /&gt;
 | NumPatterns = 65,535 (only 255 playable)&lt;br /&gt;
 | NumOrders = 128&lt;br /&gt;
 | Tags = Title, instrument names, instrument filenames&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Trugg}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The [[DSIK Module Format]] is the music format used by the &#039;&#039;Digital Sound Interface Kit&#039;&#039; by Carlos Hasan.  This was a C and Pascal library for game authors to simplify sound card programming.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is a &#039;&#039;&#039;non-standard&#039;&#039;&#039; [[Resource Interchange File Format (RIFF)]] structure.  It is exactly the same as a standard RIFF file, except that the padding bytes between chunks have been omitted.  So if the length of a chunk is an odd number, the padding byte should not be included and the following chunk will not start on a word boundary.&lt;br /&gt;
&lt;br /&gt;
The files are composed of the following chunks:&lt;br /&gt;
&lt;br /&gt;
* RIFF (type: DSMF)&lt;br /&gt;
** SONG&lt;br /&gt;
** INST&lt;br /&gt;
** PATT&lt;br /&gt;
&lt;br /&gt;
The data in each chunk is explained below.&lt;br /&gt;
&lt;br /&gt;
=== SONG chunk ===&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[28] || title || Song title, null-terminated&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || version || File version&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || flags ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT32LE || pad ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || numOrders || Number of valid entries in &amp;lt;tt&amp;gt;orders&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || numSamples ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || numPatterns ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || numChannels ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || volGlobal || Global volume&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || volMaster || Master volume&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || initialSpeed ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || initialBPM ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[16] || channelMap ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[128] || orders || Order list.  First value is index of first pattern to play, etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== INST chunk ===&lt;br /&gt;
&lt;br /&gt;
This chunk stores all the instruments in the song.  There are multiple &#039;&#039;&#039;INST&#039;&#039;&#039; chunks in the file, one per instrument.  The data in each chunk is 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[13] || filename || Instrument filename, null-terminated&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || flags || Zero or more of: 1=loop active, 2=signed PCM, 4=packed PCM&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || volume || Default volume of the sample if not volume is given when a note is played.  The range is from 0 (silent) to 64 (loudest), note this is 65 different values.&lt;br /&gt;
|-&lt;br /&gt;
| UINT32LE || length || Length of the sample data, in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT32LE || loopStart || Position of the loop start point, in bytes, relative to the start of the sample data.&lt;br /&gt;
|-&lt;br /&gt;
| UINT32LE || loopEnd || Position of the loop end point, in bytes, relative to the start of the sample data.&lt;br /&gt;
|-&lt;br /&gt;
| UINT32LE || address_ptr || Used internally for holding in-memory address of sample data, ignore when reading and write as zero.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || midCRate || Default is 8363&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || period || Default for middle-C is 428&lt;br /&gt;
|-&lt;br /&gt;
| char[28] || title || Sample name, null-terminated&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[length] || data || Sample data, 8-bit mono PCM&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample data must be 8-bit mono PCM, signed or unsigned based on &amp;lt;tt&amp;gt;flags&amp;lt;/tt&amp;gt; {{TODO|Confirm that signed PCM actually works}}.  Other formats are rejected by the DSIK library.  Some samples appear to be truncated .wav files and still have the &#039;data&#039; fourcc visible, however this is not part of the format and these bytes will be played as audio data, causing an audible click at the start of playback.&lt;br /&gt;
&lt;br /&gt;
The period is calculated from a sample rate (in Hertz) as &amp;lt;code&amp;gt;period = 8363 * 428 / Hertz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PATT chunk ===&lt;br /&gt;
&lt;br /&gt;
This chunk stores all the patterns in the song.  There are multiple &#039;&#039;&#039;PATT&#039;&#039;&#039; chunks in the file, one per pattern.  The data in each chunk is 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;
| UINT16LE || length || Length of pattern data, in bytes, including this length field also&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 2] || data || Pattern data, see below&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pattern data is comprised of a flag byte, followed by a variable number of data bytes depending on the value of the flag.  This is very similar to [[S3M Format]] but the bit fields are different.  The flag byte is broken down as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!width=100| 7 !!width=100| 6 !!width=100| 5 !!width=100| 4 !!width=100| 3 !!width=100| 2 !!width=100| 1 !!width=100| 0&lt;br /&gt;
|-&lt;br /&gt;
| Note present&lt;br /&gt;
| Instrument present&lt;br /&gt;
| Volume present&lt;br /&gt;
| Command present&lt;br /&gt;
|colspan=4 align=center| Channel number&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* If the entire value is zero, the row number is incremented and the next flag is read.  Otherwise:&lt;br /&gt;
* If the flag indicates a note is present, the next byte is the note.   Note numbers are semitones, with note 49 being middle C, note 50 being C#4, note 51 being D4, etc.  Adding 11 to the note number will turn them into standard MIDI note numbers.&lt;br /&gt;
* If an instrument is present, the next byte is the zero-based index of the instrument to use.&lt;br /&gt;
* If a volume is present, the next byte is the volume for this note/channel.  The range is from 0 (silent) to 64 (loudest), note this is 65 different values.&lt;br /&gt;
* If a command is present, the next two bytes are the command and value respectively.  Standard .mod commands appear to be used {{TODO|Confirm}}&lt;br /&gt;
&lt;br /&gt;
After these bytes have been read, the next flag byte is read.  Once 64 rows have been read, the end of the pattern data should have been reached.&lt;br /&gt;
&lt;br /&gt;
If the instrument is read but it is zero, then the previous instrument on that channel should be used instead (same as S3M).&lt;br /&gt;
&lt;br /&gt;
{{TODO|Commands are unknown but are presumed very similar to .mod}}  Effect 0x0F is used to set the tempo in some [[Trugg]] songs.  If the value is small it is a new &#039;&#039;speed&#039;&#039; value, if it is large then it is a new &#039;&#039;tempo&#039;&#039; value.&lt;br /&gt;
&lt;br /&gt;
=== Timing ===&lt;br /&gt;
&lt;br /&gt;
See [[S3M Format#Timing]] for a discussion on timing using the &amp;lt;tt&amp;gt;initialBPM&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;initialSpeed&amp;lt;/tt&amp;gt; values.&lt;br /&gt;
&lt;br /&gt;
=== Design issues ===&lt;br /&gt;
&lt;br /&gt;
The file format suffers from a number of design inconsistencies:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;DSMF&#039;&#039;&#039; format should have been registered with Microsoft as it is in uppercase, however this does not appear to have been done&lt;br /&gt;
* The &#039;&#039;&#039;INST&#039;&#039;&#039; and &#039;&#039;&#039;PATT&#039;&#039;&#039; chunks should have been placed inside &#039;&#039;&#039;LIST&#039;&#039;&#039; chunks, in the spirit of the RIFF format&lt;br /&gt;
* The instrument chunk includes a length field for the sample data, however this is redundant as the chunk itself already has a length.  The two length fields do make it possible to store additional data between the end of the sample data and the end of the chunk, which would normally be ignored, however it seems simpler to just define a new chunk type if new data needs to be stored without breaking backwards compatibility.&lt;br /&gt;
* The instrument chunk stores an address field even though this is only used during playback and does not need to be stored in the file.&lt;br /&gt;
* The pattern chunk also has an extra field to store the length of the pattern data.  However the value in this field includes the length of the field itself, making the value identical to the RIFF chunk&#039;s length field.  The result is that the identical value is written twice, once as a 32-bit value for the RIFF PATT chunk and then immediately again as a 16-bit value.&lt;br /&gt;
* The number of instruments and patterns is stored in the &#039;&#039;&#039;SONG&#039;&#039;&#039; chunk, however this is redundant as the values can be calculated from the number of &#039;&#039;&#039;INST&#039;&#039;&#039; and &#039;&#039;&#039;PATT&#039;&#039;&#039; chunks respectively.&lt;br /&gt;
* There is a 16-bit value for the number of orders, allowing up to 65,535 orders in the song, yet there is a fixed-length array allowing only 128 orders.&lt;br /&gt;
* The pattern count is 16-bit allowing up to 65,536 patterns in the song, but the order list is made up of 8-bit values, meaning only the first 256 patterns can be played.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Many&lt;br /&gt;
| canImport = Many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Minimal support for effects&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = Chronos Module Converter&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&lt;br /&gt;
| canImport = [[MOD Format|.mod]] .stm [[S3M Format|.s3m]] .mtm .dsm .psm&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = Most accurate for converting .dsm to .s3m&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = DSIK&#039;s &amp;lt;tt&amp;gt;conv.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 = No&lt;br /&gt;
| canImport = [[MOD Format|.mod]] .stm [[S3M Format|.s3m]] .669 .mtm&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Official tool&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = ModPlug&lt;br /&gt;
| Platform = Any&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 = Plays at wrong tempo (no support for effect 0x0F)&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = OpenMPT&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Many&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* The original Digital Sound Interface Kit library is available as &amp;lt;tt&amp;gt;dsik_c.zip&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;dsik_pas.zip&amp;lt;/tt&amp;gt; for the C and Pascal versions respectively, from various FTP sites such as [http://ftp.lanet.lv/ftp/mirror/x2ftp/msdos/programming/wgt/ lanet.lv]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was documented by [[User:Malvineous|Malvineous]] by reading the DSIK sample code, with the pattern data documented from reading the OpenMPT source code.  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;br /&gt;
&lt;br /&gt;
[[Category:DSIK]]&lt;/div&gt;</summary>
		<author><name>Corak</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DSIK_Module_Format&amp;diff=7107</id>
		<title>DSIK Module Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DSIK_Module_Format&amp;diff=7107"/>
		<updated>2017-06-21T10:37:28Z</updated>

		<summary type="html">&lt;p&gt;Corak: /* Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = Tracked&lt;br /&gt;
 | Instruments = PCM&lt;br /&gt;
 | NumChannels = 16&lt;br /&gt;
 | NumTracks = 1&lt;br /&gt;
 | NumPatterns = 65,535 (only 255 playable)&lt;br /&gt;
 | NumOrders = 128&lt;br /&gt;
 | Tags = Title, instrument names, instrument filenames&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Trugg}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The [[DSIK Module Format]] is the music format used by the &#039;&#039;Digital Sound Interface Kit&#039;&#039; by Carlos Hasan.  This was a C and Pascal library for game authors to simplify sound card programming.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file is a &#039;&#039;&#039;non-standard&#039;&#039;&#039; [[Resource Interchange File Format (RIFF)]] structure.  It is exactly the same as a standard RIFF file, except that the padding bytes between chunks have been omitted.  So if the length of a chunk is an odd number, the padding byte should not be included and the following chunk will not start on a word boundary.&lt;br /&gt;
&lt;br /&gt;
The files are composed of the following chunks:&lt;br /&gt;
&lt;br /&gt;
* RIFF (type: DSMF)&lt;br /&gt;
** SONG&lt;br /&gt;
** INST&lt;br /&gt;
** PATT&lt;br /&gt;
&lt;br /&gt;
The data in each chunk is explained below.&lt;br /&gt;
&lt;br /&gt;
=== SONG chunk ===&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[28] || title || Song title, null-terminated&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || version || File version&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || flags ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT32LE || pad ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || numOrders || Number of valid entries in &amp;lt;tt&amp;gt;orders&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || numSamples ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || numPatterns ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || numChannels ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || volGlobal || Global volume&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || volMaster || Master volume&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || initialSpeed ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || initialBPM ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[16] || channelMap ||&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[128] || orders || Order list.  First value is index of first pattern to play, etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== INST chunk ===&lt;br /&gt;
&lt;br /&gt;
This chunk stores all the instruments in the song.  There are multiple &#039;&#039;&#039;INST&#039;&#039;&#039; chunks in the file, one per instrument.  The data in each chunk is 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[13] || filename || Instrument filename, null-terminated&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || flags || Zero or more of: 1=loop active, 2=signed PCM, 4=packed PCM&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || volume || Default volume of the sample if not volume is given when a note is played.  The range is from 0 (silent) to 64 (loudest), note this is 65 different values.&lt;br /&gt;
|-&lt;br /&gt;
| UINT32LE || length || Length of the sample data, in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT32LE || loopStart || Position of the loop start point, in bytes, relative to the start of the sample data.&lt;br /&gt;
|-&lt;br /&gt;
| UINT32LE || loopEnd || Position of the loop end point, in bytes, relative to the start of the sample data.&lt;br /&gt;
|-&lt;br /&gt;
| UINT32LE || address_ptr || Used internally for holding in-memory address of sample data, ignore when reading and write as zero.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || midCRate || Default is 8363&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || period || Default for middle-C is 428&lt;br /&gt;
|-&lt;br /&gt;
| char[28] || title || Sample name, null-terminated&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[length] || data || Sample data, 8-bit mono PCM&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sample data must be 8-bit mono PCM, signed or unsigned based on &amp;lt;tt&amp;gt;flags&amp;lt;/tt&amp;gt; {{TODO|Confirm that signed PCM actually works}}.  Other formats are rejected by the DSIK library.  Some samples appear to be truncated .wav files and still have the &#039;data&#039; fourcc visible, however this is not part of the format and these bytes will be played as audio data, causing an audible click at the start of playback.&lt;br /&gt;
&lt;br /&gt;
The period is calculated from a sample rate (in Hertz) as &amp;lt;code&amp;gt;period = 8363 * 428 / Hertz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PATT chunk ===&lt;br /&gt;
&lt;br /&gt;
This chunk stores all the patterns in the song.  There are multiple &#039;&#039;&#039;PATT&#039;&#039;&#039; chunks in the file, one per pattern.  The data in each chunk is 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;
| UINT16LE || length || Length of pattern data, in bytes, including this length field also&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 2] || data || Pattern data, see below&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pattern data is comprised of a flag byte, followed by a variable number of data bytes depending on the value of the flag.  This is very similar to [[S3M Format]] but the bit fields are different.  The flag byte is broken down as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!width=100| 7 !!width=100| 6 !!width=100| 5 !!width=100| 4 !!width=100| 3 !!width=100| 2 !!width=100| 1 !!width=100| 0&lt;br /&gt;
|-&lt;br /&gt;
| Note present&lt;br /&gt;
| Instrument present&lt;br /&gt;
| Volume present&lt;br /&gt;
| Command present&lt;br /&gt;
|colspan=4 align=center| Channel number&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* If the entire value is zero, the row number is incremented and the next flag is read.  Otherwise:&lt;br /&gt;
* If the flag indicates a note is present, the next byte is the note.   Note numbers are semitones, with note 49 being middle C, note 50 being C#4, note 51 being D4, etc.  Adding 11 to the note number will turn them into standard MIDI note numbers.&lt;br /&gt;
* If an instrument is present, the next byte is the zero-based index of the instrument to use.&lt;br /&gt;
* If a volume is present, the next byte is the volume for this note/channel.  The range is from 0 (silent) to 64 (loudest), note this is 65 different values.&lt;br /&gt;
* If a command is present, the next two bytes are the command and value respectively.  Standard .mod commands appear to be used {{TODO|Confirm}}&lt;br /&gt;
&lt;br /&gt;
After these bytes have been read, the next flag byte is read.  Once 64 rows have been read, the end of the pattern data should have been reached.&lt;br /&gt;
&lt;br /&gt;
If the instrument is read but it is zero, then the previous instrument on that channel should be used instead (same as S3M).&lt;br /&gt;
&lt;br /&gt;
{{TODO|Commands are unknown but are presumed very similar to .mod}}  Effect 0x0F is used to set the tempo in some [[Trugg]] songs.  If the value is small it is a new &#039;&#039;speed&#039;&#039; value, if it is large then it is a new &#039;&#039;tempo&#039;&#039; value.&lt;br /&gt;
&lt;br /&gt;
=== Timing ===&lt;br /&gt;
&lt;br /&gt;
See [[S3M Format#Timing]] for a discussion on timing using the &amp;lt;tt&amp;gt;initialBPM&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;initialSpeed&amp;lt;/tt&amp;gt; values.&lt;br /&gt;
&lt;br /&gt;
=== Design issues ===&lt;br /&gt;
&lt;br /&gt;
The file format suffers from a number of design inconsistencies:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;DSMF&#039;&#039;&#039; format should have been registered with Microsoft as it is in uppercase, however this does not appear to have been done&lt;br /&gt;
* The &#039;&#039;&#039;INST&#039;&#039;&#039; and &#039;&#039;&#039;PATT&#039;&#039;&#039; chunks should have been placed inside &#039;&#039;&#039;LIST&#039;&#039;&#039; chunks, in the spirit of the RIFF format&lt;br /&gt;
* The instrument chunk includes a length field for the sample data, however this is redundant as the chunk itself already has a length.  The two length fields do make it possible to store additional data between the end of the sample data and the end of the chunk, which would normally be ignored, however it seems simpler to just define a new chunk type if new data needs to be stored without breaking backwards compatibility.&lt;br /&gt;
* The instrument chunk stores an address field even though this is only used during playback and does not need to be stored in the file.&lt;br /&gt;
* The pattern chunk also has an extra field to store the length of the pattern data.  However the value in this field includes the length of the field itself, making the value identical to the RIFF chunk&#039;s length field.  The result is that the identical value is written twice, once as a 32-bit value for the RIFF PATT chunk and then immediately again as a 16-bit value.&lt;br /&gt;
* The number of instruments and patterns is stored in the &#039;&#039;&#039;SONG&#039;&#039;&#039; chunk, however this is redundant as the values can be calculated from the number of &#039;&#039;&#039;INST&#039;&#039;&#039; and &#039;&#039;&#039;PATT&#039;&#039;&#039; chunks respectively.&lt;br /&gt;
* There is a 16-bit value for the number of orders, allowing up to 65,535 orders in the song, yet there is a fixed-length array allowing only 128 orders.&lt;br /&gt;
* The pattern count is 16-bit allowing up to 65,536 patterns in the song, but the order list is made up of 8-bit values, meaning only the first 256 patterns can be played.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=audio}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = Yes&lt;br /&gt;
| canModify = Yes&lt;br /&gt;
| canExport = Many&lt;br /&gt;
| canImport = Many&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Minimal support for effects&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = Chronos Module Converter&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&lt;br /&gt;
| canImport = [[MOD Format|.mod]] .stm [[S3M Format|.s3m]] .mtm .dsm .psm&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Most accurate for converting .dsm to .s3m&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = DSIK&#039;s &amp;lt;tt&amp;gt;conv.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 = No&lt;br /&gt;
| canImport = [[MOD Format|.mod]] .stm [[S3M Format|.s3m]] .669 .mtm&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = Yes&lt;br /&gt;
| notes = Official tool&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = ModPlug&lt;br /&gt;
| Platform = Any&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 = Plays at wrong tempo (no support for effect 0x0F)&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = OpenMPT&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canPlay = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canExport = Many&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* The original Digital Sound Interface Kit library is available as &amp;lt;tt&amp;gt;dsik_c.zip&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;dsik_pas.zip&amp;lt;/tt&amp;gt; for the C and Pascal versions respectively, from various FTP sites such as [http://ftp.lanet.lv/ftp/mirror/x2ftp/msdos/programming/wgt/ lanet.lv]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was documented by [[User:Malvineous|Malvineous]] by reading the DSIK sample code, with the pattern data documented from reading the OpenMPT source code.  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;br /&gt;
&lt;br /&gt;
[[Category:DSIK]]&lt;/div&gt;</summary>
		<author><name>Corak</name></author>
	</entry>
</feed>