Inserting Custom Sound Samples

Exporting and Importing Samples from Other Games


This method is the easiest, and can be used to extract Direct samples from other games that use the Sappy engine. Meaning, if it can be opened with Sappy, it will work. You almost have to do nothing.


Open the ROM and song that you want to rip a sample from. Click on “Export sample”. In this example I want to rip the shakuhachi used in Kanbei’s Theme from Advance Wars 2. It’s instrument 77.

You’ll be presented with this window:

By default, that dropdown menu will have “raw” there, so change it to .s You can also rip it as a raw but it won’t do all of the looping for you, and the same would go for the wav ripping. Still, those options are available if you so choose. Sappy will actually rip all of the Direct samples from the current voice table whether you like it or not so in your file name you MUST include a $I so that you can identify which is the sample that you want. Like so:

It will then rip all the samples in the voicetable and you’ll be left with a whole bunch of files. I have outlined the one that I want. You can delete the rest or keep them, it really doesn’t matter.

[spoiler=Optional: Adjusting the frequency & loop via text editor]If you open the .s file in a text editor, you’ll get this:

#MAPLE EXPORTED SAMPLE - PLEASE CHECK THE HEADER VALUES!
#TONE NAME     : AW Shakuhachi 77
#FREQUENCY     : 13700096
#BASE NOTE#    : 60
#START ADRESS  : 0000000
#LOOP ADDRESS  : 0007993
#END ADDRESS   : 0009965

#LOOP MODE     : Fwd
#FINE TUNE     : 0
#WAVE EXP/COMP : 1
#VOL EXP/COMP  : 1

	.section .rodata
	.Global	AW Shakuhachi 77
	.Align	2

AW Shakuhachi 77:
	.short	0x0000
	.short	0x4000
	.Int	13700096 # THIS LINE FOR THE FREQUENCY ADJUSTMENT VALUE
	.Int	7993 # THIS LINE IS FOR THE LOOP POINT
	.Int	9965

And then followed by a lot of .byte commands. You might recognise the last section as… the sample header, in text form!

This eventually gets processed into the ROM. Any line beginning with # is ignored. There’s not an awful lot to see here except this one particular line:

	.Int	13700096

Later when you are inserting your sample with Sappy the “Change Freq.” box will be greyed out. However, you can actually edit that in this file here. This is useful if you know for a fact that the sample is an octave high/low so you can double (increase 1 octave) or half (decrease 1 octave) that number there in the text editor.[/spoiler]

Now you need to go to the ROM you want to import the sample to, and open it up to any song (it doesn’t really matter).

Click on Import Sample, and you’ll be given this window. Under “Import File Name”, browse and select your .s file. For Import Address, just import to free space in the ROM. As sound samples can be fairly big, make sure you have enough space in that area.

You can’t change anything else here unless you do as was outlined in the spoiler above, so hit “Import!”

Success! It even tells you where it finished writing.

Then, make sure you edit the voice table of your desired song to include the same address, shown here as 0x1239C94. Hit Update, and OK.

And you’re done! How easy was that?

2 Likes