charsongname[26];// Song Name, null-terminated (but may also contain nulls)
uint8lehighlight_minor;// Rows per Beat highlight
uint8lehighlight_major;// Rows per Measure highlight
uint16leordnum;// Number of Orders
uint16leinsnum;// Number of Instruments
uint16lesmpnum;// Number of Samples
uint16lepatnum;// Number of Patterns
uint16lecwtv;// "Made With" Tracker
uint16lecmwt;// "Compatible With" Tracker
uint16leflags;// Header Flags
uint16lespecial;// Special Flags, for embedding extra information
uint8leglobalvol;// Global Volume (0...128)
uint8lemv;// Master Volume (0...128), referred to as Sample Volume in OpenMPT
uint8lespeed;// Initial Speed (1...255)
uint8letempo;// Initial Tempo (31...255)
uint8lesep;// Pan Separation (0...128)
uint8lepwd;// Pitch Wheel Depth
uint16lemsglength;// Length of Song Message
uint32lemsgoffset;// Offset of Song Message in File (IT crops message after first null)
uint32lereserved;// Some IT versions save an edit timer here. ChibiTracker writes "CHBI" here. OpenMPT and Schism Tracker save extended version information here.
uint8lechnpan[64];// Initial Channel Panning
uint8lechnvol[64];// Initial Channel Volume
};
MPT_BINARY_STRUCT(ITFileHeader,192)
structITEnvelope
{
// Envelope Flags
enumITEnvelopeFlags
{
envEnabled=0x01,
envLoop=0x02,
envSustain=0x04,
envCarry=0x08,
envFilter=0x80,
};
structNode
{
int8levalue;
uint16letick;
};
uint8flags;// Envelope Flags
uint8num;// Number of Envelope Nodes
uint8lpb;// Loop Start
uint8lpe;// Loop End
uint8slb;// Sustain Start
uint8sle;// Sustain End
Nodedata[25];// Envelope Node Positions / Values
uint8reserved;// Reserved
// Convert OpenMPT's internal envelope format to an IT/MPTM envelope.
// Convert an ITOldInstrument to OpenMPT's internal instrument representation.
voidConvertToMPT(ModInstrument&mptIns)const;
};
MPT_BINARY_STRUCT(ITOldInstrument,554)
// Impulse Instrument Format
structITInstrument
{
enumITInstrumentFlags
{
ignorePanning=0x80,
enableCutoff=0x80,
enableResonance=0x80,
};
charid[4];// Magic Bytes (IMPI)
charfilename[13];// DOS Filename, null-terminated
uint8lenna;// New Note Action
uint8ledct;// Duplicate Note Check Type
uint8ledca;// Duplicate Note Check Action
uint16lefadeout;// Instrument Fadeout (0...256, although values up to 1024 would be sensible. Up to IT2.07, the limit was 0...128)
int8lepps;// Pitch/Pan Separatation
uint8leppc;// Pitch/Pan Centre
uint8legbv;// Global Volume
uint8ledfp;// Panning
uint8lerv;// Vol Swing
uint8lerp;// Pan Swing
uint16letrkvers;// Tracker ID
uint8lenos;// Number of embedded samples
charreserved1;// Reserved
charname[26];// Instrument Name, null-terminated (but may also contain nulls)
uint8leifc;// Filter Cutoff
uint8leifr;// Filter Resonance
uint8lemch;// MIDI Channel
uint8lempr;// MIDI Program
uint8lembank[2];// MIDI Bank
uint8lekeyboard[240];// Sample / Transpose map
ITEnvelopevolenv;// Volume Envelope
ITEnvelopepanenv;// Pan Envelope
ITEnvelopepitchenv;// Pitch / Filter Envelope
chardummy[4];// IT saves some additional padding bytes to match the size of the old instrument format for simplified loading. We use them for some hacks.
// Convert OpenMPT's internal instrument representation to an ITInstrument. Returns amount of bytes that need to be written.
uint16lefatdate;// DOS / FAT date when the file was opened / created in the editor. For details, read https://docs.microsoft.com/de-de/arch/win32/api/winbase/nf-winbase-dosdatetimetofiletime