Language…
13 users online:  AmperSam, dotCoockie, itsmefigs, JezJitzu, Maw, playagmes169, PMH, Serena, signature_steve, Sparkz314,  Telinc1, timothy726, toady - Guests: 261 - Bots: 317
Users: 64,795 (2,377 active)
Latest user: mathew

Sample Tool Tutorial

  • Pages:
  • 1
  • 2
Inserting and creating sample banks aren't as hard as some people make it out to be. It's really quite simple. ...so yeah, I'm awful at introductions, and here's the table of contents.

Table of Contents


  1. Getting Started
  2. Inserting Others' Custom Banks
  3. Creating Your Own Banks
  4. Troubleshooting



Getting Started



There are a few things you'll need to do this. First off, you'll need a modified SMW ROM. Second, you'll need Sample Tool, which you can get here. And while not technically required, it would be pretty foolish to not have some version of Addmusic as well, along with a song that requires a sample bank. For the purposes of this tutorial, I'll be using Romi's Addmusic, along with this song, which I am shamelessly self-promoting.:P

Minor note: This tutorial will not cover inserting songs with Addmusic. A song that requires a sample bank requires nothing different to be done in Addmusic than with a song with no such requirement, so it will not be covered.

First step: Download Sample Tool and put it in a folder somewhere. It doesn't have to be where your ROM is, but if everything is in a centralized location it makes it easier. With your ROM modified and your custom song inserted, open it up with Sample Tool. You will see two message boxes pop up:




Just press OK for both of them. The actual interface will appear, and will look like this:


The interface works like this:

  • Location: This is the level number or overworld map number that will use the custom bank specified with the below option. In parentheses it shows the current bank being used by that level.
  • Available: Lists all the custom banks that currently exist in your ROM. It is also the sample bank that will be used in the level specified above.
  • Editing: This is the sample bank that you are currently modifying.
  • Sample: This is the sample that you are currently modifying.
  • Free: This specifies the bank number that will be used when you create or insert a new sample bank.
  • Mode: Whether you are modifying the sample banks of levels or the sample banks of overworld maps.
  • Playback: Used to hear what the current sample selected under Sample sounds like at the specified frequency. Note that some samples, like 0, for example, are too short to hear. Also note that this will not affect how the sample sounds in-game.


I will explain all of these in much more detail when we get to them. Just refer back to this if you need a brief reminder of what everything does.

So without further ado, let's get to inserting a custom bank!




Inserting Others' Custom Banks


If you've tried inserting the song I gave you into your ROM, you've probably noticed that it sounds...pretty bad. Orchestral hits don't make a very good melody. This is where inserting a sample bank will come in handy. It will replace some samples, like the orchestral hits, with other samples, like a string instrument. To accomplish this, first choose a free bank by clicking on the drop-down list next to the label marked "Free:" Choose any one you want; for this tutorial, I'll use 13. Now click on the "Import From File" button, and locate the sample bank you want to use. The custom bank is now inserted into your ROM.

The next step is to click the drop-down box next to the label marked "Location:" and select the level that will use this custom bank. Now click on the drop-down box next to the label that says "Available:" and select the sample bank number you inserted your sample bank into. Now click "Save Bank," then go to File -> Save. If you've done everything correctly, and I haven't screwed up my instruction, then congratulations! The song will now sound correct, but only in the levels with the custom bank inserted. Just repeat these instructions for any other levels you want to have a custom bank.



Creating Your Own Banks



This section is for those who are creating their own song and need some awesome samples to go with it, in case existing sample banks just won't do the trick.

Creating Samples



There are two methods to inserting samples. The easiest way is to rip them from .SPC files, so I'll cover that first. The first thing you should do is find a song that uses a sample that you want. Once you've done that, in ZSNES, press F1 and choose "SAVE SPC DATA." This will create an .SPC file in the same folder as the ROM you used. Now, in Sample Tool, select a new bank and click "Create From Original." This will create a new sample bank that is identical to SMW's original one. Now, under sample, you'll have to choose a sample to overwrite. 07 is safe to use if you're not using SMW's default ending music, 0A is safe to use if you're not using SMW's default death music, 12 is safe if you're not using Yoshi, 13 is safe if you're not using thunder, and 10 is safe to use if you're not using the default P-Switch music. 09, 0C, 0D, and 11 are all unconditionally safe to use. Remember that once you overwrite a sample, you cannot use it's original data in that bank, since it will be a different instrument. So if you change sample 12, the orchestra hit, to a string instrument, you will not be able to use any more orchestral hits in that song.

Once you've selected a sample to overwrite, press "Delete" and then "Insert SPC." Locate the SPC file you dumped earlier and open it. The following dialog box will appear:



"Sample" is the sample number you want to put in your bank.
"Playback" is used to preview the sample.
"Insert" or "Insert looped" is used to insert the selected sample.

Now scroll through the different samples in your song until you find the one you're looking for (verify by pressing the play button for each sample). Then press "Insert" or "Insert looped" to replace your old sample for this new one. At this point, you may run into a problem. If a sample is too big, there may not be enough room in your sample bank to insert it. There are two things you can do to fix this. The first is to delete any samples you aren't using (but remember that most of SMW's original samples shouldn't be deleted with the exceptions listed above). The second thing you can do is instead of creating a new bank from SMW's existing one, you can import this sample bank, which sounds almost identical to the original, but uses a lot less space. Now that you've inserted your sample, press "Save Bank" and then go to File -> Save.

If the sample you want to use can't be found in an .SPC file, you've just been limited greatly. Your other option is to use a .WAV file, but this comes with two restrictions. The first is that they take up a bit more space than .SPC files in general, partially due to this next reason: .WAV files can't be looped like .SPC samples. Well, okay, they can, but it seems like not a single person here knows how to do it. If anyone out there knows how that works, tell me, and I'll update.

So it's up to you to find a non-looping .WAV file to insert. Once you've done that, inserting a .WAV file isn't much different from inserting a .SPC sample. But instead of pressing "Insert SPC," just press "Insert." That's about it for .WAV samples.

Using Those Samples



What good are samples if you don't know how to use them? Here I'll show you how to take advantage of your newly acquired instrumental capabilities.

You may have noticed that there are more instruments than samples in SMW. This is because some samples are used more than once with different effects applied to them to make them sound different. However, this also means that, for example, sample 12 isn't instrument @12. Gee, if only there was some sort of chart that could show you what instruments used what samples...oh wait!

_________________________________
| Sample # | Used by instruments |
|----------|---------------------|
| 00.......| @0..................|
| 01.......| @1, @11, @18........|
| 02.......| @2..................|
| 03.......| @3..................|
| 04.......| @4..................|
| 05.......| @8 .................|
| 06.......| @22, @23............|
| 07.......| @5..................|
| 08.......| @6..................|
| 09.......| @7..................|
| 0A.......| @9..................|
| 0B.......| @10, @26, @27, @28..|
| 0C.......| @13, @16............|
| 0D.......| @14.................|
| 0E.......| @24, @25, @29.......|
| 0F.......| @21.................|
| 10.......| @12.................|
| 11.......| @17.................|
| 12.......| @15.................|
| 13.......| None!...............|


So if you were to replace sample 12, you'd have to use instrument @15 to get it to play in your song. Note that this table does not apply to sound effects, since they seem to use a different sample/instrument table.

One thing you may have noticed is that each sample is tuned differently in-game. It can become very annoying to have to adjust your songs to account for each instrument's unique pitch. So to fix this, we have a new version of MORE.asm and MORE.bin. This allows the use of any sample, so you can control exactly how it is tuned instead of having SMW do it for you. To take advantage of this, you must insert a sample at a value above 13. Any value should work. Now, since values above 12 don't have an instrument assigned to them, you'll have to use a special hex command to use them in your song. That command is $E5 $XX $YY. $XX is your sample number + 80, so sample 15 would be $95, sample 20 would be $A0, etc. $YY is how the sample should be tuned. Each value up or down is three semitones, so every four values you increase by one octave. It is intuitive enough, and means that you don't have to overwrite any of SMW's original samples (unless you need more sample space.)

Now, here's a few tips when you're using the $E5 command.
  • You don't have to redefine things like drums for every note. This also applies for non-$E5 samples as well. Remember this, since it will save a ton of space.
  • If you're making your own sample from a .WAV file, record it playing note F, instead of C as you might expect. Then use $E5 $XX $04.
  • $EE $FF can be used to tune up a single channel by one semitone. $EE $00 will reset it. Note that if you place this on a sound effect channel, it will tune up the sound effects as well!
  • $E4 $FF can be used to tune down the entire song by one semitone. $E4 $00 will reset it. You'll have to place $EE $FF on every channel that shouldn't be tuned down to offset the change.


One last tip: remember that there is a tuning command built into Addmusic. It works like this: tuning[x]=y. X is the instrument (instrument, not sample!) that should be tuned up or down by Y semitones. A negative value means the tone increases, a positive value means it decreases. So if you need, for example, sample 20 to be one semitone lower, do something like this: (The two instrument values can be pretty much whatever you want, not just what I use.)
Code
tuning[1]=1

@1 $E5 $A0 $04 
(The note data here is tuned)

@0
(The note data here is not tuned)

$E5 $A0 $04
(The note data here is not tuned)

@1
(The note data here is tuned)



You're essentially fooling the program into tuning that section of music even though it's not playing the instrument it thinks it is. Remember that for this to work, you'll have to put @1 (for this example) before every instance of $E5 $A0 $04, otherwise Addmusic won't tune it!

Major note:

The tuning[] command is not applied in-game, it is something Addmusic applies by itself. It actually changes the notes and then inserts those newly tuned notes into the ROM. So if you put in f16 and tuned it down one semitone, it would be inserted into the ROM as e16. Which brings me to my next example: (ignore potential octave issues here; Addmusic deals with them automatically.)

Code
tuning[1]=1

@1 $E5 $A0 $04 
(1)[c1c1c1c1]      ;Addmusic inserts b1b1b1b1 because of the tuning command.

@0
(1)                ;Even though the instrument changes, Addmusic still inserts b1b1b1b1, because the data in label (1) was tuned down.

@2 tuning[2]=2
(1)                ;Addmusic still inserts b1b1b1b1, since that's the note data in label (1).



Hopefully you understand what's happening here. Addmusic tunes down label (1) so that it now contains the notes b1b1b1b1. The tuning commands I put after label (1)'s definition won't affect what's in label (1), since what's in label (1) cannot change.



Troubleshooting



Problem: The samples I inserted aren't playing!
Possible solutions:
  • Did you select the correct level for your custom bank?
  • Did you select the correct custom bank for your level?
  • Did you press the "Save Bank" button?
  • Did you go to File->Save?
  • Are you using the right ROM?
  • Does your custom song actually use custom samples?
  • Did you use Sample Tool?


Problem: My samples sound out of key!
Possible solutions:
  • Did you misuse the tuning[] command?
  • Did you misuse the $E4 command?
  • Did you not use the tuning[] command?
  • Did you not use the $EE, $E4, or $E5 commands?
  • Are you using the right ROM?


Problem: My ROM crashed!
Possible solutions:
  • Retry using a backup.
  • If you didn't save a backup, hop in your time machine and make one.
  • Are you using the right ROM?


Problem: how do i inserted samples
Possible solutions:
  • Did you read the tutorial?
  • Are you using the right ROM?


Problem: u suck an ur tutorial suks.
Possible solutions:
  • Are you using the right ROM?


That's all, folks! If there's something I'm forgetting (besides looped samples), something I'm missing (besides looped samples), or something I didn't explain well enough (besides looped samples), feel free to ask away here.


Mod edit: Fixed table stretch.
ive been asking the question of how the looped samples and range feature worked for a long time now and my heart sang when it saw sample tool tutorial then dropped when you said nobody knows how.
anyway the tuning command addmusic has, is it romis addmusic only?
speaking of which, why can some songs only seem to work with carols addmusic, oh well, another time i guess.

and to make sure im getting this, the tuning command
tuning[1]=1 with this, instrument 1 is @0? is each instrument just 1 number higher then its normal assigned value? or just the number in order from 1-8 in channel wise?
Originally posted by omegazeroINFI
ive been asking the question of how the looped samples and range feature worked for a long time now and my heart sang when it saw sample tool tutorial then dropped when you said nobody knows how.


Yeah, sorry about that...but I've also asked multiple times, and honestly the only headway I've made is finding out that the Loop Start text box controls where the looping point of the .WAV file is. I just can't get it to work correctly.


Originally posted by omegazeroINFI
anyway the tuning command addmusic has, is it romis addmusic only?
speaking of which, why can some songs only seem to work with carols addmusic, oh well, another time i guess.


As far as I know the tuning command works with all Addmusics, but if someone can confirm this I'd be thankful.

Originally posted by omegazeroINFI
and to make sure im getting this, the tuning command
tuning[1]=1 with this, instrument 1 is @0? is each instrument just 1 number higher then its normal assigned value? or just the number in order from 1-8 in channel wise?


...crud. I screwed up that part. I'll go and fix it. tuning[0] would tune instrument @0, tuning[1] would tune @1, etc. That was a typo on my part.
I should get a new layout.

Probably won't, though.
Originally posted by Kipernal

...crud. I screwed up that part. I'll go and fix it. tuning[0] would tune instrument @0, tuning[1] would tune @1, etc. That was a typo on my part.

and thats why you got faithful readers who will ask questions when they dont get something #w{=3}
turns out that we both seem to know the same stuff about the looped wav samples,
i guess if i got time to spare, ill get off my lazy ass and pm everybody who ports music if they know how
mess around with it until i get somewere.
I added a very important note about the tuning[] command if anyone wants to take a look. It involves how it affects label looping. Or more specifically, how it doesn't.
I should get a new layout.

Probably won't, though.
Yes. Really, you should be using those instead of replacing the already existing ones.
I should get a new layout.

Probably won't, though.
Originally posted by wiiqwertyuiop
Ok and what instruments do they use?


Originally posted by Kipernal
One thing you may have noticed is that each sample is tuned differently in-game. It can become very annoying to have to adjust your songs to account for each instrument's unique pitch. So to fix this, we have a new version of MORE.asm and MORE.bin. This allows the use of any sample, so you can control exactly how it is tuned instead of having SMW do it for you. To take advantage of this, you must insert a sample at a value above 13. Any value should work. Now, since values above 12 don't have an instrument assigned to them, you'll have to use a special hex command to use them in your song. That command is $E5 $XX $YY. $XX is your sample number + 80, so sample 15 would be $95, sample 20 would be $A0, etc. $YY is how the sample should be tuned. Each value up or down is three semitones, so every four values you increase by one octave. It is intuitive enough, and means that you don't have to overwrite any of SMW's original samples (unless you need more sample space.)
I should get a new layout.

Probably won't, though.
Didn't there used to be a link to 'Optimize.bnk' in the first post?
I really need it for any endeavors I might have.

Never mind. I found it. (facepalm)
Check out my music!
It's in the SPC/Sample Bank showoff thread afaik.
Your layout has been removed.
I tried to download it, but the link is broken
I've updated the link, but you could have also just gotten it from the tools section.
I should get a new layout.

Probably won't, though.
When i open the ROM in SMWS tool, i get this message that says:

"Point to 1KB of free space to allow the program to install a hack. A RATS tag is automatically generated and you will only be prompted for this once. Input a headerless PC address in hex"

What does this mean?
Just so you know, I'm very active on the site anymore like I was before; I'm mainly on Discord now.
It means that you need to input a freespace address in PC format with at least $1000 bytes of space. You can use the free space logger to easily find one.

EDIT: Although since it wants a headerless address, I assume that you should subtract $0200 from the address the free space logger gives before entering it.
My YouTube channel
Get the official ASMT resource pack here!

Originally posted by yoshicookiezeus
It means that you need to input a freespace address in PC format with at least $1000 bytes of space. You can use the free space logger to easily find one.

EDIT: Although since it wants a headerless address, I assume that you should subtract $0200 from the address the free space logger gives before entering it.


I put that in, but it doesn't work. How come?

Also, do you need to know how to set freespace to do this? If so, then i can't do this... :(
Just so you know, I'm very active on the site anymore like I was before; I'm mainly on Discord now.
Originally posted by Falconpunch
When i open the ROM in SMWS tool


There's your problem; you're using an outdated version of the tool. It's now called SampleTool (which the tutorial name should have tipped you off to), and can be downloaded in the Tools section.
I should get a new layout.

Probably won't, though.
Originally posted by Kipernal
Originally posted by Falconpunch
When i open the ROM in SMWS tool


There's your problem; you're using an outdated version of the tool. It's now called SampleTool (which the tutorial name should have tipped you off to), and can be downloaded in the Tools section.


Ooohh, i was using sampletool 0.53.

Is SampleTool 2.0.0.5 the newest version? If so, then i'll try again.

EDIT: Oh, it's in the first post of this thread. I'll use that.
Just so you know, I'm very active on the site anymore like I was before; I'm mainly on Discord now.
Just a quick question, what's sample 13 for?
Hacks:
Originally posted by Coolmario
Just a quick question, what's sample 13 for?


Mostly thunder sound effects. It's usually safe to overwrite.
I should get a new layout.

Probably won't, though.
  • Pages:
  • 1
  • 2