Major props to RemixRave for revamping the guide.

A. Requirements

In order to replace music & sounds in F-Zero X, you need the following:

N64 Sound Tool: http://www.goldeneyevault.com/viewfile.php?id=212

Audacity: http://www.audacityteam.org/download/

An F-Zero X rom. It can be US, Europe, or Japan.

An N64 emulator if you want to test your music in-game i.e. PJ64

It would help if you have access to a Digital Audio Workstation (DAW), such as Fl-Studio. We will refer to fl-studio in this tutorial.

B. Setting up your tune

F-Zero X's music plays at a sample rate of 22050khz. Each music-sound file has a maximum file size which you’ll need to use as a guide when importing your music.

In order to make your music sound great in-game, do the following:

Select the music you want to import into the ROM. Make note of the file size. For example, let’s assume a file size of 71.3MB. The largest music file in F-Zero: X is the Credits theme, being 6.83MB, so you’ll need to bring your music as close to 6.83MB if you want to maximise quality. Using Fl-Studio, export your music in mp3 format, making sure the bit-rate is at 128kbps (think of 128kbps as a safe, reliable setting. However, you may experiment). Any lower and you will lose quality drastically. Any higher and you may struggle to clamp down on file size. Fl-Studio will show you the effect on file size automatically as you adjust the bit-rate slider settings. With these settings in place, we will move from a 71.3MB file to a 3.23MB file. Load your new music file into audacity. Split your music into two mono tracks and adjust the volume for each channel, preferably between -3db and -5db. Select both channels and mix and render them. Change the sampling format to 16-bit as this will help reduce file size. There is no need to change the sampling rate. Change the project rate in the bottom left corner of audacity to 22050khz. This will automatically change the sampling rate to 22050khz when exporting your music. If you are happy at this point, export your file as a wav 16-bit PCM file. Step 5 will be discussed in Section D as it is dependent on your choice to include loop points. We now have a 6.38MB file. The file size has increased due to the transition from mp3 to wav, as wav files are lossless.

C. N64 Sound Tool

Finally, it's time to utilize the Sound Tool. This tool enables us to view, export, delete, and import music available in N64 games. For F-Zero X, we're pretty lucky that music isn't separated into different instruments, so this should be fairly straightforward.

Open up N64 Sound Tool, click File, Open Known Game, F-ZERO X, then select the correct region. Select the appropriate ROM. Make sure you are on Soundbank 00. You can use the table made below to find the music you want to replace. Note that not every sound is on there. F-Zero X has over 70 different sounds, however not all have been documented. If you can't find what you're looking for, I recommend going through the long list to try and find it. Using the table provided below, choose the soundtrack you wish to replace. For this tutorial, we have no choice but to use the Credits theme. Use the instruments tab to select 0029. This is the code for the Credits theme. Click on 16-bit VADPCM to import your music, in this case, the 6.38 file we created. You will notice that the N64SoundTool has frozen and will not be responding for a while, depending on the size of the file you imported. I suggest avoid clicking on the sound tool to prevent further issues and reflect on what’s life. After the sound tool has refreshed, you will be able to preview your music. Under the instruments tab, there is a box that says Master Sample Rate. By default this will be around 32000khz. You can change this to 22050khz to get a correct preview of how your music will sound in the ROM. If you have followed the previous steps correctly, you should be able to inject your music into the ROM. Click inject in place. File > save ROM > F-Zero X.z64.rom. Don’t worry about the .rom extension. Your ROM will still work. You should be able to test it out through emulation now. If you are planning on combining your music with a custom track, you can also patch your tracks to the ROM with the .rom extension file in FZEP.

D. Looping

Firstly, open up this site: www.binaryhexconverter.com/decimal-to-hex-converter . Using your music file, you can find your loop points and convert them into hexadecimal. Firstly, locate the drop down box at the very bottom of audacity in the middle of the screen and change seconds into samples. Zoom into your music’s wave spectrum by clicking the magnifier + sign. Locate the start point where you wish the loop to begin and copy the number in the samples drop down box into the hex converter website. Copy the hex number into the sound tool at the bottom start box. Do the same for the end point. Make sure to fill out missing values in the Start and End boxes with 0’s, i.e. if you have a hex number of 1a83f, then add three 0’s before it to get 0001a83f. Change the count section in the sound tool to FFFFFFFF. You can now proceed to inject your music into place. Step 5 – Section B. If you are going to replace the Credits theme, you cannot loop your music as the Credits theme never looped to begin with. In this case, ensure your music is long enough to last the race. Cut any parts of the audio from the end that you don’t need, i.e. if you want to inject Ghost Rider into place, ensure that it loops at least twice and maybe play for around half the time of the third loop. This will help reduce the file size to some degree.

Here's a small guide for converting between loop rates. This will work super well if you get your music off a site like smashcustommusic.com or already know the beginning/end loop points already.

You have to use this formula:



SampleOriginal is what the original sample rate point was.

SampleNew is what the new sample rate point is.

FrequencyNew is what the new frequency is.

FrequencyOriginal is what the old frequency was.

You'll need to rearrange the formula to get your desired resutls. I'll provide an example of this below:



Let's say we're trying to convert a 44100Hz music track into a 4000Hz music track. Our beginning loop point in our 44100Hz music track is 7721856 samples and we are trying to find out what the equivalent sample rate is in our 4000Hz music track.

Let's rearrange our formula so it equals SampleNew.



Now we sub in our values.

Our original frequency is 44100Hz

Our new frequency is 4000Hz

Our original sample is 7721856 samples.

When subbed in, we get:



If you round, you get 85133462 which is indeed the correct new sample rate after changing a 44100Hz tune to 4000Hz.





E. Ending



By now you have imported your music into the game. If you find it too loud, you can easily reduce the volume of it in Audacity without affecting the filesize. Seamless looping is by far the hardest thing in this tutorial and I do not have any idea on how to make seamless loops occur consistently.

Filesizes

This is is not everything. Some of these sounds I have no idea what they are. I've only listed familiar tracks and sounds.

Largest to smallest:

Name Instrument* Filesize Credits Theme 0029 6.83 MB (7,163,568 bytes) Silence 002A 2.85 MB (2,997,616 bytes) Big Blue 0024 2.55 MB (2,683,792 bytes) Port Town 0016 2.46 MB (2,585,904 bytes) White Land 0012 2.11 MB (2,222,320 bytes) Mute City 0014 2.03 MB (2,135,952 bytes) Sand Ocean/Fire Field 0015 2.01 MB (2,110,672 bytes) Red Canyon 0007 2.00 MB (2,101,264 bytes) Sector Alpha 0013 1.89 MB (1,992,592 bytes) Devil's Forest 0001 1.80 MB (1,898,448 bytes) Title Theme 0019 1.60 MB (1,683,216 bytes) Death Race 0042 1.34 MB (1,410,928 bytes) Car Select 001A 864 KB (885,744 bytes) Results 0032 864 KB (885,744 bytes) After-Race Results 000F 864 KB (885,744 bytes) Game Over 002E 560 KB (574,064 bytes) Leaderboard/Settings 002C 502 KB (514,800 bytes) Machine Destroyed 0025 364 KB (373,200 bytes) Finish! 0020 270 KB (277,232 bytes) Race Beginning 001B 233 KB (239,408 bytes) Title Intro 0000 226 KB (231696 bytes) Male falling off track 0035 121 KB (124,368 bytes) Car Select Sound Effect 0040 117 KB (120,720 bytes) Announcer: "See you again! Hahaha" 0030 108 KB (111,440 bytes) Female falling off track 0036 106 KB (109,360 bytes) Announcer: "Too bad, you lost your machine." 0031 102 KB (105,328 bytes) Announcer: "Way to go, it's a new record!" 002F 98.8 KB (101,232 bytes) Announcer: "Pour(?) it on, you're way out in front!" 003B 94.1 KB (96,368 bytes) Announcer: "Yeah! The final lap!" 0023 93.1 KB (95,344 bytes) Boost noise? 0038 83.8 KB (85,872 bytes) Announcer: "Yeah! First place!" 0046 80.6 KB (82,544 bytes) Announcer: "Alright! First place!" 0034 80.3 KB (82,288 bytes) Announcer: "Bingo! Hahaha" 0002 80.2 KB (82,160 bytes) Announcer: "You're going the wrong way!" 003E 79.4 KB (81,392 bytes) Machine Explosion 0006 72.2 KB (74,032 bytes) Announcer: "You got booze power!" 0022 68.6 KB (70,256 bytes) Announcer: "Finish!" 003D 68.3 KB (70,000 bytes)

And now I am too lazy to continue. You can figure out the rest by going into N64 Sound Bank and clicking "Rip All Sound Banks." This gives you some super slowed down F-Zero tracks and the filesize for each of them. Match them up in the Sound Tool and do whatever.

*Instrument is related to N64 Sound Tool. The Soundbank must be 00 else you won't see any instruments.

If anything is unclear in the guide, please message some of the folks on the F-Zero Nexus and F-Zero Online Discord channels. I'm usually hanging around on there so a response on there will be much quicker.

---

(2018-02-02) - Major props to RemixRave for revamping the guide using what I discovered and refining it! Things should make more sense.

(2018-02-16) - Differentiated between a few sounds present on the table (title, car select, menu sfx) (EDIT 2) Added size for the Title Intro

(2018-07-0 - Added in information about converting sample rates between different frequencies.