• 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?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Audio✓] Help with adding music

2
Posts
5
Years
  • Hi, I am rather new to disassembly, and I'm not sure how to add background music for towns and such in pokeemerald. Also, is there a specific file format the music file has to be in to work? Thanks so much.
     
    Last edited:

    Lyzo

    Back from vacation
    261
    Posts
    17
    Years
  • Hi, I'm also relatively new, I found this so far though..

    You can change songs by replacing the .midi files in sound/songs/midi. You can also change the way songs sound by editing their .s files and modifying the voicegroup line (often line 3). In PokeEmerald there are 101 voicegroups in total. Each voicegroup has different instruments, that's why changing the voicegroup changes the way the song sounds. The .midi files are the notes, the voicegroups are the instruments.

    I'm not entirely certain on how to add new songs or voicegroups though... So far I've tried adding new .midi files to the folder, editing the songs.h to include that file + adding a .s file that I generated with Mid2gbac. But I'm not getting the new songs to play just yet..

    I found several threads that might get us in the right direction though:

    They're all music hacking threads for binary hacking. This might give us an idea of how to add new voicegroups or how to properly implement new songs.

    If you find anything new out, keep me updated!
     
    16
    Posts
    10
    Years
    • Seen Jul 18, 2021
    Are there any updates for how to add music? I searched on here and this was the only relevant thread on the matter.
     

    manta

    ★★★★★
    91
    Posts
    8
    Years
    • Seen Feb 2, 2024
    Are there any updates for how to add music? I searched on here and this was the only relevant thread on the matter.

    I'm currently in the midst of figuring out music in decomps too. Basicially...

    1. Get the MIDI for the song you'd like to add, and put it in (sound/songs/midi)
    2. Add the new midi file to songs.mk. You can reference the previous entries for info. By the way the, G is voicegroup and V is volume.
    3. Add the new midi file to ld_script.txt (the linkerscript).
    4. Add the midi into the song table (sound/song_table.inc)
    5. Also for ease of use add a new constant in (include/constants/songs.h).

    As for making new voicegroups, then simply
    1. Create the actual voicegroup file (it's an .inc file) and put it in (sound/voicegroups)
    2. Next include this new file in (sound/voicegroups_inc)
    You have to bare in mind not all voicegroups are used for songs, some are used for keysplits in instruments such as the drums.
     
    16
    Posts
    10
    Years
    • Seen Jul 18, 2021
    I'm currently in the midst of figuring out music in decomps too. Basicially...

    1. Get the MIDI for the song you'd like to add, and put it in (sound/songs/midi)
    2. Add the new midi file to songs.mk. You can reference the previous entries for info. By the way the, G is voicegroup and V is volume.
    3. Add the new midi file to ld_script.txt (the linkerscript).
    4. Add the midi into the song table (sound/song_table.inc)
    5. Also for ease of use add a new constant in (include/constants/songs.h).

    As for making new voicegroups, then simply
    1. Create the actual voicegroup file (it's an .inc file) and put it in (sound/voicegroups)
    2. Next include this new file in (sound/voicegroups_inc)
    You have to bare in mind not all voicegroups are used for songs, some are used for keysplits in instruments such as the drums.

    I've made about as much progress as you (well, perhaps a little less. I didn't really make any new voicegroups just yet). Anyway, I'm coming back to post a little more detailed of a tutorial than what you've posted thus far.

    My journey started with wanting to import a song used from a mobile game into the ROM. The mobile game, I found out, was built using Unity. This meant that the songs were all packaged in a pretty strange way, but after some research, I came across this tool: https://github.com/DerPopo/UABE By pointing the tool to the AssetBundle, then clicking Info > Plugins > Extract Audio Plugin (something along those terms) it will then produce a .wav file holding the song requested.

    Now comes the hard part. After a lot of research, I found the best tool to convert a .wav into a decent MIDI file is called Celemony Melodyne. There is a free trial available, and other ways of getting the program. Using the program, you need to set the algorithm to Polyphonic then Save As a MIDI file. Next, for editing the file, I found the Free Open Source Software, MidiEditor, most useful. In order to get the MIDI sounding correctly, you will need a VirtualSynth other than the built-in Microsoft one. Additionally, you will need a Soundfont that matches the GBA games. For the VirtualSynth, I found this worked best: https://coolsoft.altervista.org/en/virtualmidisynth and it needs to be paired with this https://coolsoft.altervista.org/en/midimapper and here is the Soundfont https://musical-artifacts.com/artifacts/579

    The song I was attempting to add (and managed to, but it will need some more work in MidiEditor) would be used for a new battle music. For the sake of this post, I will assume that anyone using this as a guide is also wanting to add new battle music, as it was what I found the triggers for.

    Optionally, add a new trainer class, so that any original trainer classes don't have their battle music changed. For my own testing, I made a trainer class "WEEB" but this can be called whatever you want. To add the trainer class, do the following:

    Spoiler:


    To add the music, it is much the same as is said above. I will just expand upon it.
    Spoiler:


    Those are my findings so far, I am curious what progress you've made in the voicegroup area. Could you share some links or resources you've found?
     
    Last edited:
    Back
    Top