-
Notifications
You must be signed in to change notification settings - Fork 68
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
louist103
wants to merge
92
commits into
HarbourMasters:develop
Choose a base branch
from
louist103:customAudio2
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,634
−6,927
Open
Custom Audio Support #778
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
dd59a56
Implement custom sequences and the audio editor.
louist103 e90cab7
Fix implicit function declaration `AudioEditor_GetReplacementSeq`
louist103 79cd020
Fix mac again.
louist103 cac05a1
String and header cleanup
louist103 a6fae26
Oops
louist103 eb9f3e6
WIP ZIP Sound fonts
louist103 65a1405
The game opens and audio seems to play correctly. Needs extensive tes…
louist103 5b25e62
Name sequences
louist103 bc92ebf
Cleanup the SF importer a little.
louist103 aae5f59
XML Sequences good
louist103 eadf08d
Fix mac
louist103 3e9e50a
Destructor
louist103 6a0bcbe
Bump submodule
louist103 e0d55e7
Thread safe queue
louist103 92d4eee
Add WAV decoder
louist103 0eb669f
sequenceMap->mSequenceMap and a string fix
louist103 c46d738
Streamed sequence importer
louist103 ae494b0
Add s16 sample processing.
louist103 36033f3
Fix drwave define
louist103 953ba73
Fix STB
louist103 93296bc
Reorder the loading to enable custom sound fonts
louist103 d6f0e20
New streamed solution
louist103 ca56117
Bump exporter
louist103 1465f7b
Generate 1 minute long looping sequence.
louist103 0cf00df
Very long sample support (113 minutes or so)
louist103 63b305e
MP3 Decoding
louist103 915169b
Don't byteswap the crc from XML.
louist103 6bcf490
WIP OGG
louist103 bb16026
add windows cmake stuff (broken) and fixes to OGG
louist103 cc7f341
Just throw more cores at the problem
louist103 ce93ca0
Dynamically allocate fontMap
louist103 bb2c084
Re-add OOB read fix from old branch
louist103 2a73ed4
FLAC decoder, threads for the other compressed formats
louist103 a5c7dfc
Remove thread from class
louist103 b43edd4
timings
louist103 d0fc330
cleanup conflicts
louist103 3f404df
update submodules
louist103 d0b2c97
update submodules
louist103 5c0225b
update submodules
louist103 d8ea4ed
loop or not to loop
louist103 a58ed3d
named audio XML
louist103 734726e
Update submodules
louist103 49d9fe8
merge
louist103 bfa9706
format
louist103 9f3d846
format again cause git didnt see it for some reason
louist103 2019e98
move drlib to submodule
louist103 e186dce
Conflict
louist103 6ccc5fc
Merge branch 'develop' into customAudio2
louist103 628b823
Update apt-deps.txt
louist103 15ce6e9
Fix for new cmake
louist103 d4411b5
fix game interactor
louist103 fb2302f
Update macports-deps.txt
louist103 a4cdbc1
PR fixes and fix OTRExporter for mac
louist103 a41d090
Merge branch 'customAudio2' of https://github.com/louist103/2ship2har…
louist103 dc96e96
format
louist103 158648f
format
louist103 955a329
ifdef intrin header
louist103 fd97c91
Merge branch 'customAudio2' of https://github.com/louist103/2ship2har…
louist103 07c9a08
Docs
louist103 27c2522
use macro for preview
louist103 da1cf35
Small fixes
louist103 96cd60f
format
louist103 c24f0d2
fix 2nd day clock town
louist103 e3a7e82
Update exporter
louist103 dc779a5
Fix duplicate global in stubs.c
louist103 3493553
restore editor to use cvars again sadge
louist103 414b832
Format
louist103 0fb8f67
Merge branch 'develop' into customAudio2
louist103 a14ba79
warn if more than 255 sequences
louist103 d6615c5
use main seq player to avoid an overflow
louist103 1917d67
Merge branch 'customAudio2' of https://github.com/louist103/2ship2har…
louist103 852e1e1
fix the wrong seq playing in the editor again
louist103 379bc5d
16 bit seqIds
louist103 ae29eb7
fix shop crash
louist103 795586e
format
louist103 dd17321
cleanups
louist103 69cc9cc
Delete audio collection
louist103 3b92153
Add entry to modern menu
louist103 5a184a5
Cleanup the audio collection
louist103 9f1e6ab
fix clock town randomization
louist103 98af18f
format
louist103 e3f9cc5
format again
louist103 0433a89
some fixes for custom audio (#1)
mckinlee a53439e
how I would sort the sequences (#2)
louist103 edfa595
Adjustments to ocarina song types
louist103 754bc74
stereo
louist103 0645457
format
louist103 e4d0941
Loop point support
louist103 7f0e6ae
Merge branch 'customAudio2' of https://github.com/louist103/2ship2har…
louist103 3afe66a
Merge branch 'develop' into customAudio2
louist103 c4021da
Merge remote-tracking branch 'upstream/develop' into customAudio2
louist103 5e44d8c
Part of a PR review
louist103 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
libusb-dev libusb-1.0-0-dev libsdl2-dev libsdl2-net-dev libpng-dev libglew-dev nlohmann-json3-dev libtinyxml2-dev libspdlog-dev ninja-build | ||
libusb-dev libusb-1.0-0-dev libsdl2-dev libsdl2-net-dev libpng-dev libglew-dev nlohmann-json3-dev libtinyxml2-dev libspdlog-dev ninja-build libogg-dev libvorbis-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
libsdl2 +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal nlohmann-json +universal tinyxml2 +universal | ||
libsdl2 +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal nlohmann-json +universal tinyxml2 +universal libogg +universal libvorbis +universal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule OTRExporter
updated
2 files
+439 −159 | OTRExporter/AudioExporter.cpp | |
+22 −5 | OTRExporter/AudioExporter.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
### Custom Music | ||
|
||
We support importing custom [Seq64](https://github.com/sauraen/seq64) files to replace the in game music and fanfares (Sound effect and instrument replacement is currently not supported). | ||
|
||
First you will need to prepare a folder with the desired sequences. Every sequence requires two files with the same name and different extensions - a `.seq` Seq64 file and a `.meta` plaintext file. | ||
|
||
The `.meta` file requires two lines - the first line is the name that will be displayed in the SFX editor, the second line is the instrument set number in `base16` format, and the third line optionally contains 'bgm' or 'fanfare'. For example, if there is a sequence file `Foo.seq` then you need a meta file `Foo.meta` that could contain: | ||
``` | ||
Awesome Name | ||
C | ||
``` | ||
|
||
Once you have prepared your sequences folder: | ||
1. Download and open [Future] (https://github.com/louist103/future/). | ||
1. Choose the "Create OTR/O2R" option. | ||
1. Choose the "Custom Audio" option. | ||
1. Choose the "Sequenced" option | ||
1. Using the file selection screen, choose the sequences folder you prepared in the previous instructions. | ||
1. Click the slider to pack an archive instead. | ||
1. Select either OTR or O2R. | ||
1. Click the 'Set Save Path' button to set the save location of the archive, if in create archive mode. | ||
(*NOTE:* 2Ship can handle 1024 custom sequence in total. This includes the original music. Keep that in mind!) | ||
1. Click the "Pack Archive" button.. | ||
1. An archive will be created in the location selected with the 'Set Save Path' step. If that location wasn't the 'mods' folder, move the archive there. The mods folder must be in the same location as the game executable and mm.o2r. | ||
|
||
Assuming you have done everything correctly, boot up 2Ship and select the SFX Editor from the enhancements dropdown menu. You should now be able to swap out any of the in game sequences/fanfares for the sequences added in your newly generated OTR file. If you have any trouble with this process, please reach out in the support section of the Discord. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
### Custom Audio | ||
We support importing streamed (MP3, WAV, OGG, etc.) files to replace in game music, fanfares, sound effects, and instruments. | ||
|
||
First you will need to prepare a folder with the desired songs. These can be `.wav`, `.ogg`, `.mp3`, and `.flac`. Place these files in an empty folder and change their name to what you want to appear in game. No `.meta` files are required for streamed songs. | ||
|
||
|
||
Once you have prepared your sequences folder: | ||
1. Download and open [Future] (https://github.com/louist103/future/). | ||
1. Choose the "Create OTR/O2R" option. | ||
1. Choose the "Custom Audio" option. | ||
1. Choose the "Streamed" option | ||
1. Using the file selection screen, choose the sequences folder you prepared in the previous instructions. | ||
1. Click the slider to pack an archive instead. | ||
1. Select either OTR or O2R. | ||
1. Click the 'Set Save Path' button to set the save location of the archive, if in create archive mode. | ||
(*NOTE:* 2Ship can handle 1024 custom sequence in total. This includes the original music. Keep that in mind!) | ||
1. Click the "Pack Archive" button.. | ||
1. An archive will be created in the location selected with the 'Set Save Path' step. If that location wasn't the 'mods' folder, move the archive there. The mods folder must be in the same location as the game executable and mm.o2r. | ||
|
||
Replacing sound effects and instruments it a little more complicated. | ||
Both of these store extra data in the first sound font, currently named `Soundfont_0`. | ||
1. First open Soundfont_0. This file is an XML document. | ||
2. Next find the sample or sound effect you want to replace. | ||
3. Replace the `SampleRef` field with the path of the new audio file. | ||
4. Set the `Tuning` value using this calculation: $\dfrac{sample rate}{32000} * channels$. This is handled by future for songs. | ||
5. Save the Soundfont XML and replace the one in the original archive. | ||
6. Save the sample file in the archive, giving it the same path as the `SampleRef` | ||
|
||
Assuming you have done everything correctly, boot up 2Ship and select the Audio Editor from the enhancements dropdown menu. You should now be able to swap out any of the in game sequences/fanfares for the sequences added in your newly generated OTR/O2R file. If you have any trouble with this process, please reach out in the support section of the Discord. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
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