Nintendo DS Music Hacking [LOOPING INCLUDED, FULLY EXPLAINED]

Discussion in 'NDS - Tutorials' started by loco365, Aug 15, 2011.

?

Is this tutorial easy to follow and are the instructions clear?

  1. Yes

    7 vote(s)
    58.3%
  2. No

    5 vote(s)
    41.7%
  1. loco365
    OP

    Member loco365 GBAtemp Guru

    Joined:
    Sep 1, 2010
    Messages:
    5,459
    The Nintendo DS is a file-based system that can be modified easily if you understand what is happening. I will attempt to get this all into something that is easy to understand, even if you are beginning the Nintendo DS Music scene.

    My tutorial will be separated into several parts. Each part will be explained in-depth.

    Part One- Accessing The Song You Wish To Modify
    This program will require the use of VGMTrans. You can find it in the Music Hack Pack. There is a link at the end of the tutorial. Note- The program is rather unstable and can crash. It is normal and will not damage your computer. You can find other copies and builds of VGMTrans by searching on Google.

    Getting the MIDI and DLS files
    These are files that are the heart and soul of this tutorial. A MIDI file is a set of sequenced sounds that can be played as a song. A DLS file contains wave samples that are used in conjunction with MIDI files to play these samples with certain instruments to generate sounds that MIDIs by themselves cannot generate. You'll get the idea later on. To get these files, there are two ways. I'll give you the best way because it will save you heartache later on. Open CrystalTile (In Music Hack Pack) and open your Nintendo DS rom image. From here, at the top, click on the third icon from the Right (The little DS Icon). It will open up a list of files. Now, click "View a List Of" and click on "Directory". Now, you will want to look for the .SDAT file within the game. Keep in note that some games have more than one. It will have an icon of a speaker. Right-click on it and click on "Export". Save it to a location of your desire. Now, open VGM Trans. Minimize CrystalTile because you won't need it until much later. Take your newly-extracted .sdat file and drag it on the VGMTrans window. You CANNOT use the "Open" command from the file menu, as the program is not complete. This stage will most likely be the most painful, as the program is rather unstable. It may take a minute to open the sdat file, and it may even quit responding. Just be patient, it will eventually open it and grant you access to it's controls. From here, browse the list of songs to extract. Note that the songs will not loop in the program, but you can simulate a loop in FL Studio. You can click on the song and press play at the top, but who's lazy? I know I am. You can use the arrows on the keyboard and the spacebar to choose a song and play it. How convenient? Once you choose a song of your liking, you have a few options here. Your best option is to right-click on the song and select "Export as MIDI and DLS". Save those to a location of your liking as well. You can now close VGMTrans, but this is optional. It's best to, though. Now, you have your .dls and your .midi files. Now, what will you do with those?

    Part Two- Modifying Music- and knowing what it will sound like
    This part of the tutorial has a little-known trick I found and I thought it would be nice to explain the process.

    FL Studio
    For this tutorial, you will need the program FL Studio. I have a download link in the Music Hack Pack at the end of the tutorial. You will want to download it and let install the programs, including ASIO4ALL. It is a MIDI driver- required for FL Studio to work.

    FL Studio- Importing and Editing music
    This is the easier part that requires use of the imagination. Open FL Studio. Keep in mind you cannot save as projects in the Demo. You can, however save files as MIDI to get around that. Or, find a crack on Google. It's up to you. Click and drag the midi file to the program (You can also use File... Open) and import all the tracks, by pressing OK on the window that will pop up with the numbers 1 through 16. Now, you have your midi open! But, there is one problem, no, wait. Two problems. How will you know what it will sound like? And how will I simulate a loop? It's easy. I have included images to assist you.

    When you import a midi file, it will open an additional window called Fruity LSD.
    [​IMG]
    I have opened up the file SEQ_ROAD_SNOW_D, but that's besides the point. In the image, there is a folder button. Click on that. From here, browse to the .dls file you extracted with VGMTrans. Open it, then press play. Ta-da! It sounds... Game-ish! Now, there is a little restriction. Not all 126 instruments are used. If you need an extensive tutorial on how to use FL Studio, click here. It also explains looping.

    From here, you can do all your editing. You can modify many of the game's song's aspects, like panning, volume, patch and whatnot. This is done through the Piano Roll in the program (Click the bar with the lines.) Do note, though, that you cannot insert bytes for loops in FL Studio, but you CAN insert note placeholders to indicate where you want to have your loop. Look at Looping (Preliminary) for more info on how to use note placeholders.

    FL Studio- Exporting the final product
    Now, you've finished, eh? Click on File and go to Save As... . Now, save as the type .midi and name it. When it's done, you can close FL Studio. You've exported it, and it's almost ready to be inserted!

    Part Three- Inserting the song

    This part of the tutorial will use a NEW version of MIDI2SSEQ that is much better than the original. Click here to download it.

    Looping
    For this, you will need Anvil Studio. Open the MIDI and view any track in the Piano Roll editor. It will make it far easier if you use a track in which you know where the loop point is. Right after the final note plays, place the marker there and the program will record the time at which the marker is. Click EDIT -> Insert MIDI Event... . Under Kind Of Event, make sure both boxes have a check mark beside them, then look for "Marker" in the drop-down list. After you find it, you will just have a blank text box. Type "loopEnd" (This is case sensitive. Just don't use the "".) Now, this is the slightly difficult part. Go to the point in the song where it loops to, and select it. Now, go to EDIT -> Insert MIDI Event... . Make sure you are using marker, BUT, look at the time. You need to peel off one frame so the loop will sound correctly.

    How do I do that?

    When looking at the time, It will go 29:30 (29 seconds, 30 frames.) to 30:00. Meaning that there are 30 frames in 1 second. So, if your time for the loop point is on an exact second, go to the previous second, and use 29 frames.

    Now, use the Marker "loopStart". Remember that it is case sensitive. Keep in mind that you only have to do this on ONE track, and it saves you time. The revised MIDI2SSEQ is smart enough to place the loop point correctly on all tracks. Now, go FILE -> Export MIDI-Format 0 File... and save it to a directory. IT IS RECOMMENDED that you save it in the C:\Users\[Name] along with MIDI2SSEQ because you WILL NEED to use a command line to convert it. You can now close Anvil Studio.

    NOTE! When looping, the program will NOT insert events at loop point to fix tempo and patch number to what it is supposed to be. Those must be applied manually during the MIDI editing process. If you don't fix them, the song may play incorrectly after it loops.

    Converting
    The revised MIDI2SSEQ uses a command line and is very easy. Now, you might be asking, why am I supposed to save the song to C:\Users\[NAME]? That is because you won't have to type a very long file address when using the command. MIDI2SSEQ also must be in the same place as the MIDI too. Note, you CANNOT drag-and-drop, because it will be missing an argument that it requires to convert. Open a Command Prompt window and type "midi2sseq nameofmidi.mid nameofsseq.sseq" without the quotes. You'll be telling the program to take the file nameofmidi.mid (nameofmidi will change, obviously) and convert it using the named program into nameofsseq (which is defined by you). When done, it will spit out a .sseq file. Don't worry about any errors on tempo. It's normal. The SSEq will be saved in the same directory that the midi is in.


    Inserting
    There are 2 ways to insert, but I'll make it simple for you. Open your .SDAT in both CrystalTile and VGMTrans. Find the song in VGMTrans that you want to replace. Now, find that song in CrystalTile. Right-click on it and click "Import" and browse to the MIDI that we just made. Double-click on it and it will attempt to insert it. IF it gives you an error, that means that the file is too large, and CrystalTile cannot repoint files. Therefore, you will need to make it smaller. It is possible to repoint files, but I am unsure as to how yet. Then, save the .sdat file and import it to your game. Test it in an emulator or a flashcard.

    If you have followed all the steps correctly, you can make some good music. Like my song, for instance:
    [youtube]vILvXGhur9Q[/youtube]

    Hack Pack link: http://www.box.net/files/0/f/0/1/f_581072414 and http://www.megaupload.com/?d=65A88ARG
    If this worked for you, then good job. If not, keep reading. If something is unclear, don't hesitate to ask! I thank you for your time. If you want to repost this tutorial, please PM me or VM me.
     
  2. loco365
    OP

    Member loco365 GBAtemp Guru

    Joined:
    Sep 1, 2010
    Messages:
    5,459
    I've added a new video that shows what can be done using the latest techniques I have found.
     
  3. TheDreamLord

    Member TheDreamLord GBAtemp Advanced Fan

    Joined:
    Jun 8, 2011
    Messages:
    924
    Location:
    Ireland
    Country:
    Ireland
    is it possible to change a .mp3 to midi or midi to mp3?
     
  4. gbatempfan1

    Member gbatempfan1 GBAtemp Regular

    Joined:
    Nov 2, 2010
    Messages:
    129
    Country:
    midi to mp3 is just recording the audio output as the computer plays the note information from the midi file and compressing it. mp3 to midi isn't so simple, as midi is actualy just a bunch of notes, instruments, and timing and a computer can't recognize such things well in enough variety of circumstances to disect the mp3's audio stream automatically.
     
  5. loco365
    OP

    Member loco365 GBAtemp Guru

    Joined:
    Sep 1, 2010
    Messages:
    5,459
    No. MP3 is streaming audio and MIDI is sequences. I think, if I am correct, you can make custom soundbanks and split the song into many, many pieces and do that, but I am unsure how to do that yet.
     
  6. Gintoki Sakata

    Newcomer Gintoki Sakata Advanced Member

    Joined:
    Dec 27, 2011
    Messages:
    74
    Location:
    Edo
    Country:
    Japan
    Your tutorial has a flaw. It does describe how to MODIFY an existend soundtrack of a DS game,but it does not describe how to REPLACE a soundtrack with a soundtrack of ANOTHER DS GAME.

    This is what I understood so far:

    * In order for a midi file to sound like in the game, a separate sound bank file (dls) is needed
    * You cannot assign a midi file to a foreign dls file (actually you can do it, but then there will be no sound)

    Your tutorial does not describe what to do with the dls file of the music you want to insert/replace with.

    So my question is, how can I put midi+dls together and insert them in a ROM/replace them with an old midi/dls?
     
  7. loco365
    OP

    Member loco365 GBAtemp Guru

    Joined:
    Sep 1, 2010
    Messages:
    5,459
    You can do the first few steps with another DS game. It doesn't necessarily have to be the same game.
     
  8. Gintoki Sakata

    Newcomer Gintoki Sakata Advanced Member

    Joined:
    Dec 27, 2011
    Messages:
    74
    Location:
    Edo
    Country:
    Japan
    You mean I can use the sound bank file of music X with a midi file of music Y? I did that, but that resulted in no sound output.

    I have done some research. Sound only works if you have a sseq file (midi), snbk file (dls) and an swar file (wave archive). Your tutorial completly ignores the swar file of the music you want to replace with. If those wave files are missing, no wonder why the music sounds messed up or don't work at all.

    Now I did the following: I extracted from Golden Sun's sdat file the battle musics sseq, snbk and swar files and did rename them like the sseq/snbk/swar files of Nostalgia's shitty battle music. Then I tried to edit the sound_data.sdat of Nostalgia by importing Golden Sun's file but unfortunately the swar file is too big.

    Then I tried the same with the epic battle music of Chrono Trigger. This time every file was inserted correctly. I repacked Nostalgia with the edited sdat file and hoped that it will work but the music was messed up all over the place. Sigh, it is really that difficult to replace music files of DS games? :(
     
  9. loco365
    OP

    Member loco365 GBAtemp Guru

    Joined:
    Sep 1, 2010
    Messages:
    5,459
    That's the DLS you extract. I could rewrite that part later seeing as I have to add a new part to the tutorial.
     
  10. Gintoki Sakata

    Newcomer Gintoki Sakata Advanced Member

    Joined:
    Dec 27, 2011
    Messages:
    74
    Location:
    Edo
    Country:
    Japan
    The dls file from your tutorial is only used in FL Studio for cosmetic purposes. Apart from that it's completly useless. It doesn't do anything to the midi you created via FL Studio.

    Shitty midi + dls → Shitty midi

    You can't "patch" a midi with a dls file. The DS doesn't know what dls files are. You need snbk files.

    I found a tutorial that explains it correctly: http://jul.rustedlogic.net/thread.php?id=7518
    But still the music sounds messed up.
     
  11. Gintoki Sakata

    Newcomer Gintoki Sakata Advanced Member

    Joined:
    Dec 27, 2011
    Messages:
    74
    Location:
    Edo
    Country:
    Japan
    @Team Fail: You don't have a solution for me, do you?
     
  12. BlueLink_146446

    Newcomer BlueLink_146446 Newbie

    Joined:
    Feb 8, 2012
    Messages:
    1
    I'm running into a similar problem. I've trying to take some of the Kanto region music from Soul Silver and Platinum's Team Galactic battle themes and put them into White, but so far they seem to mess up. I'm testing just exporting the sseq straight from the game and importing it into the other game, but I'll see what happens.
     
  13. BrianXP7

    Member BrianXP7 GBAtemp Regular

    Joined:
    Jul 26, 2012
    Messages:
    117
    Country:
    United States
    So the NDS's audio is just a glorified MIDI file. Good to know.
     
  14. Chazpelo

    Newcomer Chazpelo Member

    Joined:
    Oct 4, 2015
    Messages:
    20
    Country:
    United States
    t
    TRY to reupoad the second download. Megaupload was shutdown by the FBI. its was replaced by MEGA
     
  15. ShinyTetra

    Newcomer ShinyTetra Member

    Joined:
    Jun 7, 2015
    Messages:
    16
    Country:
    Spain
    Its posible to create your own .SAD voice and then import in the game?
     

Share This Page