MagicEngine
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Japanese English 

HES file format

 
Post new topic   Reply to topic    MagicEngine Forum Index -> General
View previous topic :: View next topic  
Author Message
diehlr
Visitor
Visitor


Joined: 02 Dec 2002
Posts: 4

PostPosted: Thu Mar 20, 2003 11:30 pm    Post subject: HES file format Reply with quote

Does anyone have any documentation on the HES music file format? I understand it's pretty much raw ASM and sample data from the game ROM, extracted from the rest of the game code. However, I can't find any information about the file format itself or how to go about extracting the PSG data from the rest of a game (are there any debuggers that would be useful in this area?). I read Paul Clifford's documentation on the PSG and it pretty much makes sense. I assumed with the large amount of .PCE and .HES sound files available on the Internet, that info on sound ripping would be a little more widespread, but I can't find anything. Any help is appreciated.
Back to top
View user's profile Send private message
cgfm2
Visitor
Visitor


Joined: 23 Jul 2002
Posts: 9

PostPosted: Sun Jun 22, 2003 7:19 pm    Post subject: Reply with quote

The file format specification is included with the two 'official' HES packages. Here's an online version:

http://www.proc.org.tohoku.ac.jp/befis/download/nezplug/hesspec.txt

All HES files have a player appended to the last 256 bytes of bank 0. The player is just there so you can run the HES file like a regular ROM image and listen to the music in an emulator, etc. The components of a HES file include some assembly bits the ripper wrote to interface the concept of song request numbers with whatever the game's sound engine uses internally.

The only tips I can give for ripping music is that commonly a game will have the sound driver and data in a seperate bank, and during VBlank or in the timer interrupt, it will swap in the bank in question and jump to a subroutine in it. Tracing the timer and IRQ1 interrupt handlers would probably lead you to that part.

Most games write to the PSG to initialize it during startup, but usually the only other PSG access after that is from the sound driver, so that's the stuff you'd want to rip.

IMO the HES format isn't good to use as HES rips do not work on a real PC-Engine, because they do not save any information about the video chip state which regulates when and how often an IRQ1 interrupt occurs. I think all HES rips work fine in emulators like Magic Engine and Hu-Go, so I'd advise using them for testing your rips, rather than using a real PC-Engine/TurboGrafx-16 if you have the option to do so. I guess if there was enough interest it would be worth it to devise a new or modified version of the HES format, but I doubt that would happen.
Back to top
View user's profile Send private message Visit poster's website
Kaminari
Elder
Elder


Joined: 19 Apr 2002
Posts: 1432
Location: Paris, France

PostPosted: Sun Jun 22, 2003 10:48 pm    Post subject: Reply with quote

cgfm2 wrote:
I guess if there was enough interest it would be worth it to devise a new or modified version of the HES format, but I doubt that would happen.


Hi Charles,

I don't have the technical knowledge to help you, but I'm definitely interested in a new or revised rip format. From a listener point of view, the HES lacks many things: most notably an efficient built-in header (to get rid of the M3U playlist) and a configurable audio volume (especially for the noise channel).

Another frustration is that many HuCards have been ripped in HES, but as of today no PSG music bank has been extracted from CD games (except for Xanadu which was publically released by Takashi Mamiya a year ago).

I know that David is interested as well in such a chiptune format. I don't know if the next version of Magic Engine will sport a ripping feature of some sort (that would be great), but perhaps the two of you could work in a joint effort on a common definition and eventually on some tools to ease the ripping process for the mere mortal.

We have a great system with great games and great PSG tunes. It would be a shame if we couldn't benefit from a custom rip format that would be clean, well designed, easy to use and expandable. Be it based on HES or created from scratch...

Am I the only one to enjoy listening to PC Engine chiptunes?
Back to top
View user's profile Send private message Visit poster's website
cgfm2
Visitor
Visitor


Joined: 23 Jul 2002
Posts: 9

PostPosted: Sun Jun 22, 2003 11:39 pm    Post subject: Reply with quote

Quote:
the HES lacks many things: most notably an efficient built-in header (to get rid of the M3U playlist) and a configurable audio volume (especially for the noise channel).


I haven't tried using Winamp to listen to HES files, what is the purpose of the M3U playlist? Does this have to do with having all of the songs within a single file?

As for the audio controls, I think if an emulator has the noise channels emulated correctly then there shouldn't be a need for it on a per-game basis. Or, at the very least a Winamp plugin could have audio controls in the configuration dialog and perhaps save audio settings for games in a user-editable file. I can see that you'd want to have some channels disabled to remove unwanted sound effects like a car engine noise that may always be on, and overlap with the regular game music.

Quote:
Another frustration is that many HuCards have been ripped in HES, but as of today no PSG music bank has been extracted from CD games (except for Xanadu which was publically released by Takashi Mamiya a year ago).


I think this is too bad as well, but the only real solution is to have a PC-Engine emulator with good debugging facilities and CD game support. The ripping process would be difficult to automate, which means the only people who could get music out of CD games would need to have the right tools and know a lot about the PC-Engine to begin with.

Quote:
I know that David is interested as well in such a chiptune format. I don't know if the next version of Magic Engine will sport a ripping feature of some sort (that would be great), but perhaps the two of you could work in a joint effort on a common definition and eventually on some tools to ease the ripping process for the mere mortal.


I can guess that David and myself are probably too busy to do that. :)

It might be interesting to propose a draft of a new type of file format, and maybe make some test rips to go with it. If I have the time to do so, I may try this and post my findings here, and see what other people think (concerning changes, better ideas, etc.)

The only real improvements I can think of over HES would be:

- Add ADPCM support to the specification. (this needs to be documented, however, which I'll do some day)
- Include the VDC/VCE state. Technically the 2nd VDC of the SuperGrafx should be included, but I really doubt any of it's games use the 2nd VDC interrupts for timing music.
- In addition to the 'request' subroutine, have an 'init' subroutine which sets up the hardware.

I suppose a bitmask for enabling/disabling channels and volume controls for the PSG and noise channels could be added as well.
Back to top
View user's profile Send private message Visit poster's website
Kaminari
Elder
Elder


Joined: 19 Apr 2002
Posts: 1432
Location: Paris, France

PostPosted: Mon Jun 23, 2003 3:12 pm    Post subject: Reply with quote

cgfm2 wrote:
I haven't tried using Winamp to listen to HES files, what is the purpose of the M3U playlist? Does this have to do with having all of the songs within a single file?


Yup. The M3U playlist also allows to specify very useful informations like track titles, durations, loops... Have a look at this one for an example. More rips are available at my website (RX-Files section).

Quote:
I can see that you'd want to have some channels disabled to remove unwanted sound effects like a car engine noise that may always be on, and overlap with the regular game music.


Mmm, that's not really what I had in mind. I was more thinking about something along the lines of your last suggestion:

Quote:
I suppose a bitmask for enabling/disabling channels and volume controls for the PSG and noise channels could be added as well.


This is really needed. The main problem of all current emulators and HES players is that the general volume of the noise channel is way too high (almost twofold) compared to the real console. Some good examples are Aero Blasters and Xanadu.

In many PCE games, the noise channel is often (over)used for drums and hi-hats. On a real system, it sounds soft and slightly below the general volume of the music. Under emulation, it always sounds too agressive and above the general volume. Not good! I think the noise channel should be configurable as a master volume control (many plugins like NSFplug, MSXplug, in_VGM, S98amp, in_FMPMD allow that).

Quote:
I think this is too bad as well, but the only real solution is to have a PC-Engine emulator with good debugging facilities and CD game support. The ripping process would be difficult to automate, which means the only people who could get music out of CD games would need to have the right tools and know a lot about the PC-Engine to begin with.


I was afraid it wouldn't be that easy.

Anyway, we're not forced to stay focused on only one format. I know that logging formats are less popular than ripping formats, but they at least allow anyone with some time and a good will to make some decent work. So...

What about considering the VGM format by Omar Cornut? It could be an interesting interim solution - and accessible to anyone if implemented in an emulator (shameless plug). It's already supported by Meka and Kega Lazarus. It's *not* a format aimed at Sega hardware; it's an open format which according to its author can easily be expanded to other hardwares. At least it's worth a look - but I'm sure you already know about it :-)

Quote:
It might be interesting to propose a draft of a new type of file format, and maybe make some test rips to go with it. If I have the time to do so, I may try this and post my findings here, and see what other people think (concerning changes, better ideas, etc.)


You're definitely welcome.
Back to top
View user's profile Send private message Visit poster's website
cgfm2
Visitor
Visitor


Joined: 23 Jul 2002
Posts: 9

PostPosted: Mon Jun 23, 2003 5:53 pm    Post subject: Reply with quote

Quote:
Yup. The M3U playlist also allows to specify very useful informations like track titles, durations, loops... Have a look at this one for an example. More rips are available at my website (RX-Files section).


This looks interesting, I can see why it would be nice to have that kind of feature integrated into the file itself. I'm doing a similar thing with a new type of ripped music format for the Sega Mega Drive, which includes a list of request codes and corresponding track numbers within the file.

Nice to see somebody ripped the Jackie Chan soundtrack, that game has excellent music. :)

Quote:
This is really needed. The main problem of all current emulators and HES players is that the general volume of the noise channel is way too high (almost twofold) compared to the real console. Some good examples are Aero Blasters and Xanadu.


I had been working on a HES Winamp plugin a while back using my PCE sound chip emulator, I wonder if it would be worth releasing, even in beta form, just to see if people like the way it sounds compared to existing plugins. I did a lot of tests on my TurboGrafx-16 to get the volume levels right, for the noise channel as well. IMO, it's fairly accurate.

Quote:
above the general volume. Not good! I think the noise channel should be configurable as a master volume control (many plugins like NSFplug, MSXplug, in_VGM, S98amp, in_FMPMD allow that).


I agree, this is a good way to handle it. I suppose there should be a volume control for ADPCM sound as well as the noise and PSG volume levels.

Quote:
What about considering the VGM format by Omar Cornut?


I would have to say this wouldn't work, because many games play DDA samples in one or two channels and this would greatly increase the size of the log file. This is the exact same problem people are having with GYM logs of Genesis music, hence my move to go to a HES-like format with a ripped sound driver and data.

VGM would work for games that don't use DDA samples, but many do. It seems that most games either use the noise channels to simulate drums, like you said, or they use DDA mode to play drum samples.

VGM works great for the SMS, because it's CPU is too slow to do samples and music at the same time. So there's never an issue of repeated sample data being written into the log file over and over as music plays.

I think VGM support could be done easily in an emulator so people could rip music as they see fit, but there would be an issue of having logs that approached several megabytes in size, if DDA samples were used a lot.
Back to top
View user's profile Send private message Visit poster's website
Kaminari
Elder
Elder


Joined: 19 Apr 2002
Posts: 1432
Location: Paris, France

PostPosted: Mon Jun 23, 2003 11:25 pm    Post subject: Reply with quote

cgfm2 wrote:
Nice to see somebody ripped the Jackie Chan soundtrack, that game has excellent music. :)


Looking for Jackie Chan was my main motivation when I got interested in HES files ^^

I have to thank Nam who did the ripping job on my request many months ago. Sadly he seems to have vanished from the net around last year. He used to appear regularly on Ancient Sound Vanished (before the site turned into a NSF-only community), but noone has heard from him since a long time now. He was responsible for most of the HES rips available today.

Quote:
I had been working on a HES Winamp plugin a while back using my PCE sound chip emulator, I wonder if it would be worth releasing, even in beta form, just to see if people like the way it sounds compared to existing plugins. I did a lot of tests on my TurboGrafx-16 to get the volume levels right, for the noise channel as well. IMO, it's fairly accurate.


I would give it a try with a tremendous pleasure :-)

Quote:
I think VGM support could be done easily in an emulator so people could rip music as they see fit, but there would be an issue of having logs that approached several megabytes in size, if DDA samples were used a lot.


That makes sense. I tried to log some tunes with Kega (from Snatcher, what else!) and I have to say it works great. The only problem is that the VGM format doesn't support PCM logging yet and, as you predicted, the files are already quite big even without the samples. But it's definitely better and more stable than GYM.

I'll wait for your new Megadrive sound format with a keen interest!
Back to top
View user's profile Send private message Visit poster's website
Iceberg
Visitor
Visitor


Joined: 21 Dec 2006
Posts: 6

PostPosted: Tue Oct 14, 2008 11:55 pm    Post subject: Reply with quote

Question from someone who's a bit on the technologically challenged side - is there any way to convert .hes files to .mp3?
Back to top
View user's profile Send private message
ccovell
Regular
Regular


Joined: 19 Dec 2005
Posts: 100
Location: Japan

PostPosted: Wed Oct 15, 2008 4:40 pm    Post subject: Reply with quote

In Windows: Load up WinAmp, change output plugin (in preferences) to Nullsoft Disk Writer plugin. Configure. Play.

When all songs have been played, convert the resulting WAVs to MP3 using your favourite conversion program.
_________________
http://www.chrismcovell.com
Back to top
View user's profile Send private message Visit poster's website
Iceberg
Visitor
Visitor


Joined: 21 Dec 2006
Posts: 6

PostPosted: Fri Oct 17, 2008 12:18 am    Post subject: Reply with quote

ccovell wrote:
In Windows: Load up WinAmp, change output plugin (in preferences) to Nullsoft Disk Writer plugin. Configure. Play.

When all songs have been played, convert the resulting WAVs to MP3 using your favourite conversion program.


Thanks! That worked great!
Back to top
View user's profile Send private message
TOUKO
Visitor
Visitor


Joined: 15 May 2009
Posts: 8

PostPosted: Fri May 15, 2009 12:04 pm    Post subject: Reply with quote

HI all, i'am new on this forum ..

I'm trying to make soud fx for my game remix of galaxian.

I have found a sfx generator called sfxr.
This program allow to save your sfx in text file .sfx.
My problems are to produce this txt file in sound.

I'am putting here sfxr.exe and file, if good soul want to help me Confused

Thank's !!

http://www.partage-facile.com/DJ9MJG7TF7/sfx.7z
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    MagicEngine Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group