SM64 Soundbank Documentation Essentials + Soundbank Expansion
#1
After on on and off research project that was going on for 2 years-

I finally present:

SM64 Soundbank Documentation Essentials + Public Expansion Release!

Credits: Subdrag, Dudaw12, Frauber, rstewart215804, Skelux, queueRAM, Shygoo, Trenavix

Release Video + Tutorial:






Important: 256MB ROM will only work in certain emulators and flashcarts, so you'll have to repoint the soundbank elsewhere manuallly. Only PJ64 has been tested to work with this. Follow the tutorial yourself if you want to make practical use of this

Soundbank ROM Map:

Key: (Bold= Noteworthy)

0xD4768 .m64 Location ROM (Controller No. x2)

0xD47A0 ADSR Location ROM (Controller No. x4)

0xD4884 Soundbank Location ROM (Controller No. x2)

0xD48B6 Music Memory Pool

0x579C26 - 0x57B720 "bin" [according to n64split, although deleting it has no noticeable effect on 8MB or 64MB ROM]

Sound [ADSR] Controls (Segment 01 of Soundbank): 0x57B720 - 0x57B860
Sound [ADSR] Data: 0x57B860 - 0x593560
*Bank 00= 0x57B860 - 0x57BC80
*Bank 01= 0x57BC80 - 0x57C1E0
*Bank 02= 0x57C1E0 - 0x57C410
*Bank 03= 0x57C410 - 0x57CBE0
*Bank 04= 0x57CBE0 - 0x57D5E0
*Bank 05= 0x57D5E0 - 0x57E140
*Bank 06= 0x57E140 - 0x57EB60
*Bank 07= 0x57EB60 - 0x57F510
*Bank 08= 0x57F510 - 0x580680
*Bank 09= 0x580680 - 0x580BB0
*Bank 0A= 0x580BB0 - 0x581AA0
*Bank 0B= 0x581AA0 - 0x5820C0
*Bank 0C= 0x5820C0 - 0x5833C0
*Bank 0D= 0x5833C0 - 0x5845C0
*Bank 0E= 0x5845C0 - 0x584B60
*Bank 0F= 0x584B60 - 0x584FB0
*Bank 10= 0x584FB0 - 0x585BC0
*Bank 11= 0x585BC0 - 0x587080
*Bank 12= 0x587080 - 0x5879C0
*Bank 13= 0x5879C0 - 0x5889A0
*Bank 14= 0x5889A0 - 0x588B40
*Bank 15= 0x588B40 - 0x589AC0
*Bank 16= 0x589AC0 - 0x589BC0
*Bank 17= 0x589BC0 - 0x58AF00
*Bank 18= 0x58AF00 - 0x58C040
*Bank 19= 0x58C040 - 0x58D3F0
*Bank 1A= 0x58D3F0 - 0x58DCD0
*Bank 1B= 0x58DCD0 - 0x58ECB0
*Bank 1C= 0x58ECB0 - 0x58EFC0
*Bank 1D= 0x58EFC0 - 0x58F2F0
*Bank 1E= 0x58F2F0 - 0x58F660
*Bank 1F= 0x58F660 - 0x58F990
*Bank 21= 0x58F990 - 0x58FCE0
*Bank 22= 0x58FCE0 - 0x58FEE0
*Bank 23= 0x58FEE0 - 0x590DC0
*Bank 24= 0x590DC0 - 0x591240
*Bank 25= 0x591240 - 0x591ED0
*Pointer to Padding?= 0x593520- 0x593560

Sound Table (Segment 02 of Soundbank): 0x593560 - 0x5936A0
Raw Sound Data: 0x5936A0 - 0x7B0860
*Bank 00= 0x5936A0 - 0x59A840 
*Bank 01= 0x59A840 - 0x59E210
*Bank 02= 0x59E210 - 0x5A4A20
*Bank 03= 0x5A4A20 - 0x5AFCD0
*Bank 04= 0x5AFCD0? - 0x5E5400?
*Bank 05= 0x5AFCD0? - 0x5E5400? (Data must be hardcoded for 4 and 5 because it seems they "share" a segmented offset)
*Bank 06= 0x5E5400 - 0x5F6FA0
*Bank 07= 0x5F6FA0 - 0x607E90
*Bank 08= 0x607E90 - 0x64D350
*Bank 09= 0x64D350 - 0x657EA0
*Bank 0A - 26**= 0x657EA0?? - 0x6B5B00?? (Data must be hardcoded because it seems they "share" a segmented offset)

**Still need to add a couple of stragglers within this range of banks, otherwise they all point to the same offset

*Large Padding Areas= 0x654683 - 0x654987 0x6E0221 - 0x6E02C0 0x6E288A - 0x6E2930 0x6FC974 - 0x6FCA2C 0x7043F3 - 0x704430 0x756566 - 0x7565DE 0x777022 - 0x777070

*Old .m64 Data Table (Segment 03 of Soundbank): 0x7B0860 - 0x7B0980
Old .m64 Data: 0x7B0980 - 0x7CC620 
*Bank 00= 0x7B0980 - 0x7B3E10
*Bank 01= 0x7B3E10 - 0x7B4080 (Start of known old .m64 sequences: 0x7B3E10)
*Bank 02= 0x7B4080 - 0x7B60C0
*Bank 03= 0x7B60C0 - 0x7B74D0
*Bank 04= 0x7B74D0 - 0x7B7E90
*Bank 05= 0x7B7E90 - 0x7B9140
*Bank 06= 0x7B9140 - 0x7B9AE0
*Bank 07= 0x7B9AE0 - 0x7BA840
*Bank 08= 0x7BA840 - 0x7BC810
*Bank 09= 0x7BC810 - 0x7BE520
*Bank 0A= 0x7BE520 - 0x7BFB50
*Bank 0B= 0x7BFB50 - 0x7C00D0
*Bank 0C= 0x7C00D0 - 0x7C13F0
*Bank 0D= 0x7C13F0 - 0x7C1480
*Bank 0E= 0x7C1480 - 0x7C20C0
*Bank 0F= 0x7C20C0 - 0x7C2BA0
*Bank 10= 0x7C2BA0 - 0x7C2DD0
*Bank 11= 0x7C2DD0 - 0x7C4060
*Bank 12= 0x7C4060 - 0x7C4170
*Bank 13= 0x7C4170 - 0x7C47F0
*Bank 14= 0x7C47F0 - 0x7C48C0
*Bank 15= 0x7C48C0 - 0x7C4B50
*Bank 16= 0x7C4B50 - 0x7C58C0
*Bank 17= 0x7C58C0 - 0x7C5B60
*Bank 18= 0x7C5B60 - 0x7C6260
*Bank 19= 0x7C6260 - 0x7C7020
*Bank 1A= 0x7C7020 - 0x7CA810
*Bank 1B= 0x7CA810 - 0x7CA8F0
*Bank 1C= 0x7CA8F0 - 0x7CA9C0
*Bank 1D= 0x7CA9C0 - 0x7CAB70
*Bank 1E= 0x7CAB70 - 0x7CB260
*Bank 1F= 0x7CB260 - 0x7CBA70
*Bank 21= 0x7CBA70 - 0x7CC1D0
*Bank 22= 0x7CC1D0 - 0x7CC4E0
*Old Instrument Set Table: 0x7CC620 - 0x7CC6C0 (Table does point to this)

*0x7CC6C0 - 0x7F0000 Reserved 
**(Note: is used by any hacks that make usage of soundtool)

0x7F0000 - 0x800000 Old Level Importer .M64 Names, Instrument List Table, and Level Names (Overwritable?)

*New Instrument Set Table: 0x81C000

*New Sequence Names: 0x81D000

0x3E00000 - 0x3E00240 New .m64 Music Table (Segment 03 of Soundbank):
New .m64 Data: 0x3E00240 - 0x3EF66F8
*Bank 00= 0x3E00240 - 0x3E036D0
*Bank 01= 0x3E036D0 - 0x3E03940
*Bank 02= 0x3E03940 - 0x3E05980
*Bank 03= 0x3E05980 - 0x3E06D90
*Bank 04= 0x3E06D90 - 0x3E07750
*Bank 05= 0x3E07750 - 0x3E08A00
*Bank 06= 0x3E08A00 - 0x3E093A0
*Bank 07= 0x3E093A0 - 0x3E0A100
*Bank 08= 0x3E0A100 - 0x3E0C0D0
*Bank 09= 0x3E0C0D0 - 0x3E0DDE0
*Bank 0A= 0x3E0DDE0 - 0x3E0F410
*Bank 0B= 0x3E0F410 - 0x3E0F990
*Bank 0C= 0x3E0F990 - 0x3E10CB0
*Bank 0D= 0x3E10CB0 - 0x3E10D40
*Bank 0E= 0x3E10D40 - 0x3E11980
*Bank 0F= 0x3E11980 - 0x3E12460
*Bank 10= 0x3E12460 - 0x3E12690
*Bank 11= 0x3E12690 - 0x3E13920
*Bank 12= 0x3E13920 - 0x3E13930
*Bank 13= 0x3E13930 - 0x3E13FB0
*Bank 14= 0x3E13FB0 - 0x3E14080
*Bank 15= 0x3E14080 - 0x3E14310
*Bank 16= 0x3E14310 - 0x3E15080
*Bank 17= 0x3E15080 - 0x3E15320
*Bank 18= 0x3E15320 - 0x3E15A20
*Bank 19= 0x3E15A20 - 0x3E167E0
*Bank 1A= 0x3E167E0 - 0x3E19FD0
*Bank 1B= 0x3E19FD0 - 0x3E1A0B0
*Bank 1C= 0x3E1A0B0 - 0x3E1A180
*Bank 1D= 0x3E1A180 - 0x3E1A230
*Bank 1E= 0x3E1A230 - 0x3E1A920
*Bank 1F= 0x3E1A920 - 0x3E1B130
*Bank 20= 0x3E1B130 - 0x3E1B890
*Bank 21= 0x3E1B890 - 0x3E1BBA0
*Bank 22= 0x3E1BBA0 - 0x3E1BBE0
*Bank 23= 0x3E1BBE0 - 0x3E1F070
*Bank 24= 0x3E1F070 - 0x3E22500
*Bank 25= 0x3E22500 - 0x3E25990
*Bank 26= 0x3E25990 - 0x3E28E20
*Bank 27= 0x3E28E20 - 0x3E2C2B0
*Bank 28= 0x3E2C2B0 - 0x3E2F740
*Bank 29= 0x3E2F740 - 0x3E32BD0
*Bank 2A= 0x3E32BD0 - 0x3E36060
*Bank 2B= 0x3E36060 - 0x3E394F0
*Bank 2C= 0x3E394F0 - 0x3E3C980
*Bank 2D= 0x3E3C980 - 0x3E3FE10
*Bank 2E= 0x3E3FE10 - 0x3E432A0
*Bank 2F= 0x3E432A0 - 0x3E46730
*Bank 30= 0x3E46730 - 0x3E49BC0
*Bank 31= 0x3E49BC0 - 0x3E4D050
*Bank 32= 0x3E4D050 - 0x3E504E0
*Bank 33= 0x3E504E0 - 0x3E53970
*Bank 34 - 46= 0x3E53970?? - 0x3E00240??

**Still need to add a couple of stragglers within this range of banks, otherwise they all point to the same offset


Soundbank Notes:

The soundbank has three different "segments" with an indicator at the beginning of the table of each one, 1=ASDR, 2=Raw SFX Data, 3=.m64 Data

The controllers that determine the location for SFX, .m64 data, ADSR, and SFX Memory Pool all shared in the same ASM code in the checksum at 80319508-8031990C (Use -245000 to find ROM location)

The reason allocation of the soundbank works is because it is ROM data being loaded into the RAM at a rate that doesn't crash or overwhelm the game, allowing for streamed music to be possible

Creating an .m64 that is intended to play 1 note for "streamed music" will only play for around 5 minutes and it will suddenly stop: to get around this, import your music over the "playsound objects" like the waterfall playsound if the song is over 5 minutes

In order to import sounds into s different ROM location, you must edit the Soundtool's "gameconfigsound.ini" file each time you change the address

SFX Data can be repointed to past the 64MB mark and the ROM will still run, allowing for the soundbank to have 192MB of freespace if done correctly

Soundbank Offset Addresses work by [Starting Address of Table + Offset= Start of First Bank + Offset 2= End of First Bank and Start of Second. Offset 3= Starting Address of Table + Start of Second Bank. Offset 3 + 4= End of 2nd Bank and Start of 3rd. Rinse and Repeat.]

The Offset Addresses look like they'd be 4 bytes long, but only have a 3 byte range, as using a 4-byte offset will freeze the game, the only way to change the location of the whole thing is to change the pointer in the checksum

Segment 1 and 2 of the Soundbank have 0x26 listed Instrument Lists, but Segment 3 only has 0x23 listed Instrument Lists, and the Level Importer M64 Data Lists 0x46 Instrument Lists

Some (not all) Instrumentss (not to be confused with instrument banks) seem to end with a 00 padding that can range from 8-10 bytes (00 00 00 00 00 00 00 00) and/or 16 bytes most commonly (00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00),
although there are large padding areas which I have documented above

There are 2 SFX in which their locations are "undocumented" by the Soundtool [as deleting every sound in the game with the soundtool seem to have no effect on these 2 particular sounds]:
1: The Red Coin Sound
2: The Instrument used in (Beat Level: New High Score/Record)

Most Instruments in the Soundbank use a sample rate that varies 16khz, 8khz, etc
Mario's SFX are 16khz and Peach's Voice Clips are 22050hz

The Waterfall Playsound ASM code is at: AB7F4 and to change the sound that's played, change the value at AB7FC

The prefix that is typically used for the "ADSR" data is 00 02 00 00 00 02

Soundbank Tables Layout (ADSR): There's 0001, then count ctls 16-bits (00026), then starting at offset 0057B724, it's 4-byte offset (from 0057B720), and then 4-byte size, repeat till 0x26 entries.


Download for Documentation as a .txt file below!


Attached Files
.txt   Soundbank Documentation (Blakeoramo).txt (Size: 9.33 KB / Downloads: 894)
Reply
#2
I have completely redone my tutorial video, making the video nearly twice as short and containing twice as much content as prior.
In the description, I have also included all the tools and docs I used for the creation of it as well

Revised Soundbank Expansion Tutorial:




Reply
#3
In addition, I have now ported my soundbank documentation to both the PAL and JAP Versions of SM64. 
This is a showcase of a larger project I have planned in porting a large portion of US ROM documentation to both the JAP and PAL versions of SM64 (such as behavior scripts, level scripts, ROM differences, ROM Map).


Here is a video showcasing the first custom .m64 sequences done from scratch and expanded soundbanks in the PAL/JAP ROMs of SM64:





Download for Documentation Below!


Attached Files
.txt   Universal SM64 Soundbank and m64 Documentation.txt (Size: 629 bytes / Downloads: 699)
Reply




Users browsing this thread: 1 Guest(s)