The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Emulation & ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
New threads in this forum are to be approved by a moderator before they are displayed. The thread revival limit does not apply here.


Reply
 
Thread Tools
  #1    
Old November 27th, 2010, 12:06 AM
3dd13's Avatar
3dd13
Advanced Music Remixer
 
Join Date: Oct 2008
Location: Alabama! The Heart of Hell!
Age: 22
Gender: Male
Nature: Lonely
Send a message via Windows Live Messenger to 3dd13
well, it didnt take me too long. on top of everything that has been reasearched i made a minor discovery that i though should be listed.

ok, the ds sseq file that is responsible for sound contains 3 types as you already know. that is the sseq, or sequence (aka midi) the sbk or soundbank, originaly though to be a soundfont like clone, and the sample files in a wave like format.
the basic understanding when working with midi is it usualy uses a general standard called respectivly, gm or general midi. the gba followed this standard with very strict exceptions. the ds, however, followas a varied standard.

ok, time to slow down. we need an example. ok, lets say, the pokemon trainer midi file has a gm instrument of a flute, as does the rival. in gm, it always plays the sample associated with the flute. but on the ds, the soundbank controles what sample is to be played. so you may have these 2 songs containg the flute in it, but they may play a trumpet sound. why is that? the soundbank tells the ds the samples to load. so one song may play a trumpet, one may play the sax, and the 3rd my play the clarinet, even though they may all be listed as a flute. that why ds rips sound less like their counterparts on the ds, and why you can have 3 channels for drums, even though the gm channel for drums is channel 10 only. i hope this continues to make the research clearer. feel free to ask any question and i will try my best to answer it.
__________________
"The power spoken of in mythology... I didn't just make it obey me, I made it my own!"
3DS Friend Code (Pokemon Y) 2294-5522-8562
Reply With Quote
  #2    
Old November 28th, 2010, 08:35 AM
Team Fail's Avatar
Team Fail
 
Join Date: May 2009
Age: 18
Gender: Male
Nature: Brave
I thought it worked like this:

Let's say, song SEQ_BA_NORAPOKE.sdat was playing (I belive a wild battle theme for one of the DS games) and it called upon SEQ_SOUND_BATTLE.sbnk. Let's also say SEQ_BA_LEADER.sdat and SEQ_BA_RIVAL.sdat loaded off the same .sbnk file. If it called upon MIDI insturment 1 (Acoustic Grand) and it played a clapping sound, and it was called in all three of those songs, it would play the same because it is using the same sound bank. Each insturment uses a sample, some none at all.
__________________



Team Fail

Community Supporter Collab
☆ ☆ ☆


Reply With Quote
  #3    
Old December 13th, 2010, 05:36 PM
The 100 Mega Shock
Donator Tier 3
 
Join Date: Aug 2010
Gender: Male
It's completely up to the developer whether they follow GM instrument conventions when it comes to creating their games' music sequences and sound banks.

(It's probably easier on the composers to be able to come back too if everything's GM, but there may be some advantage to not having sample banks full of gaps, I don't know.)

I've seen PS1 games, PS2 games, Game Boy Advance games and DS games that were composed following the GM specification and those that weren't.

Off the top off my head:

Pokémon Ruby / Fire Red: Mostly follows General MIDI

Pokémon Diamond: Mostly follows General MIDI
Pokémon Heart Gold: Does not follow General MIDI, but instruments are consistent across the game
Pokémon Black / White: Does not follow General MIDI and instruments differ between songs. (Almost every song in BW has it's own SBNK file)

Sonic Advance 1 / 2 / 3: Do not follow General MIDI
Sonic Colours (DS): Does not follow General MIDI for most songs (Because there's too much sampling), a few that rely purely on orchestral instruments were composed following GM.

Final Fantasy Tactics Advance: Does not follow General MIDI
Final Fantasy XII: Does not follow General MIDI

I've done this with plenty of other games but you get the picture.
__________________

Last edited by The 100 Mega Shock; December 13th, 2010 at 05:46 PM.
Reply With Quote
  #4    
Old December 13th, 2010, 05:54 PM
Team Fail's Avatar
Team Fail
 
Join Date: May 2009
Age: 18
Gender: Male
Nature: Brave
Quote:
Originally Posted by The 100 Mega Shock View Post
Pokémon Black / White: Does not follow General MIDI and instruments differ between songs. (Almost every song in BW has it's own SBNK file)
That's how I plan on doing the music in my hack. I'm curious as to how the .sbnk files are made. It's weird, though, because the theme for Cynthia's battle closely resembles the DP soundbanks.
__________________



Team Fail

Community Supporter Collab
☆ ☆ ☆


Reply With Quote
  #5    
Old December 13th, 2010, 05:58 PM
The 100 Mega Shock
Donator Tier 3
 
Join Date: Aug 2010
Gender: Male
Could be the same - the Pokémon Center music uses the same patch numbers as a HGSS track, just with new samples.
__________________
Reply With Quote
  #6    
Old March 26th, 2011, 12:00 AM
3dd13's Avatar
3dd13
Advanced Music Remixer
 
Join Date: Oct 2008
Location: Alabama! The Heart of Hell!
Age: 22
Gender: Male
Nature: Lonely
Send a message via Windows Live Messenger to 3dd13
what i sataed isnt that the games follow general midi, its that the system has to. a composer could make a trumpet in song a call bank x which plays a flute sound in it, while if it referd to bank y, it might play a sax. soundbanks are like soundfonts, just pointing to whatever samples the composer intended. and the trick to the old sounds would easily be explained by some sort of midi event or other coding. e.g. the slising bell sound at the start of the rival battle in black and white. it cant be a pitch bend event as its waaaaaaaayyyyyyyy too smooth.
__________________
"The power spoken of in mythology... I didn't just make it obey me, I made it my own!"
3DS Friend Code (Pokemon Y) 2294-5522-8562
Reply With Quote
  #7    
Old March 27th, 2011, 08:55 AM
Team Fail's Avatar
Team Fail
 
Join Date: May 2009
Age: 18
Gender: Male
Nature: Brave
Quote:
Originally Posted by 3dd13 View Post
what i sataed isnt that the games follow general midi, its that the system has to. a composer could make a trumpet in song a call bank x which plays a flute sound in it, while if it referd to bank y, it might play a sax. soundbanks are like soundfonts, just pointing to whatever samples the composer intended. and the trick to the old sounds would easily be explained by some sort of midi event or other coding. e.g. the slising bell sound at the start of the rival battle in black and white. it cant be a pitch bend event as its waaaaaaaayyyyyyyy too smooth.
That's because it isn't. It's just the same insturment sample playing and progressively increasing in pitch with each individual short note that is played, for example, 1 note that is about 0.5 seconds plays atone, then the next note plays a tone or two higher and it keeps going, like stairs.
__________________



Team Fail

Community Supporter Collab
☆ ☆ ☆


Reply With Quote
  #8    
Old April 18th, 2011, 08:50 PM
3dd13's Avatar
3dd13
Advanced Music Remixer
 
Join Date: Oct 2008
Location: Alabama! The Heart of Hell!
Age: 22
Gender: Male
Nature: Lonely
Send a message via Windows Live Messenger to 3dd13
Quote:
Originally Posted by Team Fail View Post
That's because it isn't. It's just the same insturment sample playing and progressively increasing in pitch with each individual short note that is played, for example, 1 note that is about 0.5 seconds plays atone, then the next note plays a tone or two higher and it keeps going, like stairs.
i understand that, what im saying is if you rip a 1:1 of the midis from the game, you notice, that its the same, but a synthisizer cannot make that bend. i guess its something only the ds hardware can do :/ ah well, im going to keep reasearching this and a few other things about it. for the time being, the soundbanks tell the ds to load certain samples. bottom line, the ds uses gm in its songs, but the soundbanks dont. therefore a soundbank is nothing more than a special custom soundfont, the only difference being it doesnt actually contain the instrument samples, just points to them and tells the ds what to apply it to.
__________________
"The power spoken of in mythology... I didn't just make it obey me, I made it my own!"
3DS Friend Code (Pokemon Y) 2294-5522-8562
Reply With Quote
  #9    
Old April 19th, 2011, 06:34 AM
The 100 Mega Shock
Donator Tier 3
 
Join Date: Aug 2010
Gender: Male
The sample being played at that point has a short release time specified, that's what makes each note transition "smoothly" into the next.
__________________
Reply With Quote
  #10    
Old July 5th, 2011, 07:19 AM
3dd13's Avatar
3dd13
Advanced Music Remixer
 
Join Date: Oct 2008
Location: Alabama! The Heart of Hell!
Age: 22
Gender: Male
Nature: Lonely
Send a message via Windows Live Messenger to 3dd13
so basically the soundbank has a almost immediate release time making that bend stlye. it isnt something the midi does and to get it in a soundfont you will literally have to take hours perfecting it and tweaking it. again, something that just shows how much time and effort is spent making the games. im researching how to make custom soundbanks, but it isnt going well. may just stick to gba hacking for now.
__________________
"The power spoken of in mythology... I didn't just make it obey me, I made it my own!"
3DS Friend Code (Pokemon Y) 2294-5522-8562
Reply With Quote
  #11    
Old July 5th, 2011, 08:48 AM
Team Fail's Avatar
Team Fail
 
Join Date: May 2009
Age: 18
Gender: Male
Nature: Brave
Quote:
Originally Posted by 3dd13 View Post
so basically the soundbank has a almost immediate release time making that bend stlye. it isnt something the midi does and to get it in a soundfont you will literally have to take hours perfecting it and tweaking it. again, something that just shows how much time and effort is spent making the games. im researching how to make custom soundbanks, but it isnt going well. may just stick to gba hacking for now.
Actually, it's already been done. From jul.rustedlogic.net. Credits to Orengefox.
Quote:
=======================================================
II. SOUND HACKING
=======================================================

The sound effects you hear in NSMB DS comes from an *.swav file. Recall in the last section that an *.swav file is basically a *.wav file but in a format that can work for the game. This kind of file can normally be found in a *.swar file which is located in the Wave Archive folder of the sound_data.sdat file using the NDS Editor. A *.swar file is a lot like a *.rar file. It usually carries more than one *.swav file. Hence why you tend to see more than one *.wav file after you’ve extracted all the *.swav data from out of an *.swar file then converted it into a *.wav file using any hacking tool. Please refer to the following link for more information on what a *.swav/*.swar file is. Now that you know what *.swav/*.swar files are, you can now read up on what’s possible to hack.


-----------------------------------------------------------------------
A. Replacing/Swapping *.swav files in a *.swar file
-----------------------------------------------------------------------

Before you continue reading; here’s a list of what I used for this technique:
NSMBe5.exe – NSMB Editor 5
Editor.exe – NDS Editor 0.1
Swav2Swar – Conversion Tools
The modified sound_data folder used for the NDS Editor

Say you wanted to change the sound Mario makes when shot from out of a warp/pipe canon to the sound Wario makes after being squashed by a Thwomp in Super Mario 64 DS. Here’s what you would have to do:

Step 1:

Let’s say you already know which files to look for. Case in point, the sound file for Mario’s voice when shot from out of a warp/pipe canon is the “WAVE_MARIO_BASE_SE_000.swav” file (or “WAVE_MARIO_BASE_SE_214.swav” file if extracted using the NDS Editor) which is in the “WAVE_MARIO_BASE_SE.swar” file (located in the “Wave Archive” folder within NSMB DS’ sound_data.sdat file); and the sound file for Wario’s voice after being squashed by a Thwomp is the “NCS_WAVE_SE_VOICE_WARIO_MG_004.swav” file (or “NCS_WAVE_SE_VOICE_WARIO_MG_240.swav” file if extracted using the NDS Editor) which is in the “NCS_WAVE_SE_VOICE_WARIO_MG.swar” file (located in the “Wave Archive” folder within SM64DS’ sound_data.sdat file).

Load up both NSMB DS & SM64DS using the NDS Editor. Double-click the two games and locate their sound_data.sdat file. Once you’ve located the two *.sdat files, double-click them both; they’ll then be uploaded onto the NDS Editor.

Step 2:

Double-click the two newly uploaded *.sdat files and search for the *.swar file you’re after in each *.sdat file. Once you’ve located both the “WAVE_MARIO_BASE_SE.swar” & “NCS_WAVE_SE_VOICE_WARIO_MG.swar” file, you’ll then want to extract the *.swav files from out of the two *.swar files using the NDS Editor. It will then create two new folders in the same folder that the NDS Editor is in; the first folder being “WAVE_MARIO_BASE_SE” and the second folder being “NCS_WAVE_SE_VOICE_WARIO_MG”. Each folder will contain the *.swav file you’re after along with any other *.swav files that were included in the *.swar file they came out of.

Now if somehow you’re not entirely sure which *.swar file contains which sound files, the best thing to do is to extract the *.swav files from out of all the *.swar files and as well as an extraction of all the *.swav files converted into *.wav files using the NDS Editor. Obviously if the *.swar file has got an “SE” in its name then you know it’ll contain the main sound effects to the game. As for the others that don’t have an “SE” in its name, those will be the instrumental sounds for the music files. It’s just a matter of playing each and every sound file to see what’s what.

Step 3:

Start up Swav2Swar. The program is pretty straight forward, you click “Add” and insert as many *.swav files as you like into the program; you then click “Create SWAR” which will then create a new *.swar file containing those selected *.swav files but in the order of which *.swav was inserted first. Seeing as you’ll be creating a new “WAVE_MARIO_BASE_SE.swar” with some modifications, you’ll want to add all the *.swav files it originally had (in numerical order) onto the program except for the one that you want to replace. Looking in through the “WAVE_MARIO_BASE_SE” folder, it’s quite obvious that “WAVE_MARIO_BASE_SE_214.swav” (which also goes by “WAVE_MARIO_BASE_SE_000.swav”) was the first file listed in the original *.swar file. If you’re not sure about it, make a file dump of “WAVE_MARIO_BASE_SE.swar” using the NDS Editor and look it up. With that in mind, you’ll want to add the file that’s replacing “WAVE_MARIO_BASE_SE_214.swav” first. Using Swav2Swar, click “Add” and look for “NCS_WAVE_SE_VOICE_WARIO_MG_240.swav” which will be in the “NCS_WAVE_SE_VOICE_WARIO_MG” folder. After you’ve added the first file in, you’ll then want to add in the rest of the *.swav files which made up the original “WAVE_MARIO_BASE_SE.swar” file. Once you’ve added the rest of the *.swav files in, it should look something like this:

If the files are out of order, use the up/down arrow buttons to move them around. Click “Create SWAR” and name the new file “41 WAVE_MARIO_BASE_SE”; now save the file anywhere you like. It’ll save with the file extension which I suggest to take out just to make things easy for when you go to Step 5.

Step 4:

Before you continue any further, you’ll need from out of the NSMB DS rom all the extracted files that are in the sound_data.sdat file which you can get using the NDS Editor (instructions here). Bare in mind, you will need to re-organize the files around before compiling it back up; or you can use the modified sound_data folder (get your copy here) which already does all that for you. You can read about it in the LAST MINUTE INFORMATION section.

Step 5:

Using the modified sound_data folder, locate the “41 WAVE_MARIO_BASE_SE” file (the files are numbered for re-organizing reasons). Once you’ve located the file, you’ll then want to replace that file with the new one you created using Swav2Swar. Compile all the files in the sound_data folder into a new sound_data.sdat file using the NDS Editor (Tools –> Make Sdat File –> Select a folder –> OK).

Step 6:

Finally, replace the original sound_data.sdat file that’s in the NSMB DS rom with the one you compiled using NSMB Editor 5. Congratulations, you’ve manage to hack the sound in NSMB DS by replacing/swapping *.swav files in a *.swar file. Give your newly hacked NSMB DS rom a test run on an emulator. Though I’ve not run into any problems yet when using this hacking technique; there is a chance you may still run into problems. You can read more about it in the LAST MINUTE INFORMATION section.

Try this experiment out the next time you’re replacing *.sseq files with one that’s been converted from a *.mid file or one that came from another game. Instead of using the existing *.swar file that came with the original *.sseq file (before it got replaced); you could use one that’s been customized using Swav2Swar.
So, it's just sample replacing.
EDIT: I was looking at this earlier, and I was thinking on posting some stuff in here, but it seems that you came back to the thread anyways! xD
__________________



Team Fail

Community Supporter Collab
☆ ☆ ☆



Last edited by Team Fail; July 5th, 2011 at 08:56 AM.
Reply With Quote
  #12    
Old July 5th, 2011, 08:53 AM
RHIOneAlbum
Booted out - don't be like me!
 
Join Date: Jun 2011
Location: Dark Maroon City
Nature: Serious
Send a message via AIM to RHIOneAlbum
This seems simple enough just replacing as stated above by Team Fail. But nonetheless, I'm sure newbies will be catching up to us in DS hacking soon.
Reply With Quote
Reply
Quick Reply

Sponsored Links


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 11:24 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.