I'd put this in my Sample Tool tutorial thread but I've only gotten it to work in AddmusicM.
Here's a step by step process. You'll need your ROM, AddmusicM, your .WAV file, and a program called OpenMPT (optional, but it will make looping your samples infinitely easier. Just note that it can occasionally have troubles running under Wine in Linux, but it can work.)
This was a rushed job since I was excited that I finally figured out how to pull this off, if anybody notices something wrong or thinks I didn't explain anything well enough I'll update it.
Here's a step by step process. You'll need your ROM, AddmusicM, your .WAV file, and a program called OpenMPT (optional, but it will make looping your samples infinitely easier. Just note that it can occasionally have troubles running under Wine in Linux, but it can work.)
- Find the .WAV that you want to insert (this should be obvious...)
- Open OpenMPT, go to File -> New -> then select any of the options; file type doesn't really matter here. I'll use IT for the sake of it.
- Click the Samples tab.
- Click the open button in the top left of the interface and select your .WAV file.
- Under Loop you should see two text boxes. The first one is labeled Start and the other End, the signify where the looped portion of the sample should start and end respectively.
- Play around with those values and press the play button to listen to your sound (it looks like two beamed eighth notes and is horizontal to the open button.) Note that BOTH values MUST be divisible by 16 or the process will not work right when it comes time to insert your sample!
- Once you've found the perfect loop values, click on the zoom drop-down control (By default it says Auto) and select 1:1. This will zoom in to the maximum amount, ensuring absolute precision, which you'll need.
- When you hover your mouse over your sample data (the big red squiggly line) you should see something at the bottom of the window that says "Cursor:" then a number. This number changes depending on where in the wave your cursor is.
- Move your cursor until the displayed number is exactly equal to what you set as the ending loop point in the text box above.
- Now click and drag from that point to the very end of the wav, making sure to select everything from that point on, and delete it by pressing the delete key.
- Now save your modified .WAV in the same folder as Sample Tool. Just do it, trust me. You'll see why in a second.
- Sample Tool comes automatically packaged with a tool called SNESBRR. You're going to use this program, and since it is command prompt only, copy cmd.exe to that folder.
- In that command prompt, type in "snesbrr.exe -e -l LLLL IIII.wav OOOO.brr" where LLLL is the value in the Start text box of OpenMPT, IIII is the .WAV file, and OOOO is your output file. Remember that none of your file names can have spaces!
- Grab a calculator. Multiply the starting loop point by 9/16 (or 0.5625). Now convert that to hex (if the result was a decimal you've done something wrong.).
- Open up your new .brr file in a hex editor and insert (do NOT overwrite anything!!) the number you just calculated in reverse byte order to the beginning of the file. For example, if you got C85 then you would insert 85 0C.
- Save and you're done! Insert your sample using AddmusicM and enjoy your looped samples!
This was a rushed job since I was excited that I finally figured out how to pull this off, if anybody notices something wrong or thinks I didn't explain anything well enough I'll update it.
I should get a new layout.
Probably won't, though.
Probably won't, though.