Skip to content
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

Add Custom Music Support, with new way of shuffling music by recreating the sound archive #641

Merged
merged 3 commits into from
Feb 14, 2023

Conversation

Kewlan
Copy link
Collaborator

@Kewlan Kewlan commented Jan 29, 2023

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 is Custom 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 of dynamic_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.

Shuffles music, original and new, by recreating the sound archive
@gymnast86 gymnast86 merged commit 2c0eceb into gamestabled:main Feb 14, 2023
@Kewlan Kewlan deleted the custom-music-2 branch March 11, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants