• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

A Guide to Relocating DSPs and Expanding SSMs

Cjag

Smash Cadet
Joined
Jan 11, 2017
Messages
53
Location
Puerto Rico
For the longest time, sound hacking in Melee has been very limited due to size limitations and a lack of documentation on how SSM and DSP files are structured. I decided to look into SSM's file structure and figured out a way to relocate DSPs and expand the SSM file for more custom sounds, removing one of the biggest crutches with sound modding. With this guide, you will be able to replace already existing sound effects with longer ones, and with much better sound quality!

Also, keep in mind that this process has only been done with mono files. I haven't done stereo yet.

Required Tools
  • DAT Texture Wizard (To extract and import SSMs)
  • Audacity (DSPADPCM Branch) (I used 2.1.3, but 2.3.0 should work the same)
  • ssmex.exe
  • cmd.exe (Command Prompt)
  • A Hex Editor (I will be using HxD for this guide)
  • A Calculator with Programmer Mode (Windows 10's calculator works)
  • SSBM ISO (duh)
Preparing a Folder

After downloading ssmex.exe, extract the files that are inside into a folder that will be used for extracting the DSPs from SSMs. You will also have to copy/paste cmd.exe in there since ssmex.exe is used through command prompt. These three files should be inside your new folder.
  • ssmex.exe
  • cmd.exe
  • ssmex.c
Once you do, we can continue with the first step on extracting SSMs from a Melee ISO.

Extracting SSMs from a Melee ISO
  1. Open DAT Texture Wizard
  2. Open your Melee ISO
  3. Expand the "Audio" tab and scroll down until you find the "us" folder.
    • This is where Melee's English SSMs are stored. If you want to edit Melee's Japanese SSMs, you don't have to follow this step.
  4. Select an SSM of your choice and save it within the folder where ssmex.exe is located.
Extracting DSPs from SSM files

SSM files contain DSPs, which are the sound clips that Melee uses. You can think of this like a .zip that contains .wav files. What we have to do is extract them using ssmex.exe through the command prompt.
  1. Open cmd.exe and run ssmex.exe.
    • To have ssmex.exe extract an SSM file, it uses the following syntax:
    • ssmex.exe filename.ssm
    • It will automatically extract all the DSPs from the SSM.
  2. Close cmd.exe
Identifying and Converting Sound Clips into DSPs with Audacity (DSPADPCM)

This section will focus on converting a sound clip into a DSP with the help of Audacity DSPADPCM. This branch of Audacity makes the DSP creation process significantly easier than the old way, so I highly recommend it!
  1. Place your new sound clip into Audacity.
  2. Place the DSP you would like to replace into Audacity.
  3. Identify their lengths and sample rate
    • In a previous guide by GodFed, it said that the sound clip you want to inject has to be the same sample rate and the same length because of the available space the original DSP has. But in this tutorial, we will be relocating the DSP for clips with longer lengths and better quality.
  4. Verify the "Project Rate" matches your new sound clip's sample rate.
    • On the bottom-left corner, you will find something called "Project Rate (Hz)". That's the sample rate that our new sound clip will be exported as. Make sure it matches with your new sound clip and not the original's since Melee's sound clip are of a lower sample rate/sound quality. This tend to change depending on what you imported into Audacity first, so always check it.
  5. Save your new sound clip as a .dsp.
    • To do this, go to File > Export Audio (Or File > Export > Export Audio in Audacity DSPADPCM 2.3.0)
    • Save this anywhere you'd like, as long as it's easily accessible. You could put this in the same folder where the exported DSPs are located, just make sure you don't confuse it with the rest.
Copying a new DSP into new SSM space

This section will delve into SSM and DSP files, identify offsets, and modify them to play our new DSP in Melee.
  1. Open your NEW DSP, the DSP you are going to replace, and the SSM file with a Hex Editor. (I will be using HxD for this)
  2. In the SSM file, look at offsets @0x00 and @0x04.
    • @0x00 is the location of the first DSP (without heading).
    • @0x04 is the end of the SSM file, or its size. However, it doesn't show that exact offset. To find the exact offset/size, it uses this formula:
      • Value @0x04 + Value @0x00 + 0x20 (Heading) = End of File Offset (Where 00s are located if it is a vanilla SSM)
      • Image Reference: 0x00 is marked by a green rectangle, while 0x04 is marked by an orange rectangle.
  3. Go to the end of the SSM file and paste your NEW DSP's sound bytes.
    • Keep in mind that all DSP's sound bytes start @0x60 of that file. You will copy everything from that offset until the end of the file.
    • Make sure you do NOT overwrite the 00s in the SSM since this guide takes that into account. Also, it marks the start of your new DSP clearly.
    • You could also add 00s after pasting your DSP to mark where it ends and make the next step easier.
      • Example: Our new DSP ends @0x5FC35, so I add 00s until I reach @0x5FC3F. This makes the SSM's size 0x5FC40.
      • Image Reference:
  4. Update the value @0x04 of the SSM file.
    • Using the example above, the end of the SSM file is 0x5FC40. You will subtract that with the value at 0x00, the starting location of the DSPs + heading (which is 0x20).
    • Here's a formula to help you out:
      • "NES SSM File Size" - (Value @0x00 + Heading) = NEW Value @0x04
      • In our Example, the result is 5ED80.
Finding and Replacing Sound Pointers

We are almost done with importing our new DSP, all we have to do is adjust the Sample Rate and "Sound Pointers" so Melee can read the Sound Bytes correctly.
  1. Search and replace the old DSP's coefficients with the new one's.
    • On the DSP you are going to replace, copy the data from offsets 0x1C to 0x3c onto the clipboard. These are "Coefficients" used for decoding the sound bytes. Without this, our new sound will not play correctly.
      • Image Reference: Coefficients Location in the DSP
    • On the SSM, use the search function to find those coefficients. Once you have found them, copy the coefficients from your NEW DSP and paste it into that location.
      • Image Reference: Replacing old DSP coefficients with new DSP coefficients in the SSM.
  2. Edit the Sample Rate Offset (You can skip this if your new DSP is the same sample rate as the original)
    • On the DSP you are going to replace, look at offset 0x08. That is the Sample Rate of the DSP, defined as an unsigned integer (hex).
    • You can find this on the SSM by searching 0x12 upward before the coefficients. They are always placed immediately after a 00000001, which is the sound channel for the DSP.
    • You will usually find either a 00002EE0 (12000Hz) or a 00003E80 (16000Hz).
    • In our Example, the Sample Rate is 48000Hz, so we write 0000BB80.
  3. Determine your NEW DSP's Sound Byte Pointers.
    • SSMs don't point directly to the DSP's Sound Bytes; instead it uses Sound Byte lengths to determine their "Starting Point" and "End Point/Length" within the SSM.
    • Open the very last DSP on the SSM listing and search for its coefficients. You can do this by either going to the offset indicated @0x00 and looking up, or opening the last .dsp file in the listing with your hex editor.
    • The three values before the coefficients are the DSP's "Starting Point" and "End Point/Length". Each is 0x04 long, totaling 0x0C.
      • Image Reference: The "Starting Points" are marked in green rectangles, while the "End Point/Length". is marked with a blue rectangle. In red is the Sample Rate, and in orange is the Sound Channel.
    • Copy those three values over the offsets of the DSP you will replace. Remember that these are immediately before the coefficients.
    • In our the last DSP's coefficients are these:
  4. Calculate the Starting Point and Length of our new DSP.
    • On your calculator (in Programmer Mode), use the following formulas to calculate your new DSP Starting Points.
      • For Starting Point:
        • "Last DSP Starting Point" + ("Last DSP Sound Byte Length" * 2) = NEW DSP Starting Point.
        • In our example, the result comes to A3D62.
      • For End Point/Length:
        • "NEW DSP Starting Point" + ("NEW DSP Sound Byte Length" * 2) = New DSP End Point/Length
        • In the example, the result comes to BB68A.
    • Write the results down on the correct offsets. They are placed like this, along with the results from the example:
Re-importing your edited SSM

This is a similar process to the "Exporting SSMs from a Melee ISO" section, but instead we will be importing it back into Melee. Simply follow the same steps until you reach the file you want to re-import. Keep in mind that this will rebuild your ISO.

That's it!

If everything has been performed correctly, your sound should play without any issues!


SSM Troubleshooting
  • If you get a black screen, the value you put in at offset @0x04 of the SSM is wrong.
  • If you get a jumbled mess (like getting different sounds) you may have forgotten to update the value @0x04 of the SSM, or have the "Sound Length Pointers" wrong.
  • If you get the sound you wanted but it sounds like it's sped up or slowed down, the Sample Rate you defined for your DSP is likely wrong.
 
Last edited:

mandai

Smash Rookie
Joined
May 21, 2020
Messages
1
Hi has anyone else been able to follow this guide? I tried and either ended up with no sound (effect was removed), or in the best case the old sound played and it was crackly
 
Last edited:

KT1

Smash Rookie
Joined
Jun 14, 2020
Messages
2
Hi, Mandai, I'm going at it now, will let you know how it's going for me !

I tried this 5 years ago, it was painful...but I manage to put my sounds on captain falcon's taunt...once...never work after !

Still, I'm prepared now, I will see the end of it !!
 
Top Bottom