Results 1 to 12 of 12

Thread: Pokémon Black and White - Assigning different Trainer Music

  1. #1

    Pokémon Black and White - Assigning different Trainer Music

    When you're spotted by another Trainer, you hear a certain kind of music.

    For example, when an Ace Trainer or Veteran Trainer has spotted you, this music's being played:
    http://www.youtube.com/watch?v=KJ4HsOAZwho

    And when you are about to battle a Psychic, you hear this strange music:
    http://www.youtube.com/watch?v=HTFbRZT-HCs

    The encounter music is determined by the Trainer Class you are about to battle. If you are about to battle a Psychic with an Ace Trainer's overworld sprite, you still hear the Psychic's encounter music.

    tl;dr
    Is there a way to edit the encounter music and assign a different encounter music to a certain Trainer Class?

    ------------------------------------------------------------------------------------------------------------------------------------------------

    Additional information
    For example, I am going to add the Aroma Lady Trainer Class in my hack. Therefore, I am replacing an old Trainer Class, the Baker. But I want a different encounter music because I find the ''Parasol Lady'' music better for the Aroma Lady:
    http://www.youtube.com/watch?v=ac1JCG7vsAI

    In other words, can I assign the Parasol Lady encounter music to the Baker's Trainer Class?


    Beta Version 0.85 BRAND NEW!
    OUT NOW!

    (as of 06/12/'12)

  2. #2

    Re: Pokémon Black and White - Assigning different Trainer Music

    if you mean changing sound on NPC? you can using :

    Method 1 : go to http://projectpokemon.org/forums/sho...Champion-Music (changing some hex value on SDat, using crystaltile and hex editor) actually is same because all sound is stored on sdat except for pokemon musical.
    Method 2 : ...
    Pokemon X
    3DS FC : 3239-4504-5700 (Andibad), Need For Friend Safari, if someone help me out pm me for adding back your FC ^^

  3. #3

    Re: Pokémon Black and White - Assigning different Trainer Music

    Thanks a lot for your reply, Andibad, but I already found something else. Actually thanks to elementking, who taught me that the arm9.bin file is compressed. By decompressing it, I found very valuable hex data.

    So in the decompressed arm9.bin file, I actually found data for the encounter music. The offset is, exactly, 0xA35C8.

    The first line is as follows:
    02 00 5A 04 03 00 5B 04 04 00 5A 04 05 00 5B 04 32 00 5D 04

    02 00 means Trainer Class 2 (which is the Youngster).
    5A 04 corresponds with the different Trainer Class music versions. 5A 04 is the Youngster, joyful encounter music: ''EYE1''.

    The following is a complete list with Encounter music, in combination with their hex numbers:

    045A EYE1 Youngster
    045B EYE2 Lass
    045C EYE3 Twins
    045D EYE4 Ace Trainer
    045E EYE5 Roughneck
    045F EYE6 Parasol Lady
    0460 EYE7 Cyclist
    0461 EYE8 Psychic
    0462 EYE9 Scientist
    0463 EYE10 Harlequin
    0464 EYE11 Hiker
    0465 EYE12 Clerk
    0466 EYE13 Gentleman
    0467 Team Plasma Encounter Music

    If you look at the third and fourth hex digits, it shows the following.
    • 03 00 means Trainer Class 3 (which is the Lass).
    • 5B 04 corresponds with ''EYE2''.

    Which is true.

    Even more:
    • 32 00 means Trainer Class 50 (which is the Male Ace Trainer).
    • 5D 04 corresponds with ''EYE4''.

    Which is true again.

    I checked EVERY Trainer Class this way and it works like this everytime. For example, Trainer Class 23 00, which is the Psychic (Male) Trainer Class, has 04 61 = EYE8 encounter music. This again is true. In other words, this must be the correct data. The narc even says field_sound_system at the top of this data.

    HOWEVER! Here's the problem that I would like some help with.
    When I change a certain number (either the Trainer Class number or the corresponding ''EYE'' music number), literally nothing happens. I really don't know what I'm doing wrong. It could possibly be the way I insert / extract (decompress / compress) the arm9.bin file. Though I'm pretty sure I do it the correct way.

    Could anybody somehow test this?.. Or does anybody know what I am doing wrong? Or whether there could be anything else I have to change? I really doubt it because this data is so.. obviously right.
    Last edited by Oxnite; May 11th, 2012 at 10:13 AM.


    Beta Version 0.85 BRAND NEW!
    OUT NOW!

    (as of 06/12/'12)

  4. #4

    Re: Pokémon Black and White - Assigning different Trainer Music

    Yes you right. But i think is have missing step (last i touch arm9.bin, i was done to recompress them correctly and replace is seems correct, after i test it is nothing but another problem i was break arm9 xD). Is another method and seems you try change id trainer on *.bin . For now i can't help you about edit arm and overllay stuff, i no have time to do or prepare them because my brain was mixed with my midtest is very very hard :/
    And sorry i can't help you maybe mid july i get my time xD

    PS: and your new beta is make me relax a while xD, and you have time to teach me something i can't? For arm9 and overllay i was know about them and thank you for you explain but i was know about that. Yeah swarming pokemon too on that part. I using CUE for compressing and dscemp for decompressing.

  5. #5

    Re: Pokémon Black and White - Assigning different Trainer Music

    Quote Originally Posted by Andibad View Post
    Yes you right. But i think is have missing step (last i touch arm9.bin, i was done to recompress them correctly and replace is seems correct, after i test it is nothing but another problem i was break arm9 xD). Is another method and seems you try change id trainer on *.bin . For now i can't help you about edit arm and overllay stuff, i no have time to do or prepare them because my brain was mixed with my midtest is very very hard :/
    And sorry i can't help you maybe mid july i get my time xD

    PS: and your new beta is make me relax a while xD, and you have time to teach me something i can't? For arm9 and overllay i was know about them and thank you for you explain but i was know about that. Yeah swarming pokemon too on that part. I using CUE for compressing and dscemp for decompressing.
    So in other words, arm9.bin always .. breaks when you try to recompress it? Could that be causing the problems?

    And could you maybe tell me the offset for the Swarm Pokémon?


    Beta Version 0.85 BRAND NEW!
    OUT NOW!

    (as of 06/12/'12)

  6. #6
    Pokémon Modder supagokuman2's Avatar
    Join Date
    May 2012
    Location
    Monterrey, NL
    Age
    23
    Posts
    15

    Re: Pokémon Black and White - Assigning different Trainer Music

    i inserted my own song to the rival battle, but it stops after a while and the battle is just mute. Do you know how to fix that?

  7. #7

    Re: Pokémon Black and White - Assigning different Trainer Music

    you have to loop it.

  8. #8
    Pokémon Modder supagokuman2's Avatar
    Join Date
    May 2012
    Location
    Monterrey, NL
    Age
    23
    Posts
    15

    Re: Pokémon Black and White - Assigning different Trainer Music

    How do I loop it?
    Plus, the song is a bit slow.
    On another song I also did it has long pauses.

  9. #9

    Re: Pokémon Black and White - Assigning different Trainer Music

    this thread is about assigning different pre-existing music to a trainer, not assigning new music.

    there's a few guides on how to loop sseq's (I know pokecommunity has one), so look there; change the bpm in your midi editor (fl studio etc)

  10. #10
    Pokémon Modder supagokuman2's Avatar
    Join Date
    May 2012
    Location
    Monterrey, NL
    Age
    23
    Posts
    15

    Re: Pokémon Black and White - Assigning different Trainer Music

    You're right, and I have successfully looped it, but it's missing some instruments and at parts slows down/speeds up, or plays the same note for a long period of time.

    If you can help, PM me.

    ON-TOPIC:
    That music that plays as an encounter is th EYE files, right?

  11. #11
    Super Moderator Translation ContributorDeveloperGame Save ResearcherROM ResearcherRAM ResearcherIRC AOPEvent ContributorSuper Moderator
    Join Date
    May 2010
    Location
    pc + 8
    Age
    29
    Posts
    1,153

    Re: Pokémon Black and White - Assigning different Trainer Music

    Quote Originally Posted by Oxnite View Post
    So in other words, arm9.bin always .. breaks when you try to recompress it? Could that be causing the problems?

    And could you maybe tell me the offset for the Swarm Pokémon?
    you don't need to recompress it. just put it back in. MIi_UncompressBackwards() just won't do anything when it goes to decompress the arm9 on booting. it should work.


    e: btw, i just did the disassembly. this is a lookup table of trainer ids and music that is accessed by the subroutine at 2029E38. the function takes the id of the trainer and uses that to look up what music matches that. interesting little routine.

    e2: here you go: http://pastebin.com/7XHzR3ys

    Code:
        RAM_ARM9:02029E38             ; =============== S U B R O U T I N E =======================================
        RAM_ARM9:02029E38
        RAM_ARM9:02029E38
        RAM_ARM9:02029E38             ; u16 __fastcall getNPCBattleMusic__(u16 npcID)
        RAM_ARM9:02029E38             getNPCBattleMusic__
        RAM_ARM9:02029E38 18 B4                       PUSH    {R3,R4}
        RAM_ARM9:02029E3A 0A 4A                       LDR     R2, =word_20A75C8 ; LUT pointer
        RAM_ARM9:02029E3C 00 24                       MOVS    R4, #0          ; int i = 0
        RAM_ARM9:02029E3E 11 88                       LDRH    R1, [R2]        ; load first LUT entry, see if we even need to loop
        RAM_ARM9:02029E40 69 29                       CMP     R1, #0x69 ; 'i' ; this should pretty much never be equal
        RAM_ARM9:02029E42 0C D0                       BEQ     loc_2029E5E
        RAM_ARM9:02029E44
        RAM_ARM9:02029E44             loc_2029E44                             ; CODE XREF: getNPCBattleMusic__+24j
        RAM_ARM9:02029E44 A3 00                       LSLS    R3, R4, #2      ; each entry is 4 bytes (u16 npcID and u16 songVal), so loop counter *4 to hit each entry in a row
        RAM_ARM9:02029E46 D1 5A                       LDRH    R1, [R2,R3]     ; LUT_base + loop_counter * 4 to run through each entry, fetching the npcID to test against the passed arg
        RAM_ARM9:02029E48 88 42                       CMP     R0, R1          ; npcID == LUTnpcID
        RAM_ARM9:02029E4A 03 D1                       BNE     loc_2029E54     ; if not, jump past the return statement
        RAM_ARM9:02029E4C 06 48                       LDR     R0, =0x20A75CA  ; if they are equal, LUT_base + 2(to align for the songVal)
        RAM_ARM9:02029E4E C0 5A                       LDRH    R0, [R0,R3]     ; (LUT_base + 2) + (loop_counter * 4) to adjust for alignment + 2nd half of each entry- return songVal
        RAM_ARM9:02029E50 18 BC                       POP     {R3,R4}
        RAM_ARM9:02029E52 70 47                       BX      LR
        RAM_ARM9:02029E54             ; ---------------------------------------------------------------------------
        RAM_ARM9:02029E54
        RAM_ARM9:02029E54             loc_2029E54                             ; CODE XREF: getNPCBattleMusic__+12j
        RAM_ARM9:02029E54 64 1C                       ADDS    R4, R4, #1      ; i++ if the npcID didn't pan out on the previous run
        RAM_ARM9:02029E56 A1 00                       LSLS    R1, R4, #2      ; loop_counter * 4 for alignment
        RAM_ARM9:02029E58 51 5A                       LDRH    R1, [R2,R1]     ; (loop_counter * 4) + LUT_base, jump into LUT to next entry
        RAM_ARM9:02029E5A 69 29                       CMP     R1, #0x69 ; 'i' ; is the npcID the max?
        RAM_ARM9:02029E5C F2 D1                       BNE     loc_2029E44     ; if not, run the loop again and jump into the LUT at the next entry
        RAM_ARM9:02029E5E
        RAM_ARM9:02029E5E             loc_2029E5E                             ; CODE XREF: getNPCBattleMusic__+Aj
        RAM_ARM9:02029E5E 03 48                       LDR     R0, =0x45A      ; if it is the max value, return the default battle music
        RAM_ARM9:02029E60 18 BC                       POP     {R3,R4}
        RAM_ARM9:02029E62 70 47                       BX      LR
        RAM_ARM9:02029E62             ; End of function getNPCBattleMusic__
        RAM_ARM9:02029E62
        RAM_ARM9:02029E62             ; ---------------------------------------------------------------------------
        RAM_ARM9:02029E64 C8 75 0A 02 off_2029E64     DCD word_20A75C8        ; DATA XREF: getNPCBattleMusic__+2r
        RAM_ARM9:02029E68 CA 75 0A 02 dword_2029E68   DCD 0x20A75CA           ; DATA XREF: getNPCBattleMusic__+14r
        RAM_ARM9:02029E6C 5A 04 00 00 dword_2029E6C   DCD 0x45A               ; DATA XREF: getNPCBattleMusic__:loc_2029E5Er

  12. #12

    Re: Pokémon Black and White - Assigning different Trainer Music

    The solution has been found, with great thanks to Bond697!

    This is what I asked him:
    Quote Originally Posted by Oxnite
    Hi, Bond697!

    Thanks for your information in this topic: http://projectpokemon.org/forums/sho...-Trainer-Music

    However, I still can't get it to work.
    • Are you saying that I should decompress the original arm9.bin file (by using ''Extract'' in CrystalTile2), then edit it by using a hex editor, and then add it to the .nds file again using CrystalTile2's ''Import'' function? This means that I'm adding an uncompressed file that's bigger than the original arm9.bin (because it's uncompressed this time). Is that OK? And what should I do when this message shows up?
    • I tried editing the following part (it's the encounter music information, starting at 0xA35C8 of arm9.bin):
      02 00 5A 04 03 00 5B 04 04 00 5A 04 05 00 5B 04 32 00 5D 04 31 00 5D 04 46 00 5D 04 47 00 5D 04 19 00 5D 04 18 00 5D 04 12 00 5F 04 11 00 5A 04 2E 00 62 04 34 00 62 04 2A 00 5B 04 29 00 5A 04 4B 00 66 04 4C 00 66 04 33 00 61 04 40 00 61 04 3C 00 63 04 3B 00 63 04 1D 00 64 04 5B 00 60 04 5A 00 60 04 55 00 5F 04 54 00 60 04 06 00 64 04 49 00 64 04 35 00 64 04 07 00 64 04 2B 00 65 04 2C 00 65 04 1A 00 65 04 22 00 65 04 0D 00 5F 04 42 00 65 04 30 00 5F 04 43 00 65 04 3A 00 65 04 1B 00 64 04 1C 00 64 04 3D 00 65 04 3E 00 65 04 23 00 61 04 24 00 61 04 53 00 65 04 39 00 5E 04 48 00 61 04 1F 00 5E 04 1E 00 63 04 20 00 63 04 21 00 66 04 56 00 65 04 57 00 66 04 41 00 5F 04 4A 00 64 04 10 00 5C 04 3F 00 5E 04 44 00 63 04 45 00 63 04 27 00 67 04 4D 00 67 04 2D 00 64 04 0F 00 5C 04 0E 00 5C 04 08 00 65 04 09 00 65 04
      The red aligned part holds information for the Black Belt Trainer Class. 33 00 is the id of the Black Belt trainer; 61 04 correctly corresponds with the encounter music used for Black Belts, EYE8. Say I want Black Belts to have the Gentleman's encounter music. Then I'd have to change 61 04 to 66 04, right? (Because 66 04 corresponds with EYE 13, the Gentleman music). However, that's what I did but the Black Belt still has its own encounter music.


    What am I doing wrong..?

    (...)
    The solution is very simple. It turns out that inserting the arm9.bin file into the rom using CrystalTile2 method doesn't work (at least, for me). Therefore, you should use this method:

    use dsbuff and unpack the rom. decompress the arm9 however(or use ct2 to extract a decompressed copy). change the stuff you want like you said and repack the rom with dsbuff.
    DSBuff just repacks the entire rom (without the need of replacing the arm9.bin file).

    Thank you very much for your help, again, Bond697!


    Beta Version 0.85 BRAND NEW!
    OUT NOW!

    (as of 06/12/'12)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •