• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

GoGo's MEGA-HUGE Sappy Tutorial

Did This Tutorial Help You At All?

  • Yes

    Votes: 55 53.4%
  • No

    Votes: 12 11.7%
  • I Don't Know

    Votes: 6 5.8%
  • I Didn't Read It Yet

    Votes: 30 29.1%

  • Total voters
    103

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
Hello, I'm gogojjtech and I'm here to make this tut on behalf of the community. Before we get started, I would like to ask you to download the TUT_FILES.rar right now, so you can understand as I go along.

There are two video tutorials on this, so if you'd like to watch them then here they are:






Things You'll need:
FSF or Advance Map's FSF
A Hex Editor
Sappy12.exe
Sappy.Xml
Sappy Mod 17.1
Mid2Agb.exe
MidFixforAGB.exe
MIDI FILE (My collection is in TUT_FILES.rar ;))
Anvil Studio
Wavosaur
Your Mind (you need this)

LET'S GET STARTED!!!
First

Open up Anvil Studio. In this tut, I might say A.S. but I just mean Anvil Studio. Get your MIDI file open.
Spoiler:

For this Tut, I will be using the HGSS version of the Kanto Gym Leader Battle, because it was the last song for me to do to complete my PWT script ;)
Now, all the experienced people around here know the games only read the first 10 tracks and 5 directsound tracks! People who don't know, the games read the instruments and cries as directsound, basically like your music. To get around the Directsound issue, follow this by Jambo51. LINK
For the track amount, I will explain a little later. Be patient :)

So you have your song, now you want to loop it! follow this to loop by Team Fail LINK
So you got that? Good (I hope)
If you already have Sappy working skip to 3

Second
For many of you on here including myself, Sappy requires a specific file by the name of VbalCboEX6.ocx to run. You will not find this on the internet (as of now) but I provide the solution. Download the sappy12.exe file from the beginning of this tut and open it. It will install the necessary components to run sappy. Once it's done... DELETE EVERYTHING EXCEPT THE MID2AGB FOLDER!!! Because that Sappy is old, I have the newest one (again at the top) for you to download. Move the new Sappy.exe you downloaded to the existing folder and the Sappy.Xml I provided. Now you have a WORKING sappy :)

Third
Now that Sappy is open, open your ROM. I will be using FR.
Spoiler:

You will want to click that little arrow from the pic for your own benefit. BUT WAIT!!! You need to assemble your song. Drag your MIDI file you looped ONTO mid2agb.exe and a popup will appear, then disappear. In the same folder, you should have two files now.
Spoiler:

In sappy, click the assemble song button. You should get this:
Spoiler:

Let me explain:
1. The offset you will place the data at. In FSF you should search for 10,000 bytes of free space just to be safe.
2. The voicegroup offset, where the pointers to instruments are located.
Open your song and press Cook it! Then wait for it to finish. Popup!
Spoiler:

Just click yes. Just...do it.
Now you have this or something similar:
Spoiler:

Try to play it in VBA. It sounds 8-bit, right? Well that's why this tut exists, to teach you how to make amazing music.

Fourth
I will explain it all.
Spoiler:

Ok, one by one.
Yellow Underline: This is the location of the track in the ROM.
Red Underline: Instrument number. Add one to it to see its number in A.S.
Green Underline: The force of the instrument. Usually this is not constant, but the more force the higher volume.
Light Blue Underline: It remains 100 in all tracks for fanfares and in the rest it ranges from 0-127 and changes. Ipatix says it's the actual track volume. More info here: http://www.pokecommunity.com/showpost.php?p=7654719&postcount=9
Dark Blue Underline: The "tuning" as I call it. Play Deoxys' theme and watch the squares, they change pitch. Also the cave themes do this.
Purple Underlines: Types of instruments. There are 7. Directsound, Multi, Drums, Wave, Square1, Square2, and Noise. Squares are beeps. You CANNOT have two of the same type of Wave, Square1, Square2, or Noise playing at the same time. Directsound, multi, and drums can be played together as long as you don't pass the limit. That's why I had you extend them earlier. Sappy keeps the limit 5, but in VBA you will hear them all.
Blue Circle: The top says Table, and this is the location of the pointer to the header. The header tells the game where the tracks are and what voicegroup to use. The voicegroup tells the game where to find the instruments.
Green Bars: The actual sound. If it's on the left, it comes out of the left speaker, and vice versa. In the middle means both speakers play it.

Now to make your song sound normal. Play your song and wherever it says square1 or square2 you need to change its pointer. I have instrument 23 (24 in A.S., or Tango Accordian). Click Edit Voice Table. Go to your instrument.
Spoiler:

You must be wondering what to do at this point. Change it to Directsound if you want it as a normal instrument (preferred). If your instrument has many different pitches, you need to choose multi. Let me do one thing at a time.
Atk: Attack - Attack determines the time it takes for the note to get to the maximum level.
Dec: Decay - Decay determines the time it takes for the note to go from the maximum level to the sustain level (controlled by Sustain).
Sus: Sustain - Sustain determines level the sound is played at while the note is held (after the other envelope states, Attack and Decay, have been completed).
Rel: Release - Release determines the time it takes for the note to fall from the sustain level to zero (silence) level when it is released.

Get it? The best results are 255 0 255 165, but that is from experience, so play around with it, or comment on what you like to use. Leave everything else because it distorts your instrument.

When you choose multi, you get prompted for an address 1 and address 2. The first is a pointer to your custom voicegroup.
DO NOT MISTAKE THIS AS YOUR INSTRUMENT.
The second is a pointer to your "MIDI Keyboard". This looks like:
Spoiler:

I will explain. This is loaded with the voicegroup you point to. In my picture, It says 0 - 0x10fea60
So instrument 0 in the custom voicegroup will be played. Every note highlighted in green will play this instrument. If you turn to 1, and high lite some notes, whenever those notes are played in the song, instrument 1 will be used, not 0. Using a multi instrument in your multi instrument freezes the game.
Drums are a bit different, but more confusing. It uses a custom voicegroup like the multi, but does not use the MIDI Keyboard. Here's what ipatix told me:

ipatix said:
The drum table works exactly like a regular voicetable but instead of using different instruments by different program changes of the song data they use different instrument depending on the MIDI key played.
The instrument definitions work all the same but know the "0x3C" byte (the second byte) is used in this case and defines at which MIDI-key-pitch the sppecified drum should be played at.

So in regular tables this value isn't used but seems to always be "0x3C" or "0x00" for some reason

Fifth
Ok, here's when we import our instruments we want into the game. You should have a sample of the instrument from anywhere. Open it in Wavosaur.
Spoiler:

You need to make a modification to it before inserting. Go to process -> Bit Depth Converter.
Spoiler:

Do everything I did. It should sound good in the GBA if you have it set to 8-bit, because the natural sound the GBA produces is 8-bit :)
Save.
Now in Sappy go to Import Sample.
Spoiler:

Open the .wav you have now.
Import Address: The offset to import. Remember to change it in the Voicegroup as well.
Change Frequency: Changes how long or short the instrument is. It also makes it higher pitched or lower pitched. More info: http://www.pokecommunity.com/showpost.php?p=7654719&postcount=9
Enable Loop: Where the instrument loops. Try putting this around a half so if you have a long note, the instrument doesn't just end. It loops.

Once you are done you have your instrument! :1:
Do this until you have no more squares.

Sixth
Play it in VBA. If you hear crackling, It's because your song is TOO LOUD.
There are two ways to fix this:
1. Open the MIDI in A.S. and lower the track volumes.
2. Thanks to Team Fail, I now know that there is another way to do this.
Team Fail said:
Open your .S file in a text editor, and look for the following line:
Code:
	.equ	name_of_s_file_mvl, 128
Change the 128 to something lower, this line controls the overall volume of a .S file. You can adjust this and change the volume without having to convert your song over and over again.
Now to extend the amount of playable tracks!!!
Open your ROM in a hex editor.
Go to the Songtable (check Sappy.Xml to find your songtable in your version)
Right before the songtable in the ROM there are a few RAM pointers. Look for the pointer that is right before the string "0x0A 0x00 0x00 0x00". The 0x0A byte is the amount of tracks the game will read. The max is 16 tracks (10 in hex). I put 0x10 0x00 0x00 0x00. BUT YOU NEED TO CHANGE THE POINTER DIRECTLY IN FRONT OF THIS STRING!!! Just leaving it causes the game to use the INCORRECT DATA. Make sure that your pointer right before the 0x0A has enough space in the RAM for your Y-Tracks * 0x50. So for 16 tracks you'd need 0x320 bytes at your new RAM area. You should use the RAM at 0x03004308, as it has so much space. In FR US v1.0 the RAM pointer is located at 0x084a32a0. Change it and you are good to go!
The result is in TUT_FILES.rar called KantoGym.gba.wav
(I faded it out with Wavosaur ;))

Getting Sounds From a DS ROM
Ok, so I admit. Kantogym.wav wasn't exactly perfect material. But that's because I used non-DS sounds. Here I will teach you exactly how you can get those sounds, or those MIDIs that you want.
Get this tool called VGMTrans. LINK
This tool lets you extract sounds and songs straight from your DS ROMs. Problem is, Mystery Dungeon ROMs don't work on any DS sound extracting tool around. :(
So here's where people get confused. You open VGMtrans manually, and drag your ROM INTO the program where the gray box is.
So while that loads, keep in mind that it crashes very often. So do what you need to do and do it fast. So first, you find your song. You can even play it with the play button on top. Once you found what you're looking for, you export it.
Spoiler:

That Cyan arrow shows what song I'm using. The pink shows the song's MIDI. Right-Click to export. Save wherever. Now that dark blue arrow contains the "SoundBank". This is basically a DS voicegroup. Save wherever. Ok, so you have your DLS and MIDI. So as normal, loop the MIDI and convert to .S, lower volume if you need to, WHATEVER. Import into Sappy, and BAM! It's in. Now for the sounds!
Download this tool called "Viena", it opens the soundbank. LINK
Open your soundbank .DLS file.
Spoiler:

That green line shows the instruments with their corresponding numbers. Double-clicking them will take you to the info screen.
Spoiler:

The red arrow contains the samples. In this case, there are multiple samples. You know what that is, it's a multi instrument!
The pink has the instrument data. 0-42 shows that keys 0-42 will play this instrument. sample loop = 1, which means that it does loop. otherwise, no. Root Key = 40. This is used to determine that stubborn frequency.
Here's an example of a single instrument, our "directsound".
Spoiler:

Cyan shows you only one instrument. The blue again, contains it's data. 0-127 obviously shows that it's used all the time. It loops, and the Root Key is 79.
I know what you're thinking. How exactly do we know the loop point? Well...
Spoiler:

Right there, you have your loop point. However, I should point out that HG/SS have incorrect loop points, so you need to look at the wave itself and determine. You can do that by double-clicking the instrument on the left.
To find frequency, you need a tool made by Ipatix. LINK
That Root Key is crucial in finding your frequency. So you get your instrument's samplingrate from either Sappy or Viena. Double click the instrument to know what I mean.
Spoiler:

The green is the sampling rate. The red is always incorrect, you found this earlier. The blue exports your wav so you can import it into Sappy later.
So input your info in the frequency calculator:
Spoiler:

For Fine tuning, all Pokemon games so far have 0 for each instrument. When copying your result, just keep the first 3 numbers after your decimal point. No need for anything else, since Sappy just reads the first 3.
Spoiler:

Also, if your Root Key isn't shown in Viena, it's 60, and 60 requires no change at all to your frequency. So if it's 60, don't bother putting it through the calculator.

So you import to Sappy.
Spoiler:

That's for single instruments. Then you edit your voicetable and Change to directsound, then follow like earlier.
For multi instruments, look closely.
Spoiler:

The left is the one being viewed. Top right shows which pieces of the multi's keyboard use this instrument. 0-48. This one loops and has a sampling rate of 41. The loop is 4264.
So import, blah blah blah. So now you want to make it a multi, it's keyboard needs to know which is which. The 0-48 is used now.
Spoiler:

I'm using this area. 0-48 is actually 49 numbers. So I usually just add one to the amount it says. So you select 49 bytes:
Spoiler:

And you fill with 00, since the first instrument is actually 0.
Spoiler:

So for instrument 01, it's 49-127. So that's 79 bytes.
Spoiler:

And fill with 01 this time:
Spoiler:

That's part2 of the multi, where it's a MIDI keyboard. Now you create a small voicegroup for it to load. Oh, you should be keeping a log of where everything is.
Spoiler:

Now you make the Multi. Sappy -> Edit Voicetable -> (instrument number) -> Multi Instrument
Spoiler:

Edit address1 to the way you would set up a normal voicegroup, just in the order Viena gives you. So Instrument 0 goes at slot 0, 1 at 1, so on. Same with Drums, just put them where Viena lists them. Edit to your liking:
Spoiler:

And Save. Continue to do those steps to make it sound good. Also, if in Viena you click your instrument and it only says "global" but contains no instrument, it could be either square1, square2, or wave. Your choice!
Well, that covers just about everything...


You can make sappy play more than 5 tracks at a time.
Click Options -> Settings -> Extra
Directsound voices limit = 5
Change to 12 since the extension supports 12 (or 7 for RS)
You can change other stuff too but whatevs.


Credits
ipatix - Track extension, teaching me about the drums and multi instruments
Jambo51 - Directsound extension
gogojjtech(me) - For teaching myself about a third of the stuff on here
Team Fail - His Tut on how to loop and for the alternate lower volume trick

Ok, I hope you have been helped, if you have any questions VM or PM me. Good Day. PEACE
 
Last edited:

Akiba

[img]http://i.imgur.com/o3RYT4v.png[/img]
4,262
Posts
12
Years
I've been waiting all night for this to come out. Great job, gogojjtech.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
I saw this and I thought I'd correct it. It's a neat little feature that is in .S files.



Another way to do this, is to open your .S file in a text editor, and look for the following line:
Code:
	.equ	name_of_s_file_mvl, 128
Change the 128 to something lower, this line controls the overall volume of a .S file. You can adjust this and change the volume without having to convert your song over and over again. Otherwise, you have a very good tutorial coming along here. It'll probably need a bit of touching up here and there with the release of newer programs and whatnot, but you definitely have a good start.

Thank you Team Fail, I didn't know that. I will add it up.
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
I would suggest instead of Wavosaur, use Audacity since it is a far more common program that many use for non-ROM hacking purposes, so chances are people are more likely to have it. It works, because some of the custom instruments in my hack had samples I edited with Audacity.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
I would suggest instead of Wavosaur, use Audacity since it is a far more common program that many use for non-ROM hacking purposes, so chances are people are more likely to have it. It works, because some of the custom instruments in my hack had samples I edited with Audacity.

I guess it's their choice, I chose to use wavosaur. You guys can do whatever you want, as long as it sounds good! Anyone have suggestions? Anything I need to add up?
 

ipatix

Sound Expert
145
Posts
15
Years
Light Blue Underline: I'm not entirely sure, as it remains 100 in all tracks for fanfares and in the rest it ranges from 0-127 and changes.
By the way: This shows you the current volume level that is set by the MIDI data.
It is not the same as the "force". The force already counts in the note-velocity and the envelope of the instrument. So bascally it's the master volume of the current track.

Import Address: The offset to import. Remember to change it in the Voicegroup as well.
Change Frequency: Changes how long or short the instrument is. It also makes it higher pitched or lower pitched.
Enable Loop: Where the instrument loops. Try putting this around a half so if you have a long note, the instrument doesn't just end. It loops.
The main goal of the "Frequency" is to adjust the pitch of your sample. Type in the samplingrate of your sample for the middle-C on your MIDI-keyboard to get correctly pitched notes. The length adjust is just a side effect of the frequency adjustment because for getting higher pichtes the audio data has to get played back faster than regular.

Just using the half length will work but in most cases it won't sound very nice.
The reason for that is that your waveform may look like that each time it loops:
ScreenShot%20036%20Viena%20SoundFont%20Editor%20%280.940%29%20-%20C__Users_michael_Sounds_Musical%20Box.sf2.png

See that little jump at the red line?

When this occurs you are gonna hear a "pop" sound each time the sample loops, so make sure when the sample loops your loop start matches the end of your sample.

And the last thing: I don't recommend applying dither to new sounds of your ROM. The reason for that is that dither is "smoothing-noise" and for my experience it usually causes more output noise, specially when using many digital instruments.

This could be eventually be helpful for other people so feel free to add this information to your tutorial.
But anyway, you did a great job on this tutorial ;-)
 
Last edited:

Wobbu

bunger bunger bunger bunger
2,794
Posts
12
Years
I'm having some problems with understanding how to loop.
This is what my loop overlay looks like:

Spoiler:


And here are the sample parameters:

Spoiler:


And when I adjust the loop start parameter, I still get this:

Spoiler:


How do I get the overlay to appear more like this?

Spoiler:
 

ipatix

Sound Expert
145
Posts
15
Years
Well I used some really high quality samples with high samplingrates.

In your case which is unfortunatley the "more common" case this is a little more tricky.
Try to find 2 positions in your sample that look the most same and try to set loop start and end. If your waveform has a smooth transition you are fininished but you still have to truncate your sample to your loop-end because the AGB does not differ loop-end and end-of-sample.

PS: If you still have some trouble: Could you please upload the .wav of your sample?
 

Wobbu

bunger bunger bunger bunger
2,794
Posts
12
Years
Thank you, I understand what you're saying, but I'm still having an issue with finding similar loop points.

I have many samples that I want to import, but I'll use the first one:

Code:
[ATTACH]68289[/ATTACH]

By the way, that instrument isn't actually an Acoustic Grand, I just did that for Anvil Studio purposes.
 
Last edited:

ipatix

Sound Expert
145
Posts
15
Years
@jsziede:
I found out that for the loop start 590 and for loop end 926 work really well.
If you want to just delete everything after the loop end. You won't need that.
 

Wobbu

bunger bunger bunger bunger
2,794
Posts
12
Years
@jsziede:
I found out that for the loop start 590 and for loop end 926 work really well.
If you want to just delete everything after the loop end. You won't need that.

Ah, thank you very much. I've looped the other samples for that instrument and now the whole multi sounds perfect.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
Ipatix, where did you get your instrument samples for the DP on Emerald?
 
12
Posts
10
Years
  • Seen May 7, 2014
Great tutorial, it solved some errors I had before.

Now when I want to assemble a song any .'s file. Some downloaded or some Example songs that are in the Mid2Agb folder by default, when I want to press Cook it. It will turn in the error:

runtime error '-2147418105 (80010007)'

and/or Sappy 2006 has stopped working.

Does anyone know how to fix this?
I can listen the songs in Sappy that are in the rom by default, but whenever I wanna assemble it, it errors me.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
If the name of the file has spaces or numbers it thinks the name is a sappy command, therefore it glitches up. Also some .s files in the mid2agb folder are progaming files and they are NOT songs. Or you did not press "export to MIDI FILE from anvil studio. Just saving it doesnt make it readable by mid2agb.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
Can I get a Working version of VGM Trans? Mine doesn't load any ROMs.
 
Back
Top