Essentials Series/Sound and Music: Difference between revisions

no edit summary
Battlepedia>Igorseabra4
m (Igorseabra4 moved page Custom Sounds to Sound and Music)
Battlepedia>Igorseabra4
No edit summary
Line 1:
{{EssentialsSeriesBox}}
This page is part of the Essential Series modding tutorials. It covers everything about sounds: exporting and importing the game's sound and music using [[Industrial Park (Level Editor)|Industrial Park]], using [[JAW]] data, music [[Links|events]] and asset types such as [[SFX]] and [[SDFX]].
 
== Sound EffectsFiles ==
In BFBB, sounds are stored in [[SND]] (sound effects), [[SNDS]] (music and voices) and [[SNDI]] (headers) assets usually in [[HOP]] files. Most of the game's sounds (effects and voices) are in each individual level that uses them, but music is contained in MNU5.HIP. The difference between SND and SNDS is that SND are loaded completely before being played, while SNDS are loaded from the disc as they are being played. The files use a system in which a part of the sound data (the header) is in the SNDI asset, while the rest is in the SND/SNDS. When importing/exporting sounds, Industrial Park will handle this separation for you.
 
== Previewing ==
You can use the Asset Data Editor for SND and SNDS sounds to preview sounds; this only works on a few sound formats, but not all of them. For this function to work, you must first click on '''Download vgmstream''', under the Tools tool strip menu to download a vgmstream release from [https://github.com/losnoco/vgmstream/ its page] to your Resources folder. The tool is used to play the sounds. To stop a sound, click on the '''Stop Sound''' also under Tools, otherwise the sound will only stop if you close Industrial Park.
 
=== Exporting ===
To export a SND or SNDS asset, navigate to it in Industrial Park's Archive Editor and click Edit Data. Click Export Sound Data and a file browser dialog will open, allowing you to save the sound.
* If you're using a Xbox archive, this is a WAV sound which can be played immediately.
Line 14:
* On PS2, this is a VAG file.
 
=== Importing ===
To import a custom audio file, it must be:
* On Xbox, a WAV file.
Line 27:
Another option is to use an existing SND/SNDS asset. Check the "Trim header and send it to SNDI" checkbox in the Asset Data Editor and click on Import Sound Data. You can also do this on an asset you duplicated/renamed. Choose your source file in the file browser dialog and Industrial Park will automatically split the header from it and place it in the SNDI file.
 
=== JawLooping DataSounds ===
To import a sound that will loop ingame, first you need to extract a sound from the original game that already loops. For example, ''mnu4_Bub_amb_loop.DSP'' from MNU4.
Jaw Data is contained in the [[JAW]] asset and refers to lip-syncing data for character mouths. You can use [https://github.com/pslehisl/BFBBJawData/releases this plugin] to create jaw data from an audio file in Audacity; then use the Import Jaw Data button in the Asset Data Editor for the sound asset to import it. [https://www.youtube.com/watch?v=WieXyyDt1n0 This video] contains a guide on doing that.
 
Import the looped sound into Audacity. You'll see something like this:
== Sound Effects ==
[[File:Loop1.PNG|900px|thumb|center]]
See the [[Sound Effects]] tutorial for a guide on playing the sound ingame.
 
Now, import your custom sound. Make sure it is mono, as BFBB only accepts mono sounds.
== Links ==
 
Once you have the sound, you can adjust the arrow highlighted in green to set the start and end points of the loop.
 
[[File:Loop arrow hilighted.png|900px|thumb|center]]
 
Now, export the file as Mono DSP and import it as detailed above.
 
=== Links ===
* [https://www.youtube.com/watch?v=6iv_hjD9Mcg Video version of the above tutorial]
* [https://www.youtube.com/watch?v=Vgh6nsqshxw Older video tutorial on replacing sounds with a hex editor]
 
== Jaw Data ==
Jaw Data is contained in the [[JAW]] asset and refers to lip-syncing data for character mouths. You can use [https://github.com/pslehisl/BFBBJawData/releases this plugin] to create jaw data from an audio file in Audacity; then use the Import Jaw Data button in the Asset Data Editor for the sound asset to import it. [https://www.youtube.com/watch?v=WieXyyDt1n0 This video] contains a guide on doing that.
 
== PlayMusic Event ==
If you want a music track to play, you can send the PlayMusic [[Links|event]] to any [[Dispatchers|dispatcher]] with the number of the song on the first argument (the game always uses a dispatcher called MUSIC_DISP, and so can you if you wish, but it's not necessary). Note that this cannot be done on ScenePrepare, as you have to wait at least one frame before PlayMusic actually works. An alternative way is to make a [[Timers|timer]] that runs on ScenePrepare and expires in 0.1 seconds before sending PlayMusic to a dispatcher on Expired. These are the possible values for the argument:
* 00 - Bikini Bototm
* 01 - Jellyfish Fields
* 02 - Downtown Bikini Bottom
* 03 - Goo Lagoon
* 04 - Poseidome
* 05 - Rock Bottom
* 06 - Mermalair
* 07 - Silence (Sand Mountain has no unique track!)
* 08 - Industrial Park
* 09 - Kelp Forest
* 10 - Flying Dutchman Graveyard
* 11 - SpongeBob's Dream
* 12 - Chum Bucket Lab
* 15 - Slide
* 16 - Ambush
 
== Sound Effects (Scooby and BFBB) ==
While SND and SNDS are the audio files themselves, [[SFX]] is the asset type used to play sounds ingame in Scooby and BFBB.
 
=== SFX Templates ===
There are two SFX templates in Industrial Park:
 
* SFX_OnEvent is meant for sounds which play when an [[Links|event]] is triggered. The position and radius values do not matter for this asset, as the SFX will play when you sent the Play event to it from another asset.
* SFX_OnRadius for sounds which play when you are inside the radius of the SFX trigger. The sound will start playing at a lower volume when the player is in the outer radius and will be in maximum volume when the player is in the inner radius. Both radiuses and the position are editable. Note that this already comes with a ScenePrepare => Play event in the SFX. You can remove it and use the Play event later in your level to make the SFX only active later, if you want to.
 
For both of them, you must set the Sound_AssetID to the asset ID of a [[SND]] or [[SNDS]] asset yourself after placing the template.
 
You can also take a look at other SFX assets already present in the game. The settings (SFX Flags 08 and 09) are not yet known, but you can copy them from existing assets to see what effect that has on them.
 
==== Events ====
* '''Play''': send this to a SFX to play the sound. In the case of OnRadius SFX, the sound will only play when you are in the radius.
* '''Stop''': send this to a SFX to stop the sound.
 
=== SFX as Custom Music ===
SFX assets can be used to play custom music in your stage, if you wish to add new music without replacing one of the existing music tracks (they are SNDS assets located in MNU4.HIP). This process is a bit hacky and not very intuitive, so this is how it's done:
 
# Follow the process detailed [[#Importing|above]] to import your song as a new [[SNDS]] asset in your level's HOP. You probably want to make sure it's a looping sound.
# Place a SFX_OnEvent template. Set the SNDS asset ID of your song as the Sound_AssetID. The ''Flags09'' property should be set to '''C0'''.
# Place a [[Timers|Timer]] template. Set the time to 0.1. Add two links to it:
## ScenePrepare => Run, with the timer itself as the target asset.
## Expired => PlayMusic, with any [[Dispatchers|dispatcher]] as the target asset and 7 as the value of the first argument. You can place a new Dispatcher template just for this if you'd like.
# The previous step will make it so no song will play in the level (7 is actually the value for the Sand Mountain song, which doesn't exist in the game).
# Now, the game should play your custom song instead of the original stage's.
 
== Sound Effects (Movie, Incredibles and ROTU) ==
There are two templates you need to place in Industrial Park to use custom sound effects: a Sound Effect (SDFX) and a Sound Group (SGRP). Note that, if the sound effect you want to use already exists in the stage, there possibly already is a Sound Group for it, so you can start at step #3.
 
# Place a SoundGroup template. In the asset data editor for it, edit the SGRP_Entries field and change the Sound_AssetID of the first entry to the asset ID of the [[SND]] or [[SNDS]] you want to use.
# You can also edit the InnerRadius and OuterRadius properties. The sound will start playing at a lower volume when the player is in the outer radius and will be in maximum volume when the player is in the inner radius.
# Place a SDFX template. In the asset data editor, set the SoundGroup_AssetID to the SGRP you want to use. You can move the SDFX to the position where you want the sound to play.
 
For the sound to start playing, you must send the Play [[Links|event]] to the SDFX. You can add a ScenePrepare => Play link to the SDFX itself if you want it to start playing already at level start.
 
If you want, you can attach the sound to an [[Asset#Entity Assets|entity]] (such as a [[Platforms|platform]] or a [[Boulders|boulder]]) instead of using the SDFX's actual position. To do this, set the Emitter_AssetID in the SDFX to the entity's asset ID, and the SoundEffectFlags field to 4.
 
You can also take a look at other SDFX and SGRP assets already present in the game. Not all settings of these assets are known, but you can copy them from existing assets to see what effect that has on them.
 
[[Category:Modding]] [[Category:Tutorials]]