-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
decompile songs to MIDI files #137
Conversation
It is an old gcc behaviour to pass information to gdb. It causes duplicated symbols at the same address which is confusing. pret/agbcc#50
|
It doesn't match yet. The size of song converted from midi is often bigger than vanilla, which causes address offset.
Converted song002:
sound/songs/song002.s: vanilla For example,
Converted song002:
They have same duration but different bytes: Note: It produces the same problem to dump midi files by unmodified VGMusicStudio and convert them by hacked mid2agb with It is caused by incorrect Time Signature, because it is not always 4/4. We need to fix it to match one by one.
|
I didn't fix them because I won't use it anymore.
The songs with different size after conversion are splitted to Some songs with same size are still different in several bytes. Most of them have unordered commands. I added @freshollie's workarounds to mid2agb to match some more cases where some of the original compiled midi tracks had a different order to the VOL and KEYSH commands, but the order of those commands is still incorrect sometimes. Guess: some songs especially for sound effect in Fire Emblem series are converted from MML by MML2AGB, not from MID by MID2AGB. Its order of commands are decided by the order written in .mml files directly. |
Some songs need to align all tracks while others not. Add -A option to mid2agb to enable track alignment. https://github.com/FireEmblemUniverse/fireemblem8u/blob/94d53ef4d521f3f305412d5244d84cf68f411aa4/scripts/dump_sound/Program.cs#L306
|
fireemblem8u/sound/songs/song067.s Line 2276 in 94d53ef
Guess: it seems that the behaviour of pret's Official version: PRET's version: Why? |
"" = an empty slot with a dummy song |
How to fix KEYSH orderTake ReasonIf the volume of a track is the same as the max volume of the song, then it can be omitted, and Note: it can be omited doesn't mean it must be omitted. It is totally alternative. Both are valid:
Fix it only when the order doesn't match, otherwise they will match at first obviously. SolutionSet the max volume of the song correctly, adjust all volumes in the song, and delete the volume at that track. How to decide the max volume of the song?There are 2 ways:
How to fix volumes in midi?We need to calculate the new volume: That is a tedious work for all volume commands in all midi files with the same problem, so we can use a dumper such as Reference
|
…ollie/sa2." This reverts commit 1105344.
|
How to fix missing patterns
|
How to fix lengthSome redundant waits after ReasonIt is caused by Kermalis/VGMusicStudio@997a4f7 hack for Kermalis/VGMusicStudio#36 which has already been removed. SolutionIt is really easy to fix it with any midi editor or re-export it. Example |
How to split wait commandProblemSolutionMatched this with a load of dummy note events 🤦♂️ This project doesn't have this case. Provided by @freshollie. Refer to SAT-R/sa2@9133045 if interested. For memo purpose. |
All Midis Match Completed!🎉
Status: 🆗
ℹ️Information on build
It is a huge change so run
make clean
before pull from remote to your local machine, or re-clone a clean git repo to build it. Remember to rebuildtools/mid2agb
too.Practical experience for other disasm/decomp projects
It is a nightmare to match MIDI files. Common problems and solutions are collected here. Hope this doc will make life easier for others.
Steps summarized by freshollie