19,587
edits
m (→Scripting music: wording) |
m (somehow I missed the atm_low_perc variants that also use BaseTrack2) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 59: | Line 59: | ||
===Via Vago=== | ===Via Vago=== | ||
Installation: | Installation: | ||
* Oni/AE/AEInstaller2.exe | * 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 | * 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 195: | Line 198: | ||
|- | |- | ||
| <AmbientSound> | | <AmbientSound> | ||
| | | parent tag | ||
| | | | ||
|- | |- | ||
Line 209: | Line 212: | ||
|valign="top"| flag | |valign="top"| flag | ||
| | | | ||
: InterruptTracksOnStop — | : 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 – | : PlayOnce – Don't loop this sound; mostly applied to dialogue. A few sound effects have it as well (was this intentional?). | ||
: CanPan | : CanPan | ||
|- | |- | ||
| <DetailTrackProperties> | | <DetailTrackProperties> | ||
| | | parent tag | ||
| | | | ||
|- | |- | ||
| <SphereRadius> | | <SphereRadius> | ||
| float | | float | ||
| | | Size of area within which detail sounds can be heard. | ||
|- | |- | ||
| <ElapsedTime> | | <ElapsedTime> | ||
| | | parent tag | ||
| | | | ||
|- | |- | ||
| <Min> | | <Min> | ||
| float | | float | ||
| | | The smallest amount of time that can elapse before playing another detail track sound. | ||
|- | |- | ||
| <Max> | | <Max> | ||
| float | | float | ||
| | | The longest we can go without playing a detail track sound. | ||
|- | |- | ||
| <Volume> | | <Volume> | ||
| | | parent tag | ||
| | | | ||
|- | |- | ||
| <Distance> | | <Distance> | ||
| | | parent tag | ||
| | | | ||
|- | |- | ||
| <Min> | | <Min> | ||
| float | | float | ||
| | | Near distance at which the sound rises to its maximum volume. | ||
|- | |- | ||
| <Max> | | <Max> | ||
| float | | float | ||
| | | Far distance at which the sound falls to its minimum volume. | ||
|- | |- | ||
| <DetailTrack> | | <DetailTrack> | ||
| 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. See {{SectionLink||Using DetailTrack to add ambience}} for explanation. | ||
|- | |- | ||
| '''<BaseTrack1>''' | | '''<BaseTrack1>''' | ||
| 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. | ||
|- | |- | ||
| <BaseTrack2> | | <BaseTrack2> | ||
| 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. See {{SectionLink||Using BaseTrack2 to layer sound}} for explanation. | ||
|- | |- | ||
| <InSound> | | <InSound> | ||
| 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. | ||
|- | |- | ||
| <OutSound> | | <OutSound> | ||
| 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. | ||
|- | |- | ||
| <Treshold> | | <Treshold> | ||
Line 275: | Line 278: | ||
| <MinOcclusion> | | <MinOcclusion> | ||
| float | | float | ||
| | | This is the lowest volume (0.0-1.0) that a sound can have, even when the path between the sound-emitting area and the player is fully occluded by the environment. The name is misleading but should be thought of as "minimum (floor) value when calculating the volume of an occluded sound". | ||
|} | |} | ||
Line 328: | Line 331: | ||
| <Flags> | | <Flags> | ||
| flag | | flag | ||
| PreventRepeat - | | 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 342: | Line 345: | ||
|align="center"| 1 | |align="center"| 1 | ||
|align="center"| 2 | |align="center"| 2 | ||
|align="center"| '''1''' | |align="center"| '''1''' (with Pitch of 2) | ||
|} | |} | ||
|- | |- | ||
| < | | <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 | ||
| | | 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== | ||
===BSL commands=== | |||
'''sound_music_start name:string [volume:float]''', e.g. | '''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. | '''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. | '''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 < | # Call <code>sound_music_stop ''mus_name''</code>. | ||
# Fade out the music with < | # 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 | 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>. | # 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 | ====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. | |||
== | ==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 | '''Let's see how sounds get looked up:''' | ||
: TRAM -> ONCC -> OSBD.amb -> OSBD.grp -> SNDD | : TRAM -> ONCC -> OSBD.amb -> OSBD.grp -> SNDD | ||
# A character performs a move/attack where the TRAM file holds an ID representing a type of sound (<Vocalization>). | |||
# 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 OSBD.amb is looked up and has its <BaseTrack1> field read, which is the name of an OSBD.grp file. | |||
# 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 563: | Line 571: | ||
|- | |- | ||
| 5 | | 5 | ||
| <CoverProbability> — Play this | | <CoverProbability> — Play this sound when afraid (e.g. "Don't hurt me!") | ||
|- | |- | ||
| 6 | | 6 | ||
Line 607: | Line 615: | ||
===Step 3: Preparing the OSBD.amb=== | ===Step 3: Preparing the OSBD.amb=== | ||
Do you see the <BaseTrack1> tag? In this case it holds the link <font color=#AAAAAA>OSBD</font>c17_99_28konoko<font color=#AAAAAA>.grp.oni</font>. (See | Do you see the <BaseTrack1> tag? In this case it holds the link <font color=#AAAAAA>OSBD</font>c17_99_28konoko<font color=#AAAAAA>.grp.oni</font>. (See {{SectionLink||Using BaseTrack2 to layer sound}} below for info on that tag.) | ||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||
Line 649: | Line 657: | ||
|align="center"| 1 | |align="center"| 1 | ||
|align="center"| 2 | |align="center"| 2 | ||
|align="center"| '''1''' | |align="center"| '''1''' (with Pitch of 2) | ||
|} | |} | ||
Line 691: | Line 699: | ||
</Oni> | </Oni> | ||
As you can see, Konoko has multiple sounds | 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}}. | |||
===Step 5: Everything else that's left=== | ===Step 5: Everything else that's left=== | ||
* | * Create your SNDDs if you haven't yet (see {{SectionLink||Source file creation}}). | ||
* Put your files into a mod package. | * Put your files into a mod package. | ||
* Test your stuff in-game! | * Test your stuff in-game! | ||
==Using BaseTrack2 to | ==Using DetailTrack to add ambience== | ||
You can place a | Oni makes extensive use of DetailTrack to add ambient noises that punctuate larger ambient tracks. Examples include electronic beeps when near computer systems, zap sounds near electrical fires, plane sounds on the airport tarmac, and the horn beeps and sirens heard in city environments. The OSBD.grp files used as detail tracks are airport_detail, city_detail, citydetail_rooftop, citygarage, elec_detail, elecfire_detail, exthangar_detail, hangar_detail, idustry_detail, normcompdetail, spacecompdetail if you want to see the sounds they collect. | ||
To see the attributes assigned to these detail tracks and get a sense of normal values for <SphereRadius> and <ElapsedTime>, see the OSBD.amb files that call them: ATM, AiportMonitors, ElecFire, LargerElecFire, airport_exterior, airport_interior, bigroom2_airport, city_amb01, city_amb02, city_amb03, city_amb04, city_amb06rooftop, citydetail, elecdetail, elecfirelwflm, ext_hangar, indus_heavy1, indus_heavy3, indus_light1, largeElecFire, medcomp1, parkgarage, scomp01, scomp02, scomp3, scomp6, smallcomp1, smallcomp2, tranroomlowwdet, transboxwdet, transroomwdetail. | |||
==Using BaseTrack2 to layer sound== | |||
You can place a link to an OSBD.grp in the OSBD.amb's <BaseTrack2> and it will play in parallel with <BaseTrack1>. | |||
===Mixing music tracks=== | ===Mixing music tracks=== | ||
Oni uses this feature in order to layer one music track over another, but only in | 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 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. | ||
There is no requirement that the <Sound>s in BaseTrack1's .grp file have the same length as BaseTrack2's; each base track will keep looping its specified <Sound>s independently until the music ends. However, if the two tracks do not have segments of the same length (or at least, if one track's segments do not evenly divide into the other's), it might be very noticeable when one base track cleanly transitions to the shared <OutSound> and the other base track cuts abruptly to it. ' | There is no requirement that the <Sound>s in BaseTrack1's .grp file have the same length as BaseTrack2's; each base track will keep looping its specified <Sound>s independently until the music ends. However, if the two tracks do not have segments of the same length (or at least, if one track's segments do not evenly divide into the other's), it might be very noticeable when one base track cleanly transitions to the shared <OutSound> and the other base track cuts abruptly to it. Based on the example of OSBDmus_xtr2, it's BaseTrack2 (when present) which will finish out its current segment and BaseTrack1 that will cut abruptly at the same time. | ||
Because of this, it may seem unacceptable to mix tracks with different segment lengths, but OSBDmus_xtr2 showcases a working solution: mixing an "unstructured" track with a "structured" track; because SNDDmus_xtr2hi.aif is a continuous note, it doesn't matter that it's 5 seconds long and the SNDDmus_xtr2_[1-6].aif segments are 14-24 seconds long; the OSBD can cut to its outro at the end of any SNDDmus_xtr2_*.aif segment without audible disruption in SNDDmus_xtr2hi.aif. | |||
A second solution to the problem of mismatched lengths is simply to fade out the piece using <code>sound_music_volume</code> instead of relying on the base tracks to line up going into the outro. Oni does this with | A second solution to the problem of mismatched lengths is simply to fade out the piece using <code>sound_music_volume</code> instead of relying on the base tracks to line up going into the outro. Oni does this with OSBDmus_xtr2 at the end of the Shinatama cutscene in order to cross-fade into atm_cl10, though it does rely on the .amb's <OutSound> to bring the music to a graceful close in the Dream Lab cutscene by calling <code>sound_music_stop</code>. | ||
===Layering ambience=== | ===Layering ambience=== |