XML:SNDD: Difference between revisions

430 bytes added ,  6 November 2023
m
m (→‎OSBDfile.grp.xml: clearer wording)
Line 515: Line 515:


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 segment (SNDD) finishes playing → outro SNDD 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 timing is a concern, such as in a cutscene, you could leave out the <OutSound> (but that would make your music end abruptly when the current segment finished playing), fade the music out over any amount of time that you desire, or use the InterruptTracksOnStop flag to skip to <OutSound> immediately so that the music ends sooner.
Thus it can be quite a while before the music really stops. If this lag time is a problem, you could:
# 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.
# Use the InterruptTracksOnStop flag so that <tt>sound_music_stop</tt> skips to playing <OutSound> immediately.


Oni contains many variants of music OSBDs 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. When the last blow is delivered to the attacking Strikers, the music will immediately jump to its outro, punctuating the end of the action.
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.


==OCF thread about making new music==
==OCF thread about making new music==