• 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.

[Other] Music hacking

88
Posts
13
Years
    • Seen Jun 18, 2020
    Hi everyone,

    I have a few questions about music hacking. Well, I want to insert a new music in my game, so I inserted my .s file with Sappy, but there are many problems :

    - First, in game, it seems that many instruments don't exist. Is it possible de have a "complete" voicegroup with all instruments ?

    - Then, the sound level of my music is low, I don't know why.

    - Finally, there is a "white noise" over my music...


    Can someone help me ? Thanks :)
     
    325
    Posts
    10
    Years
  • Hi everyone,

    I have a few questions about music hacking. Well, I want to insert a new music in my game, so I inserted my .s file with Sappy, but there are many problems :

    - First, in game, it seems that many instruments don't exist. Is it possible de have a "complete" voicegroup with all instruments ?

    - Then, the sound level of my music is low, I don't know why.

    - Finally, there is a "white noise" over my music...


    Can someone help me ? Thanks :)
    1: check the Research and Development, there's a complete voicegroup there.
    2: You mean sound quality or volume? If it's volume, then you're going to have to use a midi-editing program to raise the volume. If it's sound quality, then it's probably the fact that not all your instruments got inserted right, which might be fixed with the answer to the first.
    3: I don't understand, can you specify?
     

    Exodrake

    The Manliest Chick that Ever Manlied
    163
    Posts
    10
    Years
    • Seen Nov 30, 2016
    Don't just assemble your .s file without first finding ample free space (you can get Free Space Finder here: http://www.romhacking.net/utilities/540/). I usually set the search for bytes to around 10000 to be safe, and start searching at offset 700000 (I use FireRed, you didn't specify your ROM of choice which makes it harder for me to help you). I also don't directly assemble the .s file to my final ROM, I make a copy and use that as a dummy to work all the bugs out of my song, then export the tracks and import them into my final ROM.

    To repoint your song to a safe offset, search for a lot of free space, copy the offset that Free Space Finder brings up, then paste that into the "first track" offset when importing the tracks.

    For editing instruments, are you using the modded Sappy 2006? It has a very handy dandy Edit Voicegroup feature which you can use to fix your instruments. Be aware of the GBA's sound limitations, though: 5 DirectSound/Multi-sample tracks playing a single note (multiple notes and they will start overriding each other), Square Wave 1, Square Wave 2, Wave Memory, and Noise can all play at a time. This means you can have up to 9 tracks playing at once, but a maximum of 10 can be in a song if you need that, just not all 10 playing at once.

    You will have to edit any MIDI not already tailor-made for the GBA in a MIDI editor, or else your MIDI will surely sound messy; I use Anvil Studio (a quick google search will work for that, it's free software but has a bit of a learning curve). I generally follow the rule of thumb that with chords (multiple notes which play at the exact same time), always keep the highest note. You may want to use the "merge" feature to combine redundant tracks of the same instrument, but always use "repair track" after doing this to fix any bad programming that merging tracks may introduce. In Anvil Studio you can edit the volume of the tracks, but I prefer doing this out of the .s file (there's a VOL line of code which corresponds to the volume, don't go higher than 127 on this!).

    There is a complete instrument patch for FireRed, as well as a High Quality sound patch (both are in the Research and Development board), the latter of which reduces noise output (the noise may also be from your song being too quiet or loud; if it's too loud the song generates noise). The instrument patch was also ported to Emerald, I do believe. Don't bother with Ruby, Sapphire or LeafGreen. Ruby and Sapphire don't have very many instrument samples to work with, and all three of those ROMs have very little research compared to FR and EM. Also, here's a voicegroup offset reference for FireRed you may find useful if that's the game you are working with, and you don't want to use the instrument patch: http://www.pokecommunity.com/showthread.php?t=148811 It doesn't have every instrument ever, but there are a lot to work with. (I personally have problems with the sound patch so I manually imported instrument samples from Fire Emblem games to fill in what I was missing and needed.)

    I suggest getting the hang of Anvil Studio's learning curve, merging and simplifying music tracks, optimizing the volume for the GBA, and also program changes, which can be used to change a track's instrument and is easy to insert in Anvil Studio (insert > MIDI control event > program change...). Music hacking is hard, there's no getting around this. This is my field of expertise, so if you get stuck feel free to message me and I'll help you.
     
    Last edited:
    88
    Posts
    13
    Years
    • Seen Jun 18, 2020
    Thanks for your anwsers !

    I made my own voicegroup and I also try to use this voicegroup, finally I can hear the right instruments. Also, it's not an offset problem, I have enough free space.

    So, I have only two problems : the sound volume AND the sound quality.

    For the volume, I tried to edit to .s file :

    [...]
    .include "MPlayDef.s"

    .equ tmp0_grp, voicegroup000
    .equ tmp0_pri, 10
    .equ tmp0_rev, 0
    .equ tmp0_mvl, 127
    .equ tmp0_key, 0
    .equ tmp0_tbs, 2
    .equ tmp0_exg, 1
    .equ tmp0_cmp, 0

    .section .rodata
    .global tmp0
    .align 2

    @**************** Track 1 (Midi-Chn.1) ****************@

    tmp0_1:
    .byte KEYSH , tmp0_key+0
    @ 000 ----------------------------------------
    .byte TEMPO , 240*tmp0_tbs/2
    .byte VOICE , 48
    .byte VOL , 127*tmp0_mvl/mxv
    .byte N24 , As1 , v100
    .byte W48
    .byte N24 , As1 , v100
    .byte W96
    .byte W48
    [...]

    I have to edit the strong line, right ? I set 127 in both lines and I think this problem is okay.

    And in Sappy, the music sounds perfect, but in the game, there is a white noise... I don't know how to explain it, just like a sound "ffffffff" over my music x)
    If set the sound to 127, I can still hear a whoise noise, but this one is much lower.


    If this can help you, here is my .s file : https://up.levert.ch/d4cee5-bourg.s
    And my voicegroup : http://up.levert.ch/9af04c-Voicegroup.bin
     

    Exodrake

    The Manliest Chick that Ever Manlied
    163
    Posts
    10
    Years
    • Seen Nov 30, 2016
    One thing to watch out for is the overall volume of all your tracks together. If your song on the whole is too loud, you will get noise in the actual GBA even when you won't hear it in Sappy. All you can do to fix this is to make the entire song quieter until this stops happening. There will always be some noise output in the actual game which you don't hear in Sappy though, unless you implement the high-quality sound hack I mentioned above.

    Also, the first value you highlighted should not be tampered with, only the second one, the VOL byte :) Every track has its own VOL byte and may have multiple ones if the track's volume changes during the song. I've worked with songs that had hundreds of these volume change bytes and that wasn't fun, but yeah, you should try to edit them all consistently so the volume balance remains similar to how it originally was, since messing up this balance can really affect how the song sounds.
     
    Last edited:
    88
    Posts
    13
    Years
    • Seen Jun 18, 2020
    The problem is that even if I insert a music with just one track really not loud, the white noise is still here...
     
    Back
    Top