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

Custom Audio Improvements #1966

Merged
merged 8 commits into from
Jun 16, 2023
Merged

Custom Audio Improvements #1966

merged 8 commits into from
Jun 16, 2023

Conversation

rrealmuto
Copy link

@rrealmuto rrealmuto commented Apr 29, 2023

This PR adds additional custom music capabilities to OOTR.

  • Custom instrument sets/instruments can be defined within sequences, instead of relying on ones built in to OOT.
  • Custom sequences now packaged into a ".OOTRS" file - essentially just a zip file containing all of the necessary info for the custom sequence, including the new instruments if required.

A general explanation of how this works on the technical side. Shout out to owl_is_not_a_cat (is a cat though), and the MMR folks for figuring this out:

  • The Audiobank and Audiotable (instrument sample) files are relocated, and additional banks/instruments are added at the end.
  • Audiobank pointer table is relocated and increased in size, new banks are added to the end of the table. References to this table in the code are updated to point to the new table.
  • Audiobank load status table is relocated and increased in size. This increases the maximum number of usable banks from 0x30 to 0x80. All references to this table in the code are updated to point to the new table.
  • Music.py processes new audiobanks/instruments from the metadata files inside .OOTRS and adds them to the new tables. Bank offsets are calculated and added to the new audiobank pointer table. Instrument offsets are calculated and replaced inside their respective banks.
  • The Music.py script checks if identical banks/instruments have been previously loaded from other sequences, and will update offsets accordingly instead of loading duplicates.

I think that's the gist of it.

Would like to get some feedback on this one.

@fenhl fenhl added Type: Enhancement New feature or request Component: Cosmetics Affects the patching of cosmetics labels Apr 29, 2023
@Cuphat
Copy link
Collaborator

Cuphat commented Apr 29, 2023

Can you rebase it on the base dev branch instead of one including silver rupee shuffle and the like so it is easier to see the diffs?

@rrealmuto
Copy link
Author

Can you rebase it on the base dev branch instead of one including silver rupee shuffle and the like so it is easier to see the diffs?

yeah I forgot that I had it on top of silver rupees.

@rrealmuto
Copy link
Author

rrealmuto commented Apr 29, 2023

Still to do:

  • Maybe a bit more refactoring of the code in Music.py
  • Add/Improve documentation for creating custom sequences in the new format, with custom instruments
  • (problem for another day) Maybe try fixing the issue where custom audio cuts out in areas like Goron city when fanfares play.

@owlisnotacat1
Copy link

I started to write a guide for making custom banks https://gist.github.com/owlisnotacat1/e5445c154b46a9d7804b139800dfffbe

Music.py Outdated Show resolved Hide resolved
@rrealmuto rrealmuto marked this pull request as ready for review June 2, 2023 22:51
.gitignore Outdated
@@ -31,6 +31,7 @@ data/Models/Adult/*.zobj
data/Models/Adult/Pieces
data/Models/Child/*.zobj
data/Models/Child/Pieces
data/Music/*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a separate .gitignore in data/Music for excluding .seq and .meta files. To keep the readme in the Music folder, .ootrs files should be added to that file instead of the entire folder here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm then I gotta figure out why any time I add custom music, git sees it as untracked... Anyway I'll do as you suggest. Thanks!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 152/186 needs to be edited to use ootrs in the custom sequence exclusions file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does opening a draft PR basically just mean nothing 😐

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is not marked as a draft.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened it as a draft a month ago... just a bash as mracsys for not giving me a comment on it until I marked it ready.

@@ -1094,6 +1094,17 @@ def patch_music_changes(rom, settings, log, symbols):
}
}

# 7.2.0
patch_sets[0x1F073FDD] = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, forgot to submit this one with the others.

This conflicts with the patch set for ocarina note shuffle (#1885). Can this be incremented to 0x1F073FDE to maintain consistency between patch files in test branches?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't make me hit you

@Cuphat Cuphat merged commit ce1e555 into OoTRandomizer:Dev Jun 16, 2023
3 checks passed
@rrealmuto rrealmuto deleted the audio branch September 23, 2023 00:53
@fenhl fenhl added this to the 8.0 milestone Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Cosmetics Affects the patching of cosmetics Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants