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 Support #778

Open
wants to merge 92 commits into
base: develop
Choose a base branch
from

Conversation

louist103
Copy link
Contributor

@louist103 louist103 commented Sep 24, 2024

Adds custom audio support.

  • Adds support for the classic custom audio using custom .aseq files and meta files (sequenced audio).
  • Adds support for mp3, wav, flac, etc audio sequences (streamed audio).
  • Exports all audio assets, sequences, sound fonts, and samples as XML for easier modifications.
  • Names samples that were copied from OOT.

Needs:

Build Artifacts

@HeinrichVonStinkenfinger

Is this in SoH too?

@louist103
Copy link
Contributor Author

Is this in SoH too?

Custom audio is in SoH. Streamed audio is not. I plan on back porting this when it is merged.

Copy link
Contributor

@Archez Archez left a comment

Choose a reason for hiding this comment

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

Initial pass on some things from my end. Also don't forget to clang-format.

@@ -7,3 +7,6 @@
[submodule "ZAPDTR"]
path = ZAPDTR
url = https://github.com/louist103/ZAPDTR.git
[submodule "mm/2s2h/Enhancements/Audio/dr_libs"]
Copy link
Contributor

@Archez Archez Nov 6, 2024

Choose a reason for hiding this comment

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

I think we should just fetch the drlibs via cmake with Fetch_Content, this way it's controlled like our other dependencies.

Here is LUS doing it https://github.com/Kenix3/libultraship/blob/main/cmake/dependencies/common.cmake

mm/2s2h/BenGui/BenGui.cpp Outdated Show resolved Hide resolved
@@ -165,6 +165,7 @@ list(FILTER src__ EXCLUDE REGEX "src/libultra/libc/*")
list(FILTER src__ EXCLUDE REGEX "src/libultra/os/*")
list(FILTER src__ EXCLUDE REGEX "src/libultra/rmon/*")
list(FILTER src__ EXCLUDE REGEX "src/libultra/*")
list(FILTER ship__ EXCLUDE REGEX "2s2h/Enhancements/Audio/dr_libs/*")
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this once drlib is moved to cmake fetch.

Comment on lines +5104 to +5106
// 2S2H [Custom Audio] was originally `seqId + 7F00` This value did not work with the bit packing done
// for 16 bit seqIds.
temp_a0 = ((((AudioThread_NextRandom() % 30) & 0xFF) + 1) << 0x10) | (seqId + 0x7800);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you clarify what wasn't working with the original math here? What is the impact of this change?

mm/src/audio/code_8019AF00.c Outdated Show resolved Hide resolved
mm/include/variables.h Outdated Show resolved Hide resolved
mm/include/seqcmd.h Show resolved Hide resolved
mm/2s2h/mixer.c Outdated Show resolved Hide resolved
mm/src/audio/lib/load.c Show resolved Hide resolved
@Archez
Copy link
Contributor

Archez commented Nov 6, 2024

Based on your comments, although we now made the seqId a u16, it seems like we can't use the full range of the data type for new songs. Should be capture somewhere or have a check to limit the amount of sequences that can be added?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants