Skip to content

Dn‐FamiTracker module file format specification (.dnm) v4.50

Persune edited this page Oct 14, 2023 · 10 revisions

Dn-FamiTracker module file (.dnm) format specification (v4.50)

About

  • This text aims to document the binary module file format as of Dn-FamiTracker v0.5.0.1.
  • Each section is declared sequentially as it appears in the file.
  • Unless specified otherwise, all data is stored in little-endian format.
  • Strings are stored in ASCII encoding unless specified otherwise.

Header

File Header

Interpreted type Size (in bytes) Corresponding object name Typical values Description Notes
char[256] Non-padded length of char[] string FILE_HEADER_ID or FILE_HEADER_ID_DN FamiTracker Module, Dn-FamiTracker Module Identifier string In Dn-FT v0.5.0.0, this was changed to Dn-FamiTracker Module for non-backwards compatibility of new features.
unsigned int (32 bits) 4 m_iFileVersion 0x00000450 Module version Version number is formatted as BCD (ex. 4.50)

Notes

  • Information is based on DocumentFile.cpp CDocumentFile::BeginDocument() and FamiTrackerDoc.cpp CFamiTrackerDoc::SaveDocument()
  • Modules saved in Dn-FamiTracker v0.5.0.0 and later may save modules with FILE_HEADER_ID_DN identifiers, to prevent older FamiTracker versions from reading non-backwards compatible data such as FILE_BLOCK_JSON and FILE_BLOCK_PARAMS_EMU.

Block header

Each block has a 24-byte header consisting of a block ID, block version, and block size.

Interpreted type Size (in bytes) Corresponding object name Typical values Description Notes
char[16] 16 m_cBlockID PARAMS Identifier string Length is zero-padded to 16 bytes
int (32 bits) 4 m_iBlockVersion 0x00000006 Block version Block version number is ANDed with 0xFFFF, but is still written as 32-bit signed integer
int (32 bits) 4 m_iBlockPointer 0x1D000000 Block size, not counting the block header

Internal blocks

Parameters block

Block ID: PARAMS

Interpreted type Size (in bytes) Repeat Corresponding object name Typical values Description Notes Block version availability
int (32 bits) 4 m_iSongSpeed 6 Song speed of track 0 1
char 1 m_iExpansionChip 0x00 Expansion audio bitmask Same format as expansion audio bitmask found in the NSF format 2+
int (32 bits) 4 m_iChannelsAvailable 5 Number of channels added Includes the 5 channels from 2A03. 1+
int (32 bits) 4 m_iMachine 0 NTSC or PAL 1+
int (32 bits) 4 m_iPlaybackRateType 0 Playback rate type, 0 = default, 1 = custom, 2 = video 7+
int (32 bits) 4 m_iPlaybackRate 16639 NSF playback rate, in microseconds 7+
int (32 bits) 4 m_iEngineSpeed 60 Engine refresh rate, in Hz 1-6
int (32 bits) 4 m_iVibratoStyle 1 0 = old style, 1 = new style 3+
int (32 bits) 4 ? 1 Hardware sweep pitch reset Partially implemented? Vanilla 0.5b stuff. Probably boolean type. 7+
int (32 bits) 4 m_vHighlight.First 4 1st row highlight 3-6
int (32 bits) 4 m_vHighlight.Second 16 2nd row highlight 3-6
int (32 bits) 4 m_iNamcoChannels 8 Number of N163 channels used Only written/read when N163 is enabled. 5+
int (32 bits) 4 m_iSpeedSplitPoint 32 Fxx speed/tempo split-point 6+
char 1 m_iDetuneSemitone 0 Semitone detuning, range from -12 to 12 Moved to Tuning block in FT 050B 2020. Also in Extra Parameters block. 8
char 1 m_iDetuneCent 0 Cent detuning, range from -100 to 100 Moved to Tuning block in FT 050B 2020. Also in Extra Parameters block. 8

Notes

  • Information is based on CFamiTrackerDoc::WriteBlock_Parameters()

Song Info block

Block ID: INFO

Interpreted type Size (in bytes) Repeat Corresponding object name Typical values Description Notes Block version availability
char[32] 32 m_strName (title) Module name Length is zero-padded to 32 bytes 1+
char[32] 32 m_strArtist (author) Module artist Length is zero-padded to 32 bytes 1+
char[32] 32 m_strCopyright (copyright) Module copyright Length is zero-padded to 32 bytes 1+

Notes

  • Information is based on CFamiTrackerDoc::WriteBlock_SongInfo()

Tuning block

Block ID: TUNING

Interpreted type Size (in bytes) Repeat Corresponding object name Typical values Description Notes Block version availability
char 1 m_iDetuneSemitone 0 Semitone detuning, range from -12 to 12 Also in Extra Parameters block. 1+
char 1 m_iDetuneCent 0 Cent detuning, range from -100 to 100 Also in Extra Parameters block. 1+

Notes

  • Information is based on CFamiTrackerDoc::WriteBlock_Tuning()
  • Added in FamiTracker 0.5.0 beta 2020

Header block

Instruments block

Sequences block

Frames block

Patterns block

DPCM Samples block

Comments block

Expansion blocks

VRC6 Sequences block

N163 Sequences block

S5B Sequences block

0CC-FamiTracker extension blocks

Extra Parameters block

Detune Tables block

Grooves block

Bookmarks block

Dn-FamiTracker extension blocks

JSON block

Emulation Parameters block

Clone this wiki locally