18,700
edits
m (massaged section links) |
(added info on DetailTrack and sound volume; tweaked wording on BaseTrack2 info) |
||
Line 195: | Line 195: | ||
|- | |- | ||
| <AmbientSound> | | <AmbientSound> | ||
| | | parent tag | ||
| | | | ||
|- | |- | ||
Line 209: | Line 209: | ||
|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 (does this serve a purpose?). | ||
: 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 275: | ||
| <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 700: | Line 700: | ||
* 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 DetailTrack to add ambience== | |||
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== | ==Using BaseTrack2 to layer sound== | ||
You can place a | 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 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 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. | ||
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, '''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=== |