XML:SNDD: Difference between revisions

From OniGalore
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{finish}}
{{finish}}
(More OSBD .grp / .amb information could be good and .imp is completly left out so far.)
(More OSBD .grp / .amb information could be good, .imp and a Mac conversion tool is completly left out so far.)




Line 162: Line 162:


==[http://oni.bungie.org/community/forum/viewtopic.php?id=798 OCF thread about new music]==
==[http://oni.bungie.org/community/forum/viewtopic.php?id=798 OCF thread about new music]==
^
 
 
==How to register sounds to characters==
... such as sounds of heavy attacks and taunts.
 
 
'''Let's see how sounds become picked up:'''<br>Schemata:
: TRAM -> ONCC -> OSBD.amb -> OSBD.grp -> SNDD
Explanation:
* The character performs a move / attack whereby the TRAM file holds a sound ID (<Vocalization>).
* A link (OSBD.amb name) in ONCC file becomes looked up based on the sound ID.<br>Note that the ONCC file has also a probability value that randomly decides whether a sound becomes played or not.
* The game engine looks into OSBD.amb and follows the link into OSBD.grp.
* '''OSBD.grp can hold multiple links to SNDD files.''' That's why Konoko can have multiple taunt sounds.
 
 
===step 1: preparing the TRAM===
'''Search for <Vocalization> in the TRAM file''' and give it an ID according to the following table.
 
 
{|
{{table}}
!colspan=3| comparison of TRAM's <Vocalization> IDs and ONCC's <String>s
|-
|width=80px|
|width=30px| ID
| link to ...
|-
| <String>
| 0
| '''taunt(s)'''
|-
| <String>
| 1
| being surprised by a sound
|-
| <String>
| 2
| being surprised by an enemy
|-
| <String>
| 3
| death taunt (when enemy / player dies)
|-
| <String>
| 4
| sound when character lost track of enemy
|-
| <String>
| 5
| being afraid (E.g. "Dont't hurt me.")
|-
| <String>
| 6
| '''sound of ######punch_heavy.oni''', super punches don't have sound IDs
|-
| <String>
| 7
| '''sound of ######kick_heavy.oni''', super kicks don't have sound IDs
|-
| <String>
| 8
| AI specialty, Mukade use it for his devil star attack
|-
| <String>
| <font color=#777777>9</font>
| <font color=#777777>AI special 2? Unsued or really dead?</font>
|}
 
 
===step 2: preparing the ONCC===
Search for <SoundProbabilities> and set a value. The "<Int8>" tags have the same ID as the "<string>" tags in the table above.
 
If write 100 into the first in8 tag (<Int8>100</Int8>) then you have a 100 % probability that the taunt sound will be played.
 
7th <Int8> would have ID 6.<br>8th <Int8> would have ID 7.<br>The little difference exist because of ID 0 for taunt.
 
Fill your needed <String></String> tags when you're done with the <Int8> values.
 
 
Let's compare with Konoko (and in the following steps especially the with her taunt files.)
In ONCCkonoko_generic.xml it looks like this:
        <SoundProbabilities>
            <Int8>100</Int8>
            <Int8>0</Int8>
            <Int8>0</Int8>
            <Int8>0</Int8>
            <Int8>0</Int8>
            <Int8>0</Int8>
            <Int8>100</Int8>
            <Int8>100</Int8>
            <Int8>0</Int8>
            <Int8>0</Int8>
        </SoundProbabilities>
        <Sounds>
            <String>c17_99_28konoko</String>
            <String></String>
            <String></String>
            <String></String>
            <String></String>
            <String></String>
            <String>c18_79_14konoko</String>
            <String>c18_79_15konoko</String>
            <String></String>
            <String></String>
        </Sounds>
 
 
 
===step 3: preparing the OSBD.amb===
You basically need such a file...
 
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>.
 
<?xml version="1.0" encoding="utf-8"?>
<Oni Version="0.9.52.0">
    <AmbientSound>
        <Priority>Highest</Priority>
        <Flags>InterruptTracksOnStop PlayOnce</Flags>
        <DetailTrackProperties>
            <SphereRadius>10</SphereRadius>
            <ElapsedTime>
                <Min>0</Min>
                <Max>0</Max>
            </ElapsedTime>
        </DetailTrackProperties>
        <Volume>
            <Distance>
                <Min>10</Min>
                <Max>50</Max>
            </Distance>
        </Volume>
        <DetailTrack></DetailTrack>
        <BaseTrack1>c17_99_28konoko</BaseTrack1>
        <BaseTrack2></BaseTrack2>
        <InSound></InSound>
        <OutSound></OutSound>
        <Treshold>3</Treshold>
        <MinOcclusion>0</MinOcclusion>
    </AmbientSound>
</Oni>
 
 
===step 4: preparing the OSBD.grp===
Since <NumberOfChannels> is only once presented all the SNDD file must have the same number of channels (moro/stereo).
 
(It's possible to speed up sounds with <Pitch>. E.g. Fury's taunt is speeded up by 1.14 to ''brighten'' the voice. But in most cases you probably want to keep it as "1".)
 
<?xml version="1.0" encoding="utf-8"?>
<Oni Version="0.9.52.0">
    <SoundGroup>
        <Volume>1</Volume>
        <Pitch>1</Pitch>
        <PreventRepeats>1</PreventRepeats>
        <LastSelectedPermutation>0</LastSelectedPermutation>
        <NumberOfChannels>1</NumberOfChannels>
        <Permutations>
            <Permutation>
                <Weight>10</Weight>
                <Volume>
                    <Min>1</Min>
                    <Max>1</Max>
                </Volume>
                <Pitch>
                    <Min>1</Min>
                    <Max>1</Max>
                </Pitch>
                <Sound>c17_99_28konoko.aif</Sound>
            </Permutation>
            <Permutation>
                <Weight>10</Weight>
                <Volume>
                    <Min>1</Min>
                    <Max>1</Max>
                </Volume>
                <Pitch>
                    <Min>1</Min>
                    <Max>1</Max>
                </Pitch>
                <Sound>c17_99_29konoko.aif</Sound>
            </Permutation>
            '''''[...]'''''
        </Permutations>
    </SoundGroup>
</Oni>
 
 
As you can see
* <font color=#AAAAAA>SNDD</font>c17_99_28konoko.aif<font color=#AAAAAA>.oni</font> ("You're gonna get beat(en) by a girl!")
* <font color=#AAAAAA>SNDD</font>c17_99_29konoko.aif<font color=#AAAAAA>.oni</font> ("Ready to lose?") (You can play sounds with (PC) onisplit GUI or (Mac) AETools.
* ''[...]''
are used for Konoko. ("aif" is here part of the name, don't get bothered by it.)
This file is the magic why Konoko has multiple sounds through one and the same taunt animation.
 
 
===step 5: everything else what's left===
* [[#Source_file_requirements|create your SNDD]] if you haven't yet
* put your files into a package
* test your stuff in-game

Revision as of 15:58, 24 April 2011

Unfinished building-60px.jpg

This page is unfinished. Can you fill in any missing information?
If it is not clear which part of the page is unfinished, ask on the talk page.

(More OSBD .grp / .amb information could be good, .imp and a Mac conversion tool is completly left out so far.)


How do I get sounds into Oni?

Source file requirements

First of, your sound files must meet these features:

PC retail MAC
.wav
mono / stereo
22.05KHz / 44.1KHz
uncompressed (PCM) / compressed (MS-ADPCM)
.aif / .aifc / .afc
mono / stereo
22.05KHz
compressed (ima4)


Helpful conversion tools

for PC

To create suitable files you could use this tool: River Past Audio Converter 7.8. (Also mirrored here.) The trail version let you convert sounds that are up to 4 minutes long.

In order to make your sounds available on both sides - pc and mac - you need to create them twice (one time from a wav source and another time from an aif/aifc/afc source).

mp3_to_compressed_aif_tn.png mp3_to_compressed_wav_tn.png

When you're done you can use Onisplit GUI to convert yourfile.aif/.wav, OSBDyourfile.grp.xml and OSBDyourfile.amb.xml to the .oni-file formate. Use the "manual command input":

-create output_directory input_directory/*.aif
-create output_directory input_directory/*.wav (don't overwrite the first created SNDD, save it somewhere)
-create output_directory input_directory/*.xml

Make it that way they all have the same name:

  • SNDDyourfile.oni
  • OSBDyourfile.grp.oni
  • OSBDyourfile.amb.oni

Music tracks can be split into several parts. However, I'd say do that only if you know what you are doing. If you are going to split music track look here.


for MAC

?


OSBD information

OSBD_newmusic.amb.oni (The main file, links to the group, intro and ending files)
OSBD_newmusic.grp.oni (Contain links to the music files)
OSBD_newmusic_in.grp.oni (Links to intro part of the music - Optional)
OSBD_newmusic_out.grp.oni (Links to the ending of the music - Optional)
SNDD_newmusic1.oni (The individual music files - Its best to break up the music into segments of perhaps 30 secs to a minute each - Oni may crash or become sluggish if you use a single file for the music -- EdT) (Can someone doublecheck this? --Paradox-01 19:54, 23 April 2011 (UTC))


OSBDfile.grp.xml

In case you want to create a simple sound file you can basically copy the code and change the red marked stuff.

  • <Oni Version=" "> - self-explanatory, isn't it?
  • <NumberOfChannels> - here you tell Oni if your sound file is mono (1) or stereo (2), if you set the wrong value the music will sound distorted
  • <Sound> - this is the sound file (for example: SNDDnyan.oni), file prefix and suffix aren't used

(sample file)

<?xml version="1.0" encoding="utf-8"?>
<Oni Version="0.9.52.0">
   <SoundGroup>
       <Volume>1</Volume>
       <Pitch>1</Pitch>
       <PreventRepeats>1</PreventRepeats>
       <LastSelectedPermutation>0</LastSelectedPermutation>
       <NumberOfChannels>2</NumberOfChannels>
       <Permutations>
           <Permutation>
               <Weight>10</Weight>
               <Volume>
                   <Min>1</Min>
                   <Max>1</Max>
               </Volume>
               <Pitch>
                   <Min>1</Min>
                   <Max>1</Max>
               </Pitch>
               <Sound>nyan</Sound>
           </Permutation>
       </Permutations>
   </SoundGroup>
</Oni>


OSBDfile.amb.xml

This file use the .grp file(s).
This file is used by area-fixed sounds. (See level-specific file BINACJBOSound.xml.)

  • <Flags> - use "PlayOnce" if you don't want your sound to be repeated automatically
  • <BaseTrack1> - this is the grp sound file (for example: SNDDnyan.grp.oni), file prefix and suffix aren't used

(sample file)

<?xml version="1.0" encoding="utf-8"?>
<Oni Version="0.9.52.0">
   <AmbientSound>
       <Priority>Normal</Priority>
       <Flags>InterruptTracksOnStop</Flags>
       <DetailTrackProperties>
           <SphereRadius>10</SphereRadius>
           <ElapsedTime>
               <Min>0</Min>
               <Max>0</Max>
           </ElapsedTime>
       </DetailTrackProperties>
       <Volume>
           <Distance>
               <Min>10</Min>
               <Max>50</Max>
           </Distance>
       </Volume>
       <DetailTrack></DetailTrack>
       <BaseTrack1>nyan</BaseTrack1>
       <BaseTrack2></BaseTrack2>
       <InSound></InSound>
       <OutSound></OutSound>
       <Treshold>3</Treshold>
       <MinOcclusion>0</MinOcclusion>
   </AmbientSound>
</Oni>


BINACJBOSound.xml

This is for area fixed-sounds.

  • <Class> - this is the amb sound file (for example: SNDDnyan.amb.oni), file prefix and suffix aren't used
  • <MinRadius> - between min radius and sound origin (<Position>) is the sound volume equally strong
  • <MaxRadius> - between max and min radius is a transition of the sound volume

(A block ("object") of sample code.)

       <Object Id="8805" Type="SNDG">
           <Header>
               <Flags>0</Flags>
               <Position>125 10 2231</Position>
               <Rotation>0 0 0</Rotation>
           </Header>
           <OSD>
               <Class>nyan</BaseTrack1></Class>
               <Sphere>
                   <MinRadius>7</MinRadius>
                   <MaxRadius>21</MaxRadius>
               </Sphere>
               <Volume>1</Volume>
               <Pitch>1</Pitch>
           </OSD>
       </Object>


sound-related BSL commands


OCF thread about new music

How to register sounds to characters

... such as sounds of heavy attacks and taunts.


Let's see how sounds become picked up:
Schemata:

TRAM -> ONCC -> OSBD.amb -> OSBD.grp -> SNDD

Explanation:

  • The character performs a move / attack whereby the TRAM file holds a sound ID (<Vocalization>).
  • A link (OSBD.amb name) in ONCC file becomes looked up based on the sound ID.
    Note that the ONCC file has also a probability value that randomly decides whether a sound becomes played or not.
  • The game engine looks into OSBD.amb and follows the link into OSBD.grp.
  • OSBD.grp can hold multiple links to SNDD files. That's why Konoko can have multiple taunt sounds.


step 1: preparing the TRAM

Search for <Vocalization> in the TRAM file and give it an ID according to the following table.


comparison of TRAM's <Vocalization> IDs and ONCC's <String>s
ID link to ...
<String> 0 taunt(s)
<String> 1 being surprised by a sound
<String> 2 being surprised by an enemy
<String> 3 death taunt (when enemy / player dies)
<String> 4 sound when character lost track of enemy
<String> 5 being afraid (E.g. "Dont't hurt me.")
<String> 6 sound of ######punch_heavy.oni, super punches don't have sound IDs
<String> 7 sound of ######kick_heavy.oni, super kicks don't have sound IDs
<String> 8 AI specialty, Mukade use it for his devil star attack
<String> 9 AI special 2? Unsued or really dead?


step 2: preparing the ONCC

Search for <SoundProbabilities> and set a value. The "<Int8>" tags have the same ID as the "<string>" tags in the table above.

If write 100 into the first in8 tag (<Int8>100</Int8>) then you have a 100 % probability that the taunt sound will be played.

7th <Int8> would have ID 6.
8th <Int8> would have ID 7.
The little difference exist because of ID 0 for taunt.

Fill your needed <String></String> tags when you're done with the <Int8> values.


Let's compare with Konoko (and in the following steps especially the with her taunt files.) In ONCCkonoko_generic.xml it looks like this:

       <SoundProbabilities>
           <Int8>100</Int8>
           <Int8>0</Int8>
           <Int8>0</Int8>
           <Int8>0</Int8>
           <Int8>0</Int8>
           <Int8>0</Int8>
           <Int8>100</Int8>
           <Int8>100</Int8>
           <Int8>0</Int8>
           <Int8>0</Int8>
       </SoundProbabilities>
       <Sounds>
           <String>c17_99_28konoko</String>
           <String></String>
           <String></String>
           <String></String>
           <String></String>
           <String></String>
           <String>c18_79_14konoko</String>
           <String>c18_79_15konoko</String>
           <String></String>
           <String></String>
       </Sounds>


step 3: preparing the OSBD.amb

You basically need such a file...

Do you see the <BaseTrack1> tag? In this case it holds the link OSBDc17_99_28konoko.grp.oni.

<?xml version="1.0" encoding="utf-8"?>
<Oni Version="0.9.52.0">
   <AmbientSound>
       <Priority>Highest</Priority>
       <Flags>InterruptTracksOnStop PlayOnce</Flags>
       <DetailTrackProperties>
           <SphereRadius>10</SphereRadius>
           <ElapsedTime>
               <Min>0</Min>
               <Max>0</Max>
           </ElapsedTime>
       </DetailTrackProperties>
       <Volume>
           <Distance>
               <Min>10</Min>
               <Max>50</Max>
           </Distance>
       </Volume>
       <DetailTrack></DetailTrack>
       <BaseTrack1>c17_99_28konoko</BaseTrack1>
       <BaseTrack2></BaseTrack2>
       <InSound></InSound>
       <OutSound></OutSound>
       <Treshold>3</Treshold>
       <MinOcclusion>0</MinOcclusion>
   </AmbientSound>
</Oni>


step 4: preparing the OSBD.grp

Since <NumberOfChannels> is only once presented all the SNDD file must have the same number of channels (moro/stereo).

(It's possible to speed up sounds with <Pitch>. E.g. Fury's taunt is speeded up by 1.14 to brighten the voice. But in most cases you probably want to keep it as "1".)

<?xml version="1.0" encoding="utf-8"?>
<Oni Version="0.9.52.0">
   <SoundGroup>
       <Volume>1</Volume>
       <Pitch>1</Pitch>
       <PreventRepeats>1</PreventRepeats>
       <LastSelectedPermutation>0</LastSelectedPermutation>
       <NumberOfChannels>1</NumberOfChannels>
       <Permutations>
           <Permutation>
               <Weight>10</Weight>
               <Volume>
                   <Min>1</Min>
                   <Max>1</Max>
               </Volume>
               <Pitch>
                   <Min>1</Min>
                   <Max>1</Max>
               </Pitch>
               <Sound>c17_99_28konoko.aif</Sound>
           </Permutation>
           <Permutation>
               <Weight>10</Weight>
               <Volume>
                   <Min>1</Min>
                   <Max>1</Max>
               </Volume>
               <Pitch>
                   <Min>1</Min>
                   <Max>1</Max>
               </Pitch>
               <Sound>c17_99_29konoko.aif</Sound>
           </Permutation>
           [...]
       </Permutations>
   </SoundGroup>
</Oni>


As you can see

  • SNDDc17_99_28konoko.aif.oni ("You're gonna get beat(en) by a girl!")
  • SNDDc17_99_29konoko.aif.oni ("Ready to lose?") (You can play sounds with (PC) onisplit GUI or (Mac) AETools.
  • [...]

are used for Konoko. ("aif" is here part of the name, don't get bothered by it.) This file is the magic why Konoko has multiple sounds through one and the same taunt animation.


step 5: everything else what's left

  • create your SNDD if you haven't yet
  • put your files into a package
  • test your stuff in-game