Difference between revisions of "HERAD"
(→Technical: Added a section about the instrument chunk and added a description to one of the unknowns in "File Structure") |
m (→Instrument Data) |
||
Line 145: | Line 145: | ||
===Instrument Data=== | ===Instrument Data=== | ||
− | The instrument chunk contains all the OPL | + | The instrument chunk contains all the OPL register values needed for each instrument, along with some macros that control various parameters of the instrument during playback. Each instrument is 0x28 bytes long. |
− | It seems that the OPL | + | It seems that the OPL register values are almost in the exact same layout as the [http://www.shikadi.net/moddingwiki/AdLib_Instrument_Bank_Format AdLib Instrument Bank Format]. Thanks to [[User:Malvineous|Malvineous]] for his documentation on the BNK file format. |
These offsets are still a work in progress and need more research. | These offsets are still a work in progress and need more research. |
Revision as of 02:23, 23 February 2016
HERAD System | |||||
Developer: | Rémi Herbulot | ||||
Header: | Custom | ||||
Content: | Notational | ||||
Instruments: | Optional | ||||
Target Output
| |||||
Released: | 1992-??-?? | ||||
First Game: | ? | ||||
Extensions |
|
Herbulot AdLib (HERAD) System was created by Rémi Herbulot, the programmer and the one of Cryo Interactive Entertainment co-directors in the 1992.
Contents
Players
- RdosPlay - DOS - only version 1 (OPL2/OPL3 music)
Converters
HERAD to ?
? to HERAD
Games
Released | Title | Sample |
---|---|---|
1992-??-?? | Dune (DOS) | |
1992-??-?? | KGB (DOS) | |
1993-??-?? | MegaRace (DOS) |
Technical
- File extensions stands for different sound devices:
- ADL, SDB - AdLib/Sound Blaster (OPL2)
- AGD - AdLib Gold (OPL3)
- M32 - Roland MT-32 (LA32)
- HSQ are compressed files with Herbulot Sequencer algorithm.
- The internal music notation is similar to MIDI, except Pitch Bend and Meta events.
- M32 files usually contain one multi-channel track, while ADL/AGD files may contain multiple tracks.
File structure
All values seems to be in little endian format. The structure identification is incomplete.
Data type | Name | Description |
---|---|---|
UINT16 | wFileSize | Size of uncompressed file (different between versions) |
UINT16[21] | wOffsets | Array of relative offsets to the MIDI tracks (if the track doesn't exists, equal to 0) |
UINT16 | wUnknown1 | |
UINT16 | wUnknown2 | |
UINT16 | wUnknown3 | |
UINT16 | wUnknown4 | Deals with the song speed (it is not Tempo/BPM, possibly ticks) |
UINT8[32] | bUnknown5 | Array of bytes (unknown) seems to be only in AGD files |
DATA[] | data | MIDI tracks (each track ends with 0xFF) |
DATA[] | instruments | AdLib/Soundblaster instruments (doesn't present in M32) not inspected yet |
Version Compatibility
The format has two versions at least, which have major differences. However it doesn't have such an identificator, so each music file needs to be inspected to detect the proper format version.
The first version was used in Dune (DOS) and KGB (DOS), and the second version was used in MegaRace (DOS).
For the 1st version wFileSize value represents total file size, for the 2nd version it represents file size without instruments data block. Also there are differences in MIDI notation, which described below.
MIDI notation
- The most of status bytes are compatible with MIDI standard.
- It's unknown whether running status mode is supported, since the most music files doesn't use it.
MIDI message | Description | MIDI compatible |
---|---|---|
8# xx xx | Note Off (version 1) | Yes |
8# xx | Note Off (version 2) | No |
9# xx xx | Note On | Yes |
A# ?? ?? | Poly Aftertouch (unused) | Unknown |
B# ?? ?? | Control Change (unused) | Unknown |
C# xx | Program Change (uses internal instruments for AGD and SDB) | Yes |
D# xx | Channel Aftertouch | Yes |
E# xx | Pitch Bend | No |
FF | Track End |
Instrument Data
The instrument chunk contains all the OPL register values needed for each instrument, along with some macros that control various parameters of the instrument during playback. Each instrument is 0x28 bytes long.
It seems that the OPL register values are almost in the exact same layout as the AdLib Instrument Bank Format. Thanks to Malvineous for his documentation on the BNK file format.
These offsets are still a work in progress and need more research.
Offset | Size | Name | Description | OPL base register | Value range |
---|---|---|---|---|---|
0x0 | 1 | |
|||
0x1 | 1 | |
|||
0x2 | 1 | ksl | |
0x40 (bits 6-7) | |
0x3 | 1 | multiple | |
0x20 (bits 0-3) | |
0x4 | 1 | feedback | |
0xC0 (bits 1-3) | |
0x5 | 1 | attack | |
0x60 (upper four bits) | |
0x6 | 1 | sustain | |
0x80 (upper four bits) | |
0x7 | 1 | eg | |
0x20 (bit 5) | nonzero value is on |
0x8 | 1 | decay | |
0x60 (lower four bits) | |
0x9 | 1 | releaseRate | |
0x80 (lower four bits) | |
0xA | 1 | totalLevel | |
0x40 (bit 0-5) | uses all bits; output level can still be modified by output level byte 0x1E |
0xB | 1 | am | 0x20 (bit 7) | ||
0xC | 1 | vib | 0x20 (bit 6) | ||
0xD | 1 | ksr | |
0x20 (bit 4) | |
0xE | 1 | con | |
0xC0 (bit 0, inverted) | 0: OPL bit set to 1 other: OPL bit set to 0 |
0xF | 1 | ksl | |
0x40 (bits 6-7) | |
0x10 | 1 | multiple | |
0x20 (bits 0-3) | |
0x11 | 1 | feedback | |
0xC0 (bits 1-3) | This byte seems to have garbage data in it and is not used |
0x12 | 1 | attack | |
0x60 (upper four bits) | |
0x13 | 1 | sustain | |
0x80 (upper four bits) | |
0x14 | 1 | eg | |
0x20 (bit 5) | nonzero value is on |
0x15 | 1 | decay | |
0x60 (lower four bits) | |
0x16 | 1 | releaseRate | |
0x80 (lower four bits) | |
0x17 | 1 | totalLevel | |
0x40 (bit 0-5) | uses all bits; output level can still be modified by output level byte 0x1E |
0x18 | 1 | am | 0x20 (bit 7) | ||
0x19 | 1 | vib | 0x20 (bit 6) | ||
0x1A | 1 | ksr | |
0x20 (bit 4) | |
0x1B | 1 | con | |
0xC0 (bit 0, inverted) | So far, this seems to be always set at zero. |
0x1E | 1 | Seems to follow the note velocity (0 = loudest, F = softest) | |||
0x1F | 1 | |
Seems to follow the note velocity (0 = loudest, F = softest) | ||
0x20 | 1 | |
Seems to increases Feedback depending on note velocity | ||
0x21 | 1 | |
Increases pitch bend range (seems like it's a flag: Fine tune = 0, Coarse tune = 1) | ||
0x22 | 1 | |
Normally set at 0x0, 0xC = an octave higher | ||
0x23 | 1 | Has to deal with pitch bend | |||
0x24 | 1 | |
Has to deal with pitch bend | ||
0x25 | 1 | | |||
0x26 | 1 | | |||
0x27 | 1 | |
Links
- File:MegaRace - DOS - Credits.png - HERAD system is mentioned in the credits of MegaRace (DOS).
- mobygames.com/developer/sheet/view/developerId,1760/ - HERAD System mentioned on MobyGames.
- sourceforge.net/p/adplug/feature-requests/18/ - Format support request on AdPlug repository.