Add Custom Music Support, with new way of shuffling music by recreating the sound archive #641
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a new way of shuffling music by replacing music files and recreating the sound archive. For that to be possible, the QueenSound.bcsar file has to be placed in
/OoT3DR/Custom Music/
in the SD card.Shuffling music this way avoids several bugs, like the wrong music playing after minibosses/minigames, at GC to LW shortcut, and the replaced enemy theme playing wrong in certain locations. (The Sun's Song bug is still present.)
If the archive isn't found, the previous music shuffle implementation will be used.
On app start, two trees of folders will be created. One for BGM and one for melodies. (Fanfares and Ocarina Songs)
Each music file has a leaf that represents it. When music is shuffled, a leaf will pick a random sequence from it's node or it's ancestors to replace the original sequence, and then remove it for any other leaf to pick.
For example, if you want a sequence to only appear in Hyrule Field, you'd place it in the Hyrule Field folder at
Custom Music/Background Music/Area Themes/Overworld/Hyrule Field/
. If you want a sequence to appear anywhere in the overworld, you'd place it in the Overworld folder. If you don't care where it appears, you would place it in the root, which for BGM isCustom Music/Background Music/
.On top of placing the sequence file (.bcseq) file in the folder, a
.cmeta
file can be provided to set which bank should be used, and which channel flags to set. This should have the same name (without the .bcseq extension) as the sequence file. If none is found, the bank is set to Orchestra with all channel flags enabled.I decide to use a new directory for this in the SD Card, from root being:
/OoT3DR/
. I think we should move presets and spoiler logs here too, so it's easier to find for users. Spaces and capitalization seem to be in line with what the 3DS already uses.There have been some slight changes to the existing music shuffle settings. Now there are only two, one for BGM and one for melodies, where you can select them to be shuffled all mixed together, in groups, or own. When set to Own, they can only appear in their original location. This is meant to be used with Custom Music.
-fno-rtti
was removed from the make file to allow the use ofdynamic_cast
. As far as I can tell this is fine, but I can make do without it if necessary.Special thanks to Gota7 and his work on Citric Composer, making this possible! Code ported from that has had a comment added near the top of the file.