Add Extended Soundbank (#254)

* Add Extended Soundbank

This PR adds a soundbank to the game with every instrument in the game, so there's no need to only use one set of instruments for m64 sequences.

Use the soundbank ID "42" when replacing sequences with lua to use it.

* Remove hardcoded.h include duplicate

There's a duplicated line that shouldn't be there since hardcoded.h is already included.

* Reinclude duplicate include

I'm still learning the commits system and I've noticed I should push this into a different PR instead by making a fork, sorry about that
This commit is contained in:
eros71 2023-03-23 00:04:16 +01:00 committed by GitHub
parent b53654adad
commit 4d1376c292
4 changed files with 2759 additions and 0 deletions

View File

@ -496,6 +496,9 @@ endif
# Copy missing character sounds from mario sound banks # Copy missing character sounds from mario sound banks
_ := $(shell $(PYTHON) $(TOOLS_DIR)/copy_mario_sounds.py) _ := $(shell $(PYTHON) $(TOOLS_DIR)/copy_mario_sounds.py)
# Copy missing instrument samples from the music sound banks
_ := $(shell $(PYTHON) $(TOOLS_DIR)/copy_extended_sounds.py)
#==============================================================================# #==============================================================================#
# Target Executable and Sources # # Target Executable and Sources #
#==============================================================================# #==============================================================================#

View File

@ -45,6 +45,10 @@ def remove_file(fname):
def clean_assets(local_asset_file): def clean_assets(local_asset_file):
# If extended folder exists, delete it
if os.path.exists('sound/samples/extended/'):
os.system('rm -rf sound/samples/extended/')
print('Deleted extended soundbank folder')
assets = set(read_asset_map().keys()) assets = set(read_asset_map().keys())
assets.update(read_local_asset_list(local_asset_file)) assets.update(read_local_asset_list(local_asset_file))
for fname in list(assets) + [".assets-local.txt"]: for fname in list(assets) + [".assets-local.txt"]:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
#!/usr/bin/env python3
import os
copy_directories = {
'sound/samples/instruments/': [
'sound/samples/extended/',
],
'sound/samples/bowser_organ/': [
'sound/samples/extended/',
],
'sound/samples/course_start/': [
'sound/samples/extended/',
],
'sound/samples/piranha_music_box/': [
'sound/samples/extended/',
],
}
# If extended folder doesn't exist, create it
if not os.path.exists('sound/samples/extended/'):
os.makedirs('sound/samples/extended/')
print('Created extended soundbank folder, as it was missing')
def copy_dir(source, destinations):
for filename in os.listdir(source):
if not filename.endswith('.aiff'):
continue
src = source + filename
for destination in destinations:
dst = destination + filename
if os.path.exists(dst):
continue
print('Copying instrument samples to the extended soundbank folder: ' + src + ' -> ' + dst)
os.system('cp ' + src + ' ' + dst)
def main():
for source in copy_directories:
copy_dir(source, copy_directories[source])
if __name__ == "__main__":
main()