XML:SNDD: Difference between revisions

m
somehow I missed the atm_low_perc variants that also use BaseTrack2
(added info on DetailTrack and sound volume; tweaked wording on BaseTrack2 info)
m (somehow I missed the atm_low_perc variants that also use BaseTrack2)
 
(2 intermediate revisions by the same user not shown)
Line 59: Line 59:
===Via Vago===
===Via Vago===
Installation:
Installation:
* Oni/AE/AEInstaller2.exe > Tools > [[Anniversary Edition/Installer#Tools|Manage Tools]]
* In Oni/AE/AEInstaller2.exe, choose Tools > [[Anniversary Edition/Installer#Tools|Manage Tools]].


Usage: Oni/AE/Tools/VagoGUI/[[Vago (tool)|Vago.exe]]
Usage:
* Target Platform: choose the desired mode
* Open Oni/AE/Tools/VagoGUI/[[Vago (tool)|Vago.exe]]
* Target Platform > choose the desired target
* Tools > Sound Wizard
* Tools > Sound Wizard


Line 108: Line 109:


The parts of the music between intro and outro are played in a randomized order to add more variety to the playback. Note that .grp files have a <Weight> tag under each <Permutation>. As with TRAC's <Weight> field, this can be used to set the relative probability that a music segment will be picked, however this feature is effectively unused in Oni's music as all music segments have a <Weight> of 10.
The parts of the music between intro and outro are played in a randomized order to add more variety to the playback. Note that .grp files have a <Weight> tag under each <Permutation>. As with TRAC's <Weight> field, this can be used to set the relative probability that a music segment will be picked, however this feature is effectively unused in Oni's music as all music segments have a <Weight> of 10.
For information on permutations, see {{SectionLink||Permutations}}. For information on layering two music tracks with BaseTrack2, see {{SectionLink||Using BaseTrack2 to layer sound}}.


===OSBDfile.imp.xml===
===OSBDfile.imp.xml===
Line 126: Line 129:
| <Group>
| <Group>
| char[32]
| char[32]
| <font color=#AAAAAA>OSBD</font>name<font color=#AAAAAA>.grp.oni</font>, file prefix and suffix aren't used
| <font color=#AAAAAA>OSBD</font>name<font color=#AAAAAA>.grp.oni</font>, file prefix and suffix aren't used.
|-
|-
|valign="top"| <Priority>
|valign="top"| <Priority>
Line 174: Line 177:
| <Impulse>
| <Impulse>
| char[32]
| char[32]
| <font color=#AAAAAA>OSBD</font>name<font color=#AAAAAA>.imp.oni</font>, file prefix and suffix aren't used
| <font color=#AAAAAA>OSBD</font>name<font color=#AAAAAA>.imp.oni</font>, file prefix and suffix aren't used.
|-
|-
| <ImpactVelocity>
| <ImpactVelocity>
Line 210: Line 213:
|
|
: InterruptTracksOnStop — Don't wait for current .grp element to finish before stopping sound; used for dialogue, a few sound effects, some music pieces. A music piece with this flag will immediately cut to its outro when <tt>sound_music_stop</tt> is called on it; see {{SectionLink||Scripting music}} for details.
: InterruptTracksOnStop — Don't wait for current .grp element to finish before stopping sound; used for dialogue, a few sound effects, some music pieces. A music piece with this flag will immediately cut to its outro when <tt>sound_music_stop</tt> is called on it; see {{SectionLink||Scripting music}} for details.
: PlayOnce – Don't loop this sound; mostly applied to dialogue. A few sound effects have it as well (does this serve a purpose?).
: PlayOnce – Don't loop this sound; mostly applied to dialogue. A few sound effects have it as well (was this intentional?).
: CanPan
: CanPan
|-
|-
Line 328: Line 331:
| <Flags>
| <Flags>
| flag
| flag
| PreventRepeat - do not play the same permutation twice in a row, if there is more than one permutation
| PreventRepeat - Do not play the same permutation twice in a row, if there is more than one permutation.
|-
|-
|valign="top"| <NumberOfChannels>
|valign="top"| <NumberOfChannels>
Line 346: Line 349:


|-
|-
| <[[wikt:permutation#Noun|Permutations]]>
| <Permutations>
| -
| -
| int32 array for the <Permutation> tags
| int32 array for the <Permutation> tags; see {{SectionLink||Permutations}}.
|-
|-
| <Permutation>
| <Permutation>
Line 384: Line 387:
| <Sound>
| <Sound>
| char[32]
| char[32]
| <font color=#AAAAAA>SNDD</font>name<font color=#AAAAAA>.oni</font>, file prefix and suffix aren't used
| <font color=#AAAAAA>SNDD</font>name<font color=#AAAAAA>.oni</font>, file prefix and suffix aren't used.
|}
|}


Line 443: Line 446:
| <Position>
| <Position>
| float x3
| float x3
| Here you tell Oni where you want the sound to be located (see [[OBD talk:BINA/OBJC|HERE]] for help with that).
| Where the sound should be located (see [[OBD talk:BINA/OBJC|HERE]] for help with that).
|-
|-
| <Rotation>
| <Rotation>
Line 455: Line 458:
| <Class>  
| <Class>  
| char[32]
| char[32]
| <font color=#AAAAAA>SNDD</font>name<font color=#AAAAAA>.amb.oni</font>, file prefix and suffix aren't used
| <font color=#AAAAAA>SNDD</font>name<font color=#AAAAAA>.amb.oni</font>, file prefix and suffix aren't used.
|-
|-
| <Sphere>
| <Sphere>
Line 501: Line 504:


==Scripting music==
==Scripting music==
Here are the BSL commands you can use for music:<br>
===BSL commands===
'''sound_music_start name:string [volume:float]''', e.g. <tt><code>sound_music_start mus_asian 0.75</code></tt>
'''sound_music_start name:string [volume:float]''', e.g. <code>sound_music_start mus_asian 0.75</code>


'''sound_music_stop name:string''', e.g. <tt><code>sound_music_stop mus_asian</code></tt><br>
'''sound_music_stop name:string''', e.g. <code>sound_music_stop mus_asian</code><br>
If .amb file has InterruptTracksOnStop flag, music will proceed immediately to <OutSound>, otherwise current segment will finish playing and then <OutSound> will play.
If .amb file has InterruptTracksOnStop flag, music will proceed immediately to <OutSound>, otherwise current segment will finish playing and then <OutSound> will play.


'''sound_music_volume name:string volume:float [time:float]''', e.g. <tt><code>sound_music_volume mus_asian 0.35 1.0</code></tt><br>
'''sound_music_volume name:string volume:float [time:float]''', e.g. <code>sound_music_volume mus_asian 0.35 1.0</code><br>
Volume change takes effect instantly unless you specify a time as the third parameter.
Volume change takes effect instantly unless you specify a time as the third parameter.
----
 
===Stopping the music===
When Oni's BSL scripting wants to stop some music, it will either:
When Oni's BSL scripting wants to stop some music, it will either:
# Call <tt>sound_music_stop</tt>.
# Call <code>sound_music_stop ''mus_name''</code>.
# Fade out the music with <tt>sound_music_volume</tt> and then call <tt>sound_music_stop</tt> when the music has reached zero volume.
# Fade out the music with <code>sound_music_volume ''mus_name'' 0.0 4.0</code> and then call <code>sound_music_stop ''mus_name''</code> when the music has reached zero volume. (4.0 is a sample fade-out time. Oni uses values ranging from 0.25 to 6.0 in various situations.)


When setting up your .amb file, you have to think about the timing of how the music will be used. If a music track has an <OutSound> in its .amb, then the sequence of events will be:<br>
When setting up your .amb file, you have to think about the timing of how the music will be used. If a music track has an <OutSound> in its .amb, then the sequence of events will be:<br>
:<tt>sound_music_stop</tt> called → current body segment finishes playing → outro segment plays
:<tt>sound_music_stop</tt> called → current body segment finishes playing → outro segment plays


Thus it can be quite a while before the music really stops. If this lag time is a problem, you could:
Thus it can be quite a while before the music really stops. If this is a problem, you could:
# Leave out the <OutSound> so that <tt>sound_music_stop</tt> ends the music after the current segment finishes.
# Leave out the <OutSound> so that <tt>sound_music_stop</tt> ends the music after the current segment finishes.
# Fade out the music over the desired amount of time with <tt>sound_music_volume</tt>. Don't forget to call <tt>sound_music_stop</tt> after the fade-out finishes so that the sound system can stop playing the music.
# Fade out the music over the desired amount of time with <tt>sound_music_volume</tt>. Use <tt>sound_music_stop</tt> on the track after its fade-out finishes so that the sound system can stop playing the music.
# Use the InterruptTracksOnStop flag so that <tt>sound_music_stop</tt> skips to playing <OutSound> immediately.
# Use the InterruptTracksOnStop flag so that <tt>sound_music_stop</tt> skips to playing <OutSound> immediately.


Oni contains many music OSBDs that come in two variants – with and without the InterruptTracksOnStop flag – such as OSBDmus_amasian.amb and OSBDmus_amasian_hd.amb; they play the same actual SNDDs, but the "_hd" variant has the InterruptTracksOnStop flag. When <tt>sound_music_stop</tt> is called on a "_hd" OSBD, you will hear it immediately jump to the outro, which is slightly jarring but can be useful in some cases. An easily observed example is OSBDmus_fiteb_hd, which plays in {{C2}} when combat starts after the opening cutscene in the lobby. When the last blow is delivered to the last standing Striker, the music will immediately jump to its outro. Any discontinuity in the rhythm is masked by the final attack sound effect, and in fact the hard transition serves to punctuate the end of the action. By contrast, if a track was interrupted in this way during a quiet moment in the game it would probably sound awkwardly abrupt.
====InterruptTracksOnStop====
Oni contains many music OSBDs that come in two variants – with and without the InterruptTracksOnStop flag – such as OSBDmus_amasian.amb and OSBDmus_amasian_hd.amb; they play the same actual SNDDs, but the "_hd" variant has the InterruptTracksOnStop flag. When <tt>sound_music_stop</tt> is called on a "_hd" OSBD, you will hear it immediately jump to the outro, which is slightly jarring but can be useful in some cases. An easily observed example is OSBDmus_fiteb_hd, which plays in {{C2}} when combat starts after the opening cutscene in the lobby. When the final blow is delivered to the last standing Striker, the music will immediately jump to its outro. Any discontinuity in the rhythm is masked by the sound of the attack that triggers it, and in fact the hard transition serves to punctuate the end of the action. By contrast, if a track was interrupted in this way during a quiet moment in the game it would probably sound awkwardly abrupt.


==How to register sounds for characters==
==Registering sounds for characters==
...such as the sounds of heavy attacks and taunts.
...such as the sounds of heavy attacks and taunts.


'''Let's see how sounds become picked up:'''<br>Schemata:
'''Let's see how sounds get looked up:'''
: TRAM -> ONCC -> OSBD.amb -> OSBD.grp -> SNDD
: TRAM -> ONCC -> OSBD.amb -> OSBD.grp -> SNDD
Explanation:
 
* The character performs a move/attack where the TRAM file holds a sound ID (<Vocalization>).
# A character performs a move/attack where the TRAM file holds an ID representing a type of sound (<Vocalization>).
* A link (OSBD.amb name) in the ONCC file will be looked up based on the sound ID. Note that the ONCC file has also a probability value that decides whether a sound will be played or not.
# The character's ONCC has its <SoundConstants> field looked at. The subfield for this specific vocalization type contains a link in the form of an OSBD.amb name. Note that the ONCC file has also a probability value that decides whether a sound will be played or not.
* The game engine looks into OSBD.amb and follows the link into OSBD.grp.
# The OSBD.amb is looked up and has its <BaseTrack1> field read, which is the name of an OSBD.grp file.
* '''OSBD.grp can hold multiple links to SNDD files, called permutations.''' That's why Konoko can have multiple taunt sounds. Each permutation has its own "Weight" which determines its probability of playing. This probability is figured in relation to the total weight of all permutations, so if an OSBD has four permutations and the first one has a <Weight> of 30 and the other three have <Weight>s of 10, the first sound has a 50% chance of being picked. This feature is used to define rare taunts for some characters, such as the [[Comguy]]'s [[Easter eggs|Easter egg]] taunt, "Okay, okay, ''don't'' frog blast the vent core!"
# The OSBD.grp contains the link(s) to the actual SNDD(s).
 
===Permutations===
'''An OSBD.grp can hold multiple links to SNDD files, called <Permutation>s.''' That's why Konoko can have multiple taunt sounds. Each permutation has its own <Weight> which determines its probability of playing. This probability is figured in relation to the total weight of all permutations, so if an OSBD has four permutations and the first one has a <Weight> of 30 and the other three have <Weight>s of 10, the first sound has a 50% chance of being picked. This feature is used to define rare taunts for some characters, such as the [[Comguy]]'s [[Easter eggs|Easter egg]] taunt, "Okay, okay, ''don't'' frog blast the vent core!"
 
====PreventRepeat====
The key to not hearing the same taunt or hurt sound twice in a row is to add PreventRepeat to <Flags>. Oni uses this flag in the OSBD.grp files for hurt sounds, material impact sounds like Konoko's click-clacks when running, and taunt sounds (see OSBDc17_99_28konoko.grp for Konoko's). The flag is also used on about half of Oni's soundtrack (most of the "mus_" pieces, but only a few of the "atm_" pieces) to prevent segments from repeating.


===Step 1: Preparing the TRAM===
===Step 1: Preparing the TRAM===
Line 560: Line 571:
|-
|-
| 5
| 5
| <CoverProbability> — Play this sounds when afraid (e.g. "Don't hurt me!")
| <CoverProbability> — Play this sound when afraid (e.g. "Don't hurt me!")
|-
|-
| 6
| 6
Line 688: Line 699:
  </Oni>
  </Oni>


As you can see, Konoko has multiple sounds to choose from.
As you can see, [[#Permutations|permutations]] in .grp files are the reason why Konoko has multiple sounds that can play during the same taunt animation.
* <font color=#AAAAAA>SNDD</font>c17_99_28konoko.aif<font color=#AAAAAA>.oni</font> ("You're gonna get beat by a girl!")
* <font color=#AAAAAA>SNDD</font>c17_99_28konoko.aif<font color=#AAAAAA>.oni</font> ("You're gonna get beat by a girl!")
* <font color=#AAAAAA>SNDD</font>c17_99_29konoko.aif<font color=#AAAAAA>.oni</font> ("Ready to lose?") (You can play sounds in Simple OniSplit GUI (Windows only).
* <font color=#AAAAAA>SNDD</font>c17_99_29konoko.aif<font color=#AAAAAA>.oni</font> ("Ready to lose?") (You can play sounds in Simple OniSplit GUI (Windows only).
* ''[...]''
* ''[...]''
"aif" is here part of the name, as explained under {{SectionLink||The .aif suffix}}.
"aif" is here part of the name, as explained under {{SectionLink||The .aif suffix}}.
Permutations in .grp files are the reason why Konoko has multiple sounds that can play during the same taunt animation.


===Step 5: Everything else that's left===
===Step 5: Everything else that's left===
Line 710: Line 720:


===Mixing music tracks===
===Mixing music tracks===
Oni uses this feature in order to layer one music track over another, but only in one functioning OSBD: '''OSBDmus_xtr2''', the sorrowful string piece which plays in the Shinatama farewell scene in {{C8}} and at the conclusion of Hasegawa's monologue at the start of {{C11}}. The OSBD's use of <BaseTrack1> and <BaseTrack2> leads to the high string note SNDDmus_xtr2hi.aif playing continuously over the melody in SNDDmus_xtr2_[1-6].aif.
Oni uses this feature in order to layer one music track over another, but only in three (working) OSBDs: '''OSBDatm_low_perc1''', '''OSBDatm_low_perc2''', and '''OSBDmus_xtr2'''. In this article we'll just consider the latter piece, but the two atm_low_perc variants can be heard at {{SectionLink|Music/Ingame|atm_low1}}. '''OSBDmus_xtr2''' is the sorrowful string piece which plays in the Shinatama farewell scene in {{C8}} and at the conclusion of Hasegawa's monologue at the start of {{C11}}. The OSBD's use of <BaseTrack1> and <BaseTrack2> leads to the high string note in SNDDmus_xtr2hi.aif playing continuously over the melody in SNDDmus_xtr2_[1-6].aif.


The benefit of this live-mix approach is that you can also use the individual tracks in other places, or in combination with a different second track; for instance, '''OSBDmus_choral1''' calls for the same SNDDmus_xtr2_[1-6].aif to be mixed with SNDDmus_choral1.aif (except that SNDDmus_choral1.aif doesn't exist and the OSBD is never called…).
The benefit of this live-mix approach is that you can also use the individual tracks in other places, or in combination with a different second track; for instance, the relic '''OSBDmus_choral1''' calls for the same SNDDmus_xtr2_[1-6].aif to be mixed with SNDDmus_choral1.aif (except that SNDDmus_choral1.aif doesn't exist and the OSBD is never called…).


Note that when mixing two tracks in this way, both tracks will have to share the same <InSound> and <OutSound>. For this reason, SNDDmus_xtr2endmx.aif was created to end the mix of SNDDmus_xtr2hi.aif and SNDDmus_xtr2_[1-6].aif, as opposed to SNDDmus_xtr2_end.aif which provides an end for only SNDDmus_xtr2_[1-6].aif when playing on its own.
Note that when mixing two tracks in this way, both tracks will have to share the same <InSound> and <OutSound>. For this reason, SNDDmus_xtr2endmx.aif was created to end the mix of SNDDmus_xtr2hi.aif and SNDDmus_xtr2_[1-6].aif, as opposed to SNDDmus_xtr2_end.aif which provides an end for only SNDDmus_xtr2_[1-6].aif when playing on its own.