Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Support for HERAD Music System (HSQ, SDB, AGD) #39
Recently, binarymaster and myself were able to reverse engineer HERAD, which is the music format that is used in Dune, KGB and MegaRace. You can read the documentation here.
The music notation is heavily based off of MIDI but does have some differences: for example, Pitch Bend events only have the MSB byte with the LSB byte being truncated. Note Off events are normal in Dune and KGB, but in MegaRace, they have been truncated as well, as the velocity byte is missing. Which leads me to our next problem.
Due to the fact that MegaRace uses a newer version of HERAD, there will need to be some sort of way for AdPlug to determine if the music file being loaded is a version 1 or version 2 song, since there is no value in the header to denote which version the song file is. I suggest analyzing the MIDI data to determine the file type.
As for instruments, the layout of the OPL register values is very similar to Ad Lib Inc.'s INS/BNK format, however, Cryo also implemented "macros" that control various OPL registers with MIDI commands, for example, HERAD can use either Note On Velocity or Aftertouch to control either the modulator output level, carrier output level or feedback. There's also macros for automated pitch bends, which are very useful for drums.
Dune's AdLib Gold files are very similar to their OPL2/Sound Blaster counterparts. The only difference is additional channels beyond OPL2's standard 9 channels and additional bytes in the header for the AdLib Gold surround module, which can be simply ignored.
I've also attached the uncompressed drivers (drivers.zip) for Dune and MegaRace, so hopefully that will help with any unanswered questions that may come up.
I look forward to your response. I hope that with this information, AdPlug can finally have HERAD support. Thanks in advance!
Useful hints for those who will code a player for this format:
Here's format reader implemented by me for MIDIPLEX: