Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.

Reply
 
Thread Tools
  #1    
Old July 2nd, 2011 (12:24 PM). Edited August 10th, 2011 by ipatix.
ipatix's Avatar
ipatix ipatix is offline
Sound Expert
     
    Join Date: May 2008
    Location: Germany
    Gender: Male
    Nature: Relaxed
    Posts: 145
    M4A build in assembler

    I think everyone who already hacked music knows that the "main" tool Sappy is very buggy and some of them are really nasty.

    So I thought about making my own tool and now I want to present it to you.
    I think you also should know Sappy's button "Assemble song". My tool actually does exactly the same job than this function but it doesn't "destroy" your ROM and it has also compatiblity to 32MB ROMs.
    *UPDATE* the tools now also deletes the old song!

    This tool should work for all games that are using the M4A engine (also called sappy engine).
    I already tried out Wario Land 4, Golden Sun, Kirby NID, and of course Pokemon.

    So let's have a look to the GUI:


    The steps how to insert a song:
    1. Make sure the "MPlayDef.s" library is placed in the same folder than the program.
    2. Selcect your mid2agb output (.s file) and your ROM.
    3. Type in the track group. Huh, I think you even don't know what it is. Which values you have insert here depends on the game you are using and on the type of song. So if you're using Pokemon games insert "0" for normal song, "1" for a sound effect and "2" for a fanfare and "3" for sound map sound efect (like rain).
    4. Type in the songpointer offset. The songpointer is an entry of the songlist and it is needed to change the songpointer that it'll point to your new song. The songpointer is calculated like this:
    Code:
    songpointer_offset = ( song_number * 0x8 ) + songlist_offset
    I will post the songlist offsets of Pokemon games below.
    5. Just type in an offset of free space (it has to be word aligned).
    6. Specify your soundbank/voicegroup
    7. Define the "delete byte". The tool will fill the area of the old song with this byte.
    8. Than click on "build in this song" and you will finally have a new sequence build in the ROM.

    Just note that there are ways to make the program crash or even the song you'll insert:
    -The input file is not an mid2agb output or the song syntax is not correct.
    -You don't have write access to the programs folder (it will store temporary files there).

    Also note that I won't bring out any updates for this toll because it does its job and I'm working on a new uitility that will be a little bit more blind user firendly than this one and will also contain diffrent functions like a music player and such or maybe an instrument set editor.

    You can donwload the program from the file attatchment.
    It should work on any OS that supports .NET 3.5 ( I used VC# 2008)

    So now here are the offset of the songlists:
    BPRE: 0x4A32CC
    BPGE: 0x4A2BA8
    AXVE: 0x45548C
    AXPE: 0x4554E8
    BPEE: 0x6B49F0
    BPRD: 0x4A18F0
    AXVD: 0x463428
    BPED: 0x6C5BDC

    So I hope you'll enjoy the tool!

    PS: Greetings from Germany
    Attached Files
    File Type: zip M4A build in Assembler.zip‎ (1.17 MB, 312 views) (Save to Dropbox)
    __________________
    Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix
    Reply With Quote

    Relevant Advertising!

      #2    
    Old July 2nd, 2011 (10:44 PM).
    Platinum Lucario's Avatar
    Platinum Lucario Platinum Lucario is offline
    The Legendary Master of Light!
    • Crystal Tier
     
    Join Date: Jan 2008
    Location: Warrnambool, Victoria, Australia.
    Gender: Male
    Nature: Calm
    Posts: 1,561
    Great, excellent! I am so glad we've finally gotten a better music assembler than what Sappy has. Sappy is rather unstable and can crash easily (and crash with certain loop points while testing out the song) and can only support a few .gba ROMs. I'm also looking forward to seeing a sound testing function on it so that anyone can test out their new song that they've inserted and being able to play every single soundbank in the ROM. Sappy could not support every single soundbank and some of them got replaced with simple beeps while testing out a song.

    I would also like to suggest having a function that can edit the soundbank possitions and offsets and if there isn't a tool where you can convert a .wav file to a soundbank, then there should be a function in this tool to do so, that way anyone can record and convert their .wav to a soundbank. ;)
    __________________
    [Platinum Lucario's Signature]
    If you need to disable my signature, please give me some advice on how to improve the CSS-DIV code. Thanks!
    Signature Status: Strikes: 1/3 | Infractions: 0/3
    It's time to change the future...
    to a positive direction!

    Let's prevent things from getting bad!

    I'm a ROM and ISO Researcher
    Current Project: Researching Pokémon Mystery Dungeon Adventure Squad games (WiiWare)
    Reply With Quote
      #3    
    Old August 7th, 2011 (5:19 AM).
    ilovecrumpet ilovecrumpet is offline
       
      Join Date: Aug 2011
      Posts: 4
      I'm a noob, so few questions if you don't mind.

      1) 1. Make sure the "MPlayDef.s" library is placed in the same folder than the program.

      What is this? I don't understand / I don't have a MPlayDef.s library? Where or how do I create one?

      2) 6. Specify your soundbank/voicegroup

      What is this? Is there a list of these anywhere? Or a method of locating them?

      Thanks. All I wanna do is change a Pokémon battle theme x__X How difficult does this need to be D: I tried Sappy but it hates me.
      Reply With Quote
        #4    
      Old August 7th, 2011 (11:56 AM). Edited August 7th, 2011 by esperance.
      esperance's Avatar
      esperance esperance is offline
      • Platinum Tier
       
      Join Date: Mar 2010
      Location: Ohio
      Age: 20
      Gender: Male
      Nature: Relaxed
      Posts: 3,818
      Quote:
      Originally Posted by ilovecrumpet View Post
      I'm a noob, so few questions if you don't mind.

      1) 1. Make sure the "MPlayDef.s" library is placed in the same folder than the program.

      What is this? I don't understand / I don't have a MPlayDef.s library? Where or how do I create one?

      2) 6. Specify your soundbank/voicegroup

      What is this? Is there a list of these anywhere? Or a method of locating them?

      Thanks. All I wanna do is change a Pokémon battle theme x__X How difficult does this need to be D: I tried Sappy but it hates me.
      1. MPlayDef.s is an asm file containing info for every music command. It comes with the tool Mid2Agb.
      2. There is a thread posted somewhere with all the voicegroups for FireRed, but the only way is to check through sappy.

      EDIT: For those who don't get what track group really is, you could also think of it as a "priority" property. The lower the number, the less precedence it has. For example BG music is 0 so that sfx can play over top of it.
      __________________

      A Pokemon that is discriminated!
      Support squirtle and make it everyone's favourite.
      Reply With Quote
        #5    
      Old August 8th, 2011 (4:11 AM).
      ilovecrumpet ilovecrumpet is offline
         
        Join Date: Aug 2011
        Posts: 4
        Thanks so much, actually managed to get a song imported now.

        One thing I can't figure out (my sappy doesn't work), could someone tell me the soundbank offset for the wild battle theme in pokemon ruby?

        Appreciated.
        Reply With Quote
          #6    
        Old August 8th, 2011 (7:51 AM).
        WrathOfArceus's Avatar
        WrathOfArceus WrathOfArceus is offline
        Arceus Tamer
           
          Join Date: Jun 2011
          Gender: Male
          Posts: 15
          It Does not Work for me. When i open a Rom or S.file i get an annoying error
          Reply With Quote
            #7    
          Old August 8th, 2011 (8:03 AM).
          Full Metal's Avatar
          Full Metal Full Metal is offline
          C(++) Developer.
          • Silver Tier
           
          Join Date: Jan 2008
          Location: In my mind.
          Age: 21
          Gender: Male
          Nature: Timid
          Posts: 806
          That's a pretty good indicator that you're doing something wrong.
          You know what would be really helpful?
          A screenshot, or even a description of what the error says.
          ...yup. Maybe then useful information can be given to you. (;
          __________________

          ★ full metal.

          I like to push it,
          and push it,
          until my luck is over.
          Reply With Quote
            #8    
          Old August 8th, 2011 (11:20 AM).
          ruup20's Avatar
          ruup20 ruup20 is offline
          Gonna splash everybody!
             
            Join Date: Jan 2011
            Location: Undella Town
            Gender: Male
            Nature: Jolly
            Posts: 118
            I have a problem. If I press "build in this song" it simply does nothing.
            __________________

            I really need a advanced scripter for my hack and a good storyline-guy,
            Thank you.
            Reply With Quote
              #9    
            Old August 10th, 2011 (12:25 AM).
            ipatix's Avatar
            ipatix ipatix is offline
            Sound Expert
               
              Join Date: May 2008
              Location: Germany
              Gender: Male
              Nature: Relaxed
              Posts: 145
              @ruup20:

              Tell me exactly what you've done and can you upload your .s file?

              @WrathOfArceus:

              What kind of error message do you get?
              Are all your offsets word aligned?

              @ilovecrumpe:

              You may tiy out the old Version of Sappy (2005), or the MIDI only version (1.6).
              Sappy 2005: http://www.megaupload.com/?d=UYUJRP62
              Sappy 1.6 (midi only): http://www.megaupload.com/?d=45LLIDH8
              __________________
              Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix
              Reply With Quote
                #10    
              Old August 10th, 2011 (3:36 AM).
              ruup20's Avatar
              ruup20 ruup20 is offline
              Gonna splash everybody!
                 
                Join Date: Jan 2011
                Location: Undella Town
                Gender: Male
                Nature: Jolly
                Posts: 118
                I just did what I had to do and nothing worked.
                Attached Files
                File Type: rar Route202.rar‎ (1.2 KB, 13 views) (Save to Dropbox)
                __________________

                I really need a advanced scripter for my hack and a good storyline-guy,
                Thank you.
                Reply With Quote
                  #11    
                Old August 10th, 2011 (7:24 AM).
                Full Metal's Avatar
                Full Metal Full Metal is offline
                C(++) Developer.
                • Silver Tier
                 
                Join Date: Jan 2008
                Location: In my mind.
                Age: 21
                Gender: Male
                Nature: Timid
                Posts: 806
                Quote:
                Originally Posted by ruup20 View Post
                I just did what I had to do and nothing worked.
                Then wouldn't it make sense to say you did not do what you had to do so therefor nothing worked the way you thought it ought? Hm?
                Perhaps a screenshot would be nice to have, followed by step-by-step informations of what excatly you did.
                __________________

                ★ full metal.

                I like to push it,
                and push it,
                until my luck is over.
                Reply With Quote
                  #12    
                Old August 10th, 2011 (7:38 AM).
                WrathOfArceus's Avatar
                WrathOfArceus WrathOfArceus is offline
                Arceus Tamer
                   
                  Join Date: Jun 2011
                  Gender: Male
                  Posts: 15
                  My error says Unhandled Exception has occurred in your application
                  Reply With Quote
                    #13    
                  Old August 10th, 2011 (7:56 AM).
                  Full Metal's Avatar
                  Full Metal Full Metal is offline
                  C(++) Developer.
                  • Silver Tier
                   
                  Join Date: Jan 2008
                  Location: In my mind.
                  Age: 21
                  Gender: Male
                  Nature: Timid
                  Posts: 806
                  ^that^ makes debugging so much easier, believe it or not.
                  All the writer needs to do is wrap his code in try/catch statements now, and then he can figure out where the error comes from.
                  __________________

                  ★ full metal.

                  I like to push it,
                  and push it,
                  until my luck is over.
                  Reply With Quote
                    #14    
                  Old August 10th, 2011 (8:53 AM).
                  ruup20's Avatar
                  ruup20 ruup20 is offline
                  Gonna splash everybody!
                     
                    Join Date: Jan 2011
                    Location: Undella Town
                    Gender: Male
                    Nature: Jolly
                    Posts: 118
                    okay now it just freeze... Or it just take much time to load.
                    Attached Images
                    File Type: png naamloos.PNG‎ (21.6 KB, 54 views) (Save to Dropbox)
                    __________________

                    I really need a advanced scripter for my hack and a good storyline-guy,
                    Thank you.
                    Reply With Quote
                      #15    
                    Old August 10th, 2011 (9:07 AM).
                    ipatix's Avatar
                    ipatix ipatix is offline
                    Sound Expert
                       
                      Join Date: May 2008
                      Location: Germany
                      Gender: Male
                      Nature: Relaxed
                      Posts: 145
                      @ruup20:

                      I'm sorry, the version I uploaded was out of date and didn't worked with .s with only 1 track.

                      I now uploaded a newer version!

                      @WrathOfArceus:
                      Can you give me your .s file or even tell me what kind of Unhandled Exception occurred (click on the details button).
                      __________________
                      Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix
                      Reply With Quote
                        #16    
                      Old August 10th, 2011 (9:37 AM).
                      Full Metal's Avatar
                      Full Metal Full Metal is offline
                      C(++) Developer.
                      • Silver Tier
                       
                      Join Date: Jan 2008
                      Location: In my mind.
                      Age: 21
                      Gender: Male
                      Nature: Timid
                      Posts: 806
                      @ipatix - what language is this written in?
                      __________________

                      ★ full metal.

                      I like to push it,
                      and push it,
                      until my luck is over.
                      Reply With Quote
                        #17    
                      Old August 10th, 2011 (10:08 AM).
                      ruup20's Avatar
                      ruup20 ruup20 is offline
                      Gonna splash everybody!
                         
                        Join Date: Jan 2011
                        Location: Undella Town
                        Gender: Male
                        Nature: Jolly
                        Posts: 118
                        And how do I put it in a town/route?
                        __________________

                        I really need a advanced scripter for my hack and a good storyline-guy,
                        Thank you.
                        Reply With Quote
                          #18    
                        Old August 10th, 2011 (10:32 AM).
                        Full Metal's Avatar
                        Full Metal Full Metal is offline
                        C(++) Developer.
                        • Silver Tier
                         
                        Join Date: Jan 2008
                        Location: In my mind.
                        Age: 21
                        Gender: Male
                        Nature: Timid
                        Posts: 806
                        ...You insert it into the correct spot... x)
                        __________________

                        ★ full metal.

                        I like to push it,
                        and push it,
                        until my luck is over.
                        Reply With Quote
                          #19    
                        Old August 10th, 2011 (1:05 PM).
                        ipatix's Avatar
                        ipatix ipatix is offline
                        Sound Expert
                           
                          Join Date: May 2008
                          Location: Germany
                          Gender: Male
                          Nature: Relaxed
                          Posts: 145
                          Quote:
                          Originally Posted by Full Metal View Post
                          @ipatix - what language is this written in?
                          Visual C# 2008 (.NET 3.5)
                          __________________
                          Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix
                          Reply With Quote
                            #20    
                          Old August 10th, 2011 (1:06 PM).
                          SK3's Avatar
                          SK3 SK3 is offline
                          Pokemon Hacking Company™ CEO
                             
                            Join Date: Apr 2011
                            Location: Johto
                            Age: 22
                            Gender: Male
                            Nature: Quirky
                            Posts: 276
                            Okay, so I loaded my ROM, loaded my .s file, put in the Song Pointer, the track data, and the soundbank offset. When I clicked assemble, I got the Unhandled Exception error, but I pressed continue, and the log continued to work. But then it got stuck on "Getting lengths of tracks". What did I do wrong?
                            __________________

                            Pokemon
                            Daydream White version


                            Want to help out? Just PM or VM me!

                            Reply With Quote
                              #21    
                            Old August 10th, 2011 (1:38 PM).
                            Full Metal's Avatar
                            Full Metal Full Metal is offline
                            C(++) Developer.
                            • Silver Tier
                             
                            Join Date: Jan 2008
                            Location: In my mind.
                            Age: 21
                            Gender: Male
                            Nature: Timid
                            Posts: 806
                            Quote:
                            Originally Posted by ipatix View Post
                            Visual C# 2008 (.NET 3.5)
                            I see.
                            I was going to ask to see the source, and maybe debug it with/for you. Unfortunately, I'm not so sharp at...C# ( no pun intended. x) )
                            __________________

                            ★ full metal.

                            I like to push it,
                            and push it,
                            until my luck is over.
                            Reply With Quote
                              #22    
                            Old August 10th, 2011 (6:31 PM).
                            WrathOfArceus's Avatar
                            WrathOfArceus WrathOfArceus is offline
                            Arceus Tamer
                               
                              Join Date: Jun 2011
                              Gender: Male
                              Posts: 15
                              Details Of My Error

                              See the end of this message for details on invoking
                              just-in-time (JIT) debugging instead of this dialog box.

                              ************** Exception Text **************
                              System.BadImageFormatException: Retrieving the COM class factory for component with CLSID {DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7} failed due to the following error: 800700c1.
                              at System.Windows.Forms.OpenFileDialog.CreateVistaDialog()
                              at System.Windows.Forms.FileDialog.RunDialogVista(IntPtr hWndOwner)
                              at System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner)
                              at WindowsFormsApplication1.Form1.button2_Click(Object sender, EventArgs e)
                              at System.Windows.Forms.Control.OnClick(EventArgs e)
                              at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
                              at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
                              at System.Windows.Forms.Control.WndProc(Message& m)
                              at System.Windows.Forms.ButtonBase.WndProc(Message& m)
                              at System.Windows.Forms.Button.WndProc(Message& m)
                              at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
                              at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


                              ************** Loaded Assemblies **************
                              mscorlib
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.4961 (win7RTMGDR.050727-4900)
                              CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
                              ----------------------------------------
                              M4A build in Assembler
                              Assembly Version: 1.0.0.0
                              Win32 Version: 1.0.0.0
                              CodeBase: file:///C:/Users/Owner/AppData/Local/Temp/Rar$EX83.752/M4A%20build%20in%20Assembler.exe
                              ----------------------------------------
                              System.Windows.Forms
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.4961 (win7RTMGDR.050727-4900)
                              CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
                              ----------------------------------------
                              System
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.4957 (win7RTMGDR.050727-4900)
                              CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
                              ----------------------------------------
                              System.Drawing
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
                              CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
                              ----------------------------------------

                              ************** JIT Debugging **************
                              To enable just-in-time (JIT) debugging, the .config file for this
                              application or computer (machine.config) must have the
                              jitDebugging value set in the system.windows.forms section.
                              The application must also be compiled with debugging
                              enabled.

                              For example:

                              <configuration>
                              <system.windows.forms jitDebugging="true" />
                              </configuration>

                              When JIT debugging is enabled, any unhandled exception
                              will be sent to the JIT debugger registered on the computer
                              rather than be handled by this dialog box.
                              Reply With Quote
                                #23    
                              Old August 11th, 2011 (12:02 AM). Edited August 11th, 2011 by ipatix.
                              ipatix's Avatar
                              ipatix ipatix is offline
                              Sound Expert
                                 
                                Join Date: May 2008
                                Location: Germany
                                Gender: Male
                                Nature: Relaxed
                                Posts: 145
                                Can you give me your .s file or the patch of your ROM?

                                That could help me!
                                __________________
                                Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix
                                Reply With Quote
                                  #24    
                                Old August 11th, 2011 (12:08 AM).
                                WrathOfArceus's Avatar
                                WrathOfArceus WrathOfArceus is offline
                                Arceus Tamer
                                   
                                  Join Date: Jun 2011
                                  Gender: Male
                                  Posts: 15
                                  there's the S. File i was trying to insert
                                  Attached Files
                                  File Type: rar GSC Wild battle johto.rar‎ (3.0 KB, 6 views) (Save to Dropbox)
                                  Reply With Quote
                                    #25    
                                  Old August 11th, 2011 (2:11 AM).
                                  ipatix's Avatar
                                  ipatix ipatix is offline
                                  Sound Expert
                                     
                                    Join Date: May 2008
                                    Location: Germany
                                    Gender: Male
                                    Nature: Relaxed
                                    Posts: 145
                                    @WrathofArceus:
                                    Did you overwrite a song that was damaged?
                                    Because it seems that the program has crashed after getting the length of the old trackdata to remove them.

                                    @Full Metal:
                                    Okay you can get the source code, but I can't give it to you now because my other PC got a virus.
                                    I will tell you when I can give you the source ;-)
                                    __________________
                                    Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix
                                    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

                                    Forum Jump


                                    All times are GMT -8. The time now is 7:29 AM.