Language…
12 users online: ASSATAKKU,  Donut, DPBOX, Golden Yoshi, masl, Rauf, Shomi, signature_steve, Sweetdude, timothy726, tOaO, zAce08xZ - Guests: 234 - Bots: 312
Users: 64,795 (2,377 active)
Latest user: mathew

MSU-1 Music for SMW Tutorial

AdvancedCustom Music

  • Pages:
  • 1
  • 2
NOTE: This tutorial's patch file is outdated. I have created a new one, downloadable in this thread.

Introduction:

The MSU-1 is an SNES expansion chip that allows for 4 gigabytes of extra data and CD-quality audio.
In this tutorial I will explain how to set up mapping, how to create .pcm files and play them in your SMW hack.
You will need basic-intermediate knowlegde of ASM.
(Note: I recommend you read the entire tutorial through once before following it!)

Getting Started:

First off, you will need to download a few programs.

higan v96
wav2msu For converting wav files into .pcm files.
Audacity For editing sound files and exporting to .wav files.
Notepad++ For easier editing and creation of .bml files.

Chapter 1: Creating .pcm files

The MSU-1's music files are supplied in the .pcm format. A .pcm is basically a .wav, but with a few identification bytes added at the start. In this chapter I'm going to explain how to create and loop .pcm files using the wav2msu tool.

Open your audio file (the starting format should not matter, since Audacity can convert it!) in Audacity and edit it until you are satisfied with the result. If you don't know how to use Audacity, you can find an overview of basic functions here.
Make sure the "Project Rate (HZ) is set to 44100", there are atleast 2 channels (or 1 stereo channel) and the byte order is little endian (If you're exporting from Audacity, this should be fine by default).
The next few lines only apply if you are making a pcm that needs to be looped.
Next, find the start point of your loop. The easiest way to get this done perfectly is by making a selection from roughly where you want your loop point to be to the very end of the song. After this, click the last number in the "Selection Start" box, at the bottom of Audacity.
When you've found the perfect loop point, click the arrow in the "Selection Start" box and set it to "Samples". Write down the number of samples, this will be the start of your loop.
Next, export your song by pressing CTRL+SHIFT+E as "WAV signed 16-bit pcm". Get wav2msu, your newly-created .wav file and cmd.exe in the same folder. Write the following in command prompt:
Code
wav2msu YourWavFileName.wav -l 1234567

Where YourWavFileName is, well, your wav file name, followed by hyphen L (lowercase), followed by the sample number you got from audacity.
Note: If you aren't going to loop your song, or it doesn't need a start of loop point to loop perfectly, you don't have to mark the start in audacity and you can simply do "wav2msu YourWavFileName.wav" .
If everything goes well, wav2msu should output a .pcm file! If it reports an error, you can find more detailed information on what is wrong here. A possible solution for the Sample Data isn't where it was expected error is removing the metadata by copying the entire song into a new Audacity window, and then exporting.
Name your file track-1.pcm, track-2.pcm and so on.

Chapter 2: Auxiliary files
A bml is no longer neccesary thanks to higan v96.
Instead, you need to name your files in the following way:
ROM: program.rom (must be headerless!)
MSU1 Data: msu1.rom
PCM tracks: track-<number(decimal)>.pcm
Put this in a folder named <hackname>.sfc, and put the folder in your higan library. If you don't know where this is, open icarus.exe and click settings.
(Old chapter 2 (if you need it) can be found Here)
Chapter 3: Patch

To make using the MSU-1 easily accessible, I have created a patch that works together with AddmusicK to automatically play all SMW Music with the MSU-1 instead, while retaining SPC functionality to fall back on, if the MSU-1 is not found, or if you want to play music on the SPC and something else on the MSU-1.
You can download it HERE.

disclaimer: Although I claim no responsibilities for crashed roms, broken hacks, etc. because of this patch, if you find a bug or issue with it, report it to me and I will try to fix it! Always back up your rom before applying.

Usage instructions:
Replace AddmusicK/asm/main.asm with the main.asm in the zip file, and AddmusicK/asm/SNES/patch.asm with the patch.asm file. (Note that you might want to back up your AddmusicK folder first, in case you have a rom where you don't want to use this patch)
(I recommend also editing tweaks.asm and setting !JumpSFXOn1DFC = !true to !false)

Next, open newMSUPatch.asm and configure it however you want. Edit the loop table to include your custom songs. If they should be looped, change 00 in the same number you inserted the track to in AMK's list file to 01 for an unlooped song (play only once) or 03 for a looped song.

Note that you will NEED to create a .pcm for the following songs: Death, Game Over, Boss Clear, Stage Clear, Starman, PSwitch, Keyhole, IrisOut, BonusEnd. If you don't do this, the music will go silent when these songs are supposed to play. By default, they are tracks 1 to 9. Make sure they are about as long as SMW's original jingles, and that the Starman and P-Switch tracks are properly looped. If they are too long, they will get cut off by the next track that plays. Mandew has converted the original SMW's tracks into PCM, you can download them Here. You can use these in your ROM, or use them as a guideline for how long the tracks should be.

Make sure you have expanded and saved your rom using Lunar Magic. Use AddmusicK on your rom, and then apply newMSUPatch.asm to your rom using Asar. From now on, if the MSU-1 is detected, the track that will play every level is the value stored to $1DFB. This means that you can simply set the music in Lunar Magic and it will work. If the MSU-1 is not working, because the player is using an incompatible emulator, it will automatically use the song you inserted in that slot with AddmusicK. (note that you will need to edit the music in level C5 to change the welcome jingle)
Make sure your .bml file is in the same folder as your .msu file, your ROM and your .pcm files.
In order to test if everything works, or to play a MSU-1 ROM, open ZMZ and change the core to a bsnes core, via misc->libretro, then open the BML file, NOT the ROM file.

In the folder is also the file "CheckMSU.asm". This is a modified version of Alcaro's ZSNES check patch that checks if the MSU-1 is working. Feel free to apply it to your ROM if you want to.


Appendix 1: Hack Distribution
Because the filesize of MSU-1 songs can really add up, and there's a 10 MiB filesize limit in the hacks section, I recommend that you distribute your hack without the .pcm and .msu files, and host those yourself for people to download separately.

Appendix 2: Pause Feature
Higan v96 added support for a pause feature. To pause your song, use STZ $2007. To later resume it, use LDA #$05 : STA $2007.

End of tutorial.

Special thanks to Alcaro, Lui37, and Torchkas for helping me.

If there's any issues, questions, bugs or other stuff, don't be afraid to post or query me on IRC and I will try to help you out!
Pretty high-quality tutorial. Contains everything you need with links and all. Good job! I'm also pretty happy you cleared up what the MSU-1 can do right away. Before reading this I thought it only gave you 4 megabytes and didn't understand why people like it so much. 4 gigs is pretty good though.

allow shy guy emojis in post footers you cowards!
Originally posted by Medic
If it says "Sample Data was

sample data was what?????

Actual question, do we need to have the local songs be the first 0x9 songs in the .bml file?
They need to be in the same order as AddmusicK's globals list.
If you change it in Addmusic_list.txt and tweaks.asm, the global pcms need to be in the same order.
I have always been in full support of the MSU1 for SMW. The possibilities of CD quality music in hack is far reaching. I personally believe this is the next big thing in SMW hacking.

Also special thanks should been given to Conn, who was the person who originally coded this.

Does this tutorial also work for SD2SNES on real hardware?
Originally posted by Final Theory
I have always been in full support of the MSU1 for SMW. The possibilities of CD quality music in hack is far reaching. I personally believe this is the next big thing in SMW hacking.


Only if everyone starts using Higan.

allow shy guy emojis in post footers you cowards!
Does it also increase the echo buffer?
100% Orange Juice Playthrough:
https://www.youtube.com/playlist?list=PLf1kPWkjcurtA3xPP3TybfqSiEn1AcX2A

VLDC9 Playthrough:
https://www.youtube.com/playlist?list=PLf1kPWkjcurtiP5de_-e6q0hSVrY37RB-.


what



that has nothing to do with this WHATSOEVER.
the echo buffer is the same for SPC songs, for MSU-1 music it doesn't matter
I have followed the tutorial and have used a new rom. But for some reason, all the music is gone. The sound effects are there, but no music plays. Is there a reason for this???

here is my huntersrevenge.bml in case you are curious.
Code
cartridge region=NTSC
  rom name=huntersrevenge.smc size=0x400000
  ram name=huntersrevenge.ram size=0x800
  
  map id=rom base=512 address=00-7f,80-ff:8000-ffff mask=0x8000
  map id=ram address=70-7f,f0-ff:0000-ffff

  msu1
    rom name=huntersrevenge.msu size=0x0000
    map id=io address=00-3f,80-bf:2000-2007
	    
	track number=0x1 name=Death.pcm
	track number=0x2 name=GameOver.pcm
	track number=0x3 name=BossClear.pcm
	track number=0x4 name=StageClear.pcm
	track number=0x5 name=Starman.pcm
	track number=0x6 name=PSwitch.pcm
	track number=0x7 name=Keyhole.pcm
	track number=0x8 name=IrisOut.pcm
	track number=0x9 name=BonusEnd.pcm
	track number=0x70 name=Finale1.pcm
        track number=0x71 name=Finale2.pcm


I have
- replaced the main.asm and the patch.asm in AMK
- am using AMK1.04
- using the latest ZMZ
- have the .pcm .bml and .msu files in the same directory as the .smc itself
- did create the blank .msu document
- .smc is 4 MB (hence the 400000)

This is the image that shows up when I load the .bml using ZMZ after selecting the bsnes core that comes with the download of the latest ZMZ.

-Note the rom still plays normally, just no music of any kind, not even the globals

EDIT: Okay, I've gotten .pcm tracks to play, now I just can't get the .spcs actually inserted into the rom to play.
Thanks for the help, buddy!
The patch is basically all or nothing, I misunderstood the "fall back on" thing.
Your layout has been removed.
Nice tutorial, got everything to work fine.

Just one question:
My SFX are different, when my hack uses MSU-1.
They sound like a wrong sample was loaded, but they still play.
Did I do anything wrong to create this effect or does this happen every time and do I have to disable all soundeffects in my hack?
My Youtube channel

Currently working on:
Project C

Finished project:
That shouldn't happen, and there's code in the patch especially to make that not happen. Did you follow all the steps correctly? Did you start out with a clean AddmusicK folder?

Has anyone else been having this issue? If so, please tell me.
Originally posted by Medic
Did you follow all the steps correctly? Did you start out with a clean AddmusicK folder?


Whoops, now that you mention it, I guess I didn't.
I made the edit to make addmusicK not play any P-Switch or star music and instead made it continue the level song.

I downloaded the latest version of addmusicK, portet my rom and now everything works fine, thanks for your help#tb{:]}
My Youtube channel

Currently working on:
Project C

Finished project:
I have updated the tutorial to fit the format of higan v096, the biggest new feature is that you no longer need a .bml file for the MSU1 to function, as long as you name your tracks and data in the proper way.
I'm kinda stuck. I successfully converted my .wav files to .pcms, ran AMK on my rom, and applied the patch. Now I confused as to what I'm supposed to do next.
If you have them named in the proper fashion, and everything in the right folders, you should be able to play the MSU-1 music in higan v96. It will play MSU-1 track 1 if you select track 1 in Lunar Magic.
Can you possibly make a video tutorial please? There are certain parts that I don't seem to understand.
How do you know what the track names are? For instance, how would I know what the song names are for Soul Blazer? Is there a program that tells me this? Thank you.

Edit: Just realized this is strictly for SMW. Sorry about that!
I'm having a problem similar to amhunter's, except that the "Nintendo Presents" sound doesn't play either.
The settings are a little different too: I successfully converted all the provided files to SA-1 before using them. Since I obtained no errors from AMK or Asar and that the problem can't come from the .pcm music (I tested it in super Mario Odyssey and it replaced the demo level theme perfectly), I assume that the problem doesn't come from the conversion.

Here are all the modified files (.pcm not included of course), and below the steps I followed:
1) Grab a clean ROM, extend it to 4MB
2) Make it SA-1, extend it to 8MB
3) Replace AMK's "main.asm" and "patch.asm" by the modified ones
4) Insert only the original SMW songs in the ROM with AMK (no error)
5) Apply "MSU4SA1.asm" with Asar (no error)
6) Remove the ROM's header with SNEStuff (no error)
7) Rename it "program.rom"
8) Place it in a "hacktest.sfc" folder, along with a empty "msu1.rom" and the .pcm music named "track-15.pcm" (so that it should replace the title screen music)
IMPORTANT NOTE : the link for the original SMW global songs is broken, so I didn't use any other .pcm than mine in the end.

Also, I'm using respectively the versions 2.42, 1.25, 1.0.4, 1.37 and 1.2.1 versions of Lunar Magic, SA-1 patch, AMK, Asar and SNEStuff.

Could you tell me where's the problem, please ? Thanks in advance.
If your track is named track-15.pcm, are you playing SNES music track 0F? If you are, then you should try reading $2000 (MSU1 Status) and storing it to the statusbar or something so you can read the value and see what is wrong.
Originally posted by Medic
If your track is named track-15.pcm, are you playing SNES music track 0F? If you are, then you should try reading $2000 (MSU1 Status) and storing it to the statusbar or something so you can read the value and see what is wrong.

Turns out I'm stupid and simply forgot the track are meant to be named in decimal #smw{-_-2} Thanks for the quick reply, it works perfectly now !

Btw, could you fix the broken link I mentioned (if you still have the .pcm files), please ? (EDIT: thanks a bunch !)
  • Pages:
  • 1
  • 2

AdvancedCustom Music