Descent 1 and 2 use BNK files for Adlib/FM sound cards. They specify how the MIDI instruments shall be mapped to the FM "instruments".
This document was written by Stephane "Dada" Lajoie with thanks to SPONGEmop for the heads-up.
As for the BNK format, here it is:
BYTE version_minor;
BYTE version_major;
CHAR sig[6]; //"ADLIB-"
WORD num_records_total;
WORD num_records_used;
DWORD offset_namesection;
DWORD offset_datasection;
CHAR zero[8]; //8x$00
//A name section record is defined as follows:
WORD index_into_datasection;
BYTE used; //0 if used, 1 otherwise
CHAR instrument_name[9]; //zero-terminated
//A data section is defined as follows:
BYTE instrument_type; //0=melodic, 1=percussive instrument
BYTE voice_number; //for percussive instruments
operator operator_0_parameters;
operator operator_1_parameters;
BYTE operator_0_waveform;
BYTE operator_1_waveform;
//Definition of operator:
struct
{
BYTE key_scale_level;
BYTE frequency_multiplier;
BYTE feed_back;
BYTE attack_rate;
BYTE sustain_level;
BYTE sustaining_sound;
BYTE decay_rate;
BYTE output_level;
BYTE amplitude_vibrato;
BYTE frequency_vibrato;
BYTE envelope_scaling;
BYTE type; //0=FM sound, 1=Additive sound (for operator 0 only, unused in operator 1)
}
|
Total size: sizeof(Header) + Header.RecTotal * (sizeof(name) + sizeof(data))
Name section is sorted alphabetically, with unused records at the end. Practical order is: Header, Name section, Data section.