JimmyKazakhstan's 5 Minute Custom Music Tutorial for Super Mario World


Intro


I've always wanted to make custom music for this game, but the process for doing so (at least the default one) has always confused me. But after trying various different methods, I've managed to find a quick and simple way to do it. I tried to simplify the process to the best of my ability so that you can easily follow along.

Unfortunately, the site rules prevent me from adding images to this tutorial which complicates things, so I will try my best to explain the process using only text.

I apologize if some of my sentences aren't grammatically correct, I often have trouble finding the right wording needed to describe complex processes.




What You Need

- OpenMPT - Download
- IT2AMK - Download
- midi2smw - Download
- AddmusicK (AMK) - Download
- SNES SPC700 Player - Download
- A midi file with 8 channels or less.
- A soundfont (SF2/DLS).


One Time Setup

Before you start this tutorial, you will need to complete the following steps:

1. Extract the contents of IT2AMK into your AddMusicK folder.

2. Edit the it2amk.bat file to the following:
Code
for /f "tokens=1,* delims= " %%a in ("%*") do set ALL_BUT_FIRST=%%b
set file="test.it"
start /b /wait python it2amk.py %file% %ALL_BUT_FIRST%
start /b /wait AddMusicK music.smc
cd C:\(AddMusicK folder path)\music
del test.txt
ren *.mml *.txt


3. Extract the contents of midi2smw to a folder of your choice.

4. Download and install OpenMPT.




The name of the song I will be using for this tutorial is simply "test."


Part 0: Info


This is simply a tutorial on how to create a custom song.

midi2smw only converts Note On/Off events, so I could not make a point of reference to study how things like Pitch Bends, Panning Events, and Portamento Slides work. So nothing of the sort will be covered in this tutorial.



Part 1: The Midi

This tutorial requires a midi to be used. It can be one of your own creation if you want. I'm considering writing a section on sampled audio for this tutorial in the future. This tutorial makes use of sampled audio, but not as extensively as it would be in the hypothetical section of the tutorial.

The midi must be 8 channels or less. If it isn't, you may have to delete some parts of it.

The less drum parts, the better.


I'm aware that multiple samples can be played on the same channel, but the process of doing so was too complex for me to understand, I couldn't manage to get it to work, so in this tutorial, each drum track will be on its own channel.

ex: Snare on Channel 1, Hi-hat on Channel 2, etc.



Part 2: Song Setup

Drag the midi you want to use into OpenMPT, it will create a sequence and split each instrument.

After you do that, click the "General" tab and look for a property box labeled "MPTM (OpenMPT)"

Click on it and change the type to "Impulse Tracker IT". Make sure to set it to 8 Channels.

After completing the previous step, press F6.





Part 3: Soundfonts

When you've found a soundfont that you wish to use (a sf2 or dls file), drag it into the top left window of OpenMPT.

You can do this for multiple different soundfonts if you want.

Part 4: Replacing Instruments

Go into the instruments tab.

Find an instrument that you want to change.
(To change the instrument number, increase the value in the small box on the left of the instrument name.)

Open the "Melodic" folder of the soundfont(s) you dragged into the top left window.

Click on every listed instrument and press the space bar, this will play it back to you. Do this for each instrument until you find one that you like.

When you find an instrument that you want to use for the song, drag it to the bottom of the instruments window, this will replace the old instrument with the new one from your soundfont.

Press F6 to hear the result.




Part 5: Sample Assignment

This part is required due to the reason listed in Part 1

In the patterns tab, find channel that uses the instrument that you just replaced and find the very first note that it plays.

 
 
example : |G-5|01|v64

The 1st value is the pitch of the note.
The 2nd value is the instrument number.
The 3rd value is the volume at which the note is played.

For this example, the very first note that the instrument plays is "G-5"

Go into the instruments tab and find the "Sample Map" on the far right.

Since the first note the example instrument plays is "G-5," I would find "G-5" in the sample map.

Once you do, right click on it and select "Map all notes to sample XX".

Do this for all of your instruments unless they only have 1 sample.




Part 6: Drums

Repeat all of the steps from Part 4, except this time, you will need to open the "Drum Kits" folder.

MAKE SURE THAT ONLY ONE DRUM INSTRUMENT IS USED PER CHANNEL!



Part 6.5
Once you've finished replacing all of the instruments to your liking, click on all of the following:

Edit > Cleanup > Remove all unused stuff > Rearrange > OK > Yes (if it pops up)

File > Automatic Sample Trimmer.
(If any samples can be trimmed, answer the prompts with "Yes").





Part 7: Downsampling

Open the folder with your song name. It will be at the very top of the top left window.

Open the "Samples" folder.

COMPLETE THIS STEP FOR EVERY LISTED SAMPLE:

Click on the sample. It will take you to the "Samples" tab.

In the Samples tab, Press Ctrl+R.

Select "Downsample"

Set "Filter" to "Linear (2 taps)"

Press "OK"

(Only do this once, unless you get an error later on, in which case, repeat this process a second time.)

Part 8: Sample Ordering

THIS STEP IS VERY IMPORTANT!

Rename all of the samples in your song's "Samples" folder to match the name of the instrument they're linked to.

Open the "Instruments" folder.

Adjust the instruments so they match sample order by dragging them on top of one another.

ex:
Samples:
Sample 1 - Instrument Name 1
Sample 2 - Instrument Name 2
Sample 3 - Instrument Name 3

Instruments:
Instrument 1 - Instrument Name 1
Instrument 2 - Instrument Name 2
Instrument 3 - Instrument Name 3


Part 9: Exporting

Save As > .it (Save your song as a .it file in your AddmusicK folder and name it "test.it").

File > Export as Midi (Save it into your midi2smw folder and name it "test.mid").

In your AddmusicK folder, launch "it2amk.bat" and press the Enter key after the operation finishes.


Part 10: Editing

Open the "test.txt" file located in /AddmusicK/music in Notepad++ (or whatever text editing program you use).

Highlight everything after "w255" (Don't highlight "w255" itself) all the way to the end of the file and delete it.

Open your midi2smw folder.

Edit the contents of the .bat file within to the following:
 
midi2smw_x64 -samples test.mid

then save.

Run the .bat file

When the program asks for samples, enter the number "30" and increase the value by 1 each time until the prompts stop, after which, press q.

Open the "output.txt" file in the midi2smw folder in Notepad++ (or your preferred text editing program).

Highlight "w255" and everything after it (Including "w255" itself) all the way to the end of the file and copy it.

Then go back into text.txt and Highlight everything starting from "w255" to the end of the file and paste the data you copied, then save the file.

Add the following text to the top of the file. Fill in the fields to match your song:

 
 
#amk 2
#SPC
{
    #author  ""
    #title   ""
    #game    ""
    #comment ""
}



Above "w255" in "test.txt", add the following line:
 
#option TempoImmunity


Add
 
#option NoLoop

in addition if you do not want the song to repeat.

Finale


Launch AMKGUI (or any of the other variants of AddMusicK), select "Add new song", and select the .txt file of your song in the "music" folder.

Select "Run" and select your rom.

If it worked, you'll get a message saying it was a success.

Open the SPC folder and find the .spc of your song and load it into the SPC Player to see if it worked!


ISSUES


Issue: Notes/Samples cut off before another plays.
Example: https://bin.smwcentral.net/u/51923/DC_1_CH.spc


Explanation: This will occur if you put multiple samples that are meant to naturally transition between one another into a single channel.

Solution:
You will need to create a new channel for this, if your song already has 8 channels, this solution will unfortunately not work.

In OpenMPT, right click on the channel that houses the instrument that is causing this problem and select Add Channel > After this channel.

Here is a visualization. This is how the pattern in the Example SPC looks. Everything is all on one channel, causing the note to cut off just before playing the next sample.

|C-5|01|v64|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|C-5|02|v64|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|C-5|03|v64|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|C-5|04|v64|...........


In order for the song to play properly, you need to make the pattern look like this:

|C-5|01|v64|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|C-5|02|v64.
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|C-5|03|v64|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|...........
|..........|C-5|04|v64.


To move the notes, highlight the entire row and drag it onto the next channel.

This will cause the notes to properly transition.

Result SPC: https://bin.smwcentral.net/u/51923/DC_2_CH.spc







Issue: Echo buffer exceeded total space in ARAM by 0xXXXX bytes.

Explanation: This means that your song is too big in size to be inserted into the rom due to the sample sizes.

Solution:
Open your test.txt file in Notepad++ and then Repeat the steps in Part 7 for all of your samples and save the .it file.

After doing so, run it2amk.bat again, but click "No" when Notepad++ asks you if you want to update test.txt

After that, make an edit to test.txt, revert it, then save the file.

Once that is complete, repeat the steps in the Finale

If that still throws an error, repeat this process again.