Jump to content

Photo

How do you extract sound effect data from classic games?


6 replies to this topic

#1 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 24,838 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Mar 30, 2011 10:49 AM

I'm a batari Basic user, but that really doesn't matter that much for this question. When I can't create a sound I need on my own, it would be nice to extract sound effect data that almost meets my requirements from a classic game and play with it until it sounds the way I want. Some sound effects can be recreated by ear, but other sound effects are hard for me to figure out.

So is it possible to extract sound effect data from classic games? If so, how? (I know very little about assembly language.)

#2 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 21,018 posts
  • Location:The land of Gorch

Posted Wed Mar 30, 2011 11:18 AM

Pretty much the only way is via disassembly and/or tracing to see how the values for sound registers are gathered (when a source code does not exist). Sometimes this is very easy (if values are gathered from lookup tables), sometimes more difficult (if values are generated by using a formula)...or very difficult (if said formula utilizes specific bitpatterns in certian memory locations).

That is if you want the sounds to be 100% true to the original. Of course, you could always play it by ear.

#3 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 21,018 posts
  • Location:The land of Gorch

Posted Wed Mar 30, 2011 11:49 AM

I should mention that if a source code does exist and the platforms are similar, it's almost no effort at all. The music tables for Ms.Hack were imported straight from Atari's 7800 version of Ms.Pac-Man.

#4 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,838 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Mar 30, 2011 12:21 PM

Thanks for the replies. I created this thread, then took a shower and a faint memory surfaced while I was in there that I could use Stella's debug mode. I can do something in a game to start the sound I want, bring up debug mode, then step through frame by fame and write down the numbers. Did I mention that I'm not too bright? :D

#5 RevEng ONLINE  

RevEng

    River Patroller

  • 3,308 posts
  • bit player
  • Location:Canada

Posted Wed Mar 30, 2011 12:35 PM

I was posting this, and I see now in the preview window that you figured it out... oh well. Since it's already written I figured I'd still post it for others.

For most sounds the method I post will be good enough, though if the game changes the sound registers faster than each frame then your copy of the sound won't be accurate.

  • Open up the rom in stella. Get close to the point where the sound will trigger and enter the debugger by pressing the ~ key. Choose the AUDIO tab and hit the FRAME +1 button until you see the volume registers change.

    RipDragonSound.png

  • record the sound registers and press the FRAME+1 button. Repeat until the volume registers are zero again or the sound is otherwise done.
  • put all of your data into your game as data statements for bB or BYTE data for asm. (See the bB example program.) In my sample I used the dragon roar in Adventure, which only changes the audio registers every 3 frames.

Attached File  rippedsound.bas   1.19KB   82 downloads
Attached File  rippedsound.bas.bin   4KB   72 downloads

#6 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 21,018 posts
  • Location:The land of Gorch

Posted Wed Mar 30, 2011 12:38 PM

Also, the upper 3 bits of frequency (AUDFx) and upper 4 bits of volume (AUDVx) and distortion (AUDCx) make no difference to the hardware...so those can be shared with other data. PF0 data is a good candidate, since it ignores the lower nybble. Once you know the values, you can either reuse the formula that the original game uses...or just make frame-by-frame lookup tables.

#7 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,838 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Mar 30, 2011 12:53 PM

I was posting this, and I see now in the preview window that you figured it out... oh well. Since it's already written I figured I'd still post it for others.

Like you said, it's good to have it posted for others. And if I forget how to do it in the future, I can look back at this thread and refresh my memory.

While you were in the middle of creating your post, I wrote down the numbers for a classic game sound effect, put it in the VbB Music and Sound Editor and it sounds exactly like it does in the game!




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users