Sound – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
m (rangeCurve - added example for distant dependant sounds)
m (Text replacement - "{{Feature | Informative | " to "{{Feature|informative|")
 
(48 intermediate revisions by 6 users not shown)
Line 1: Line 1:
=The first ever BIKI-Site dedicated to Audio in Arma=
{| cellpadding="6"
| [[File:A3_SoundMainScheme.jpg]]
|
== General Sound Configuration ==


This site is WIP and will deliver more detailed information and examples as the time passes. For now we will focuss on basic understanding of ''SoundShader'', ''SoundSet'', ''cfgGlobals'', ''cfgSoundCurves'' and ''cfgSound3dProcessors''.
* [[Arma 3: Sound: SoundShader|SoundShader]]
* [[Arma 3: Sound: SoundSet|SoundSet]]
* [[Arma 3: Sound: Sound Curves|Sound Curves]]
* [[Arma 3: Sound: SoundShapes|SoundShapes]]
* [[Arma 3: Sound: Filters|Filters]]
* [[Arma 3: Sound: Processing Types|Processing Types]]
* [[Arma 3: Sound: Global Sound Parameters|Global Sound Parameters]]
|}
 
{{arma3}}'s sound system became much more complex with the release of the {{Link|link= https://dev.arma3.com/post/sitrep-00144|text= Eden Update}}. Sound is not anymore a single sample (array respectively) with parameters, but a structure assembled from several layers with embedded audio features.
 
Process of sound configuration unification is still in progress (not all gameplay features use this system), information about new implementations will be continuously updated.
 
'''This wiki page serves as a hub - linking you to the different elements of the system.'''


==SoundShader==
{{Feature|informative|You may at some point find volume defined with '''db''' (e.g {{hl|db-40}}). The formula for db-based volume is: {{hl|10^(''number''*(1/20))}}.<br>
The '''SoundShader''' within the class ''cfgSoundShaders'' is the most basic sound entity in the ArmA 3 sound engine. Let's look at an example and the parameters.
The db value is expressed in dBFS ({{Link|https://en.wikipedia.org/wiki/DBFS|Decibels relative to full scale}}). See also {{Link|Arma 3 Sound: cfgSoundShaders#volume}}.
<code>class cfgSoundShaders
}}
{
 
class MX_Closure_SoundShader
=== See Also ===
{
samples[] =
{
{"pathToYourSound1",1},
{"pathToYourSound2",1},
{"pathToYourSound3",1}
};
volume = 0.5;
frequency = 1;
range = 10;
rangeCurve[] =
{
{0,1},
{5,0.7},
{10,0}
};
limitation = 0;
};
};</code>
===samples===
{| class="wikitable"
!parameter
!unit/values
!default
!descriptions
|-
!samples
|{["path/sound",p], ...}
|none
|array containing sound file name with paths and probability values (p)
|}
Here you define the path to your sound. The number after the path is used in the random sample selection. When a SoundShader with multiple sounds is called one sound is chosen randomly. The bigger the number behind the sound, the higher the chance of the sound being picked. So ''{"pathToYourSound1",10}'' is a lot more likely to be picked than ''{"pathToYourSound2",1}''.


Also noteworthy here is that in previous ArmA sound configuration we had to make sure that all the probability numbers add up to 1. So if we had two sounds their probabilities had to be 0.5. With the new configuration this is no longer needed.
* An [[Arma 3: Sound: ExampleWeaponConfig|example configuration]] for a weapon
''{"pathToYourSound1",10}''
* An [[Arma 3: Sound: SoundControllers|overview on SoundControllers]] which can be used to build [[Simple Expression]]d for volume/frequency calculation.
''{"pathToYourSound2",10}''
is the same as
''{"pathToYourSound1",1}''
''{"pathToYourSound1",1}''
Both sounds have the same chance of being picked.
===volume===
{| class="wikitable"
!parameter
!unit/values
!default
!descriptions
|-
!volume
|float
|1
|basic volume value
|}
Volume defines how loud the sample is played in relation to 0dBFS - the highest volume value in the digital world. A value of 1 means 100% means 0dbFS. A value of 0.5 means 50% means -6dBFS. If you want to calculate what values to enter here depending on dB, [http://www.redwirez.com/pcalc.jsp you can use this calculator] (I suggest you download the site to your computer to make sure you can work offline). Any other percentage to dB calculator will work. Careful though, [https://lightmachinery.com/optical-design-center/more-optical-design-tools/percentage-to-db/ as you can see on this] site signal dB is not equal power dB! Always be sure to calculate with the right dB! To ensure you work with the right dB test this: -6dB = 50%, always.
===frequency===
{| class="wikitable"
!parameter
!unit/values
!default
!descriptions
|-
!frequency
|float
|1
|basic pitch value, 1 = no change = normal pitch. Parameter ignored if more than 1 ''SoundShaders'' in ''SoundSet''
|}
Playback speed/pitch of the sound. Low number = low pitch, high number = high pitch. This parameter is '''ignored''' when the ''SoundShader'' is used together with other ''SoundShaders'' in a ''SoundSet'' (which can consist of multiple SoundShaders, more on that later).
===range===
{| class="wikitable"
!parameter
!unit/values
!default
!descriptions
|-
!range
|distance in meters
|0
|radius of circle around sound source where the sound will be played
|}
The sound will be played in this radius around the sound source. There is no volume falloff configured yet so without any additional configuration the sound would start playing at full volume as soon as you are within this radius.
===rangeCurve===
{| class="wikitable"
!parameter
!unit/values
!default
!descriptions
|-
!rangeCurve
|{d0,v0}, {d1,v1}
|none
|array of points or class name defined in CfgSoundCurves
|}
Here you can define the volume falloff depending on distance. The values are given in X,Y pairs. X being the distance, Y being the volume value. In the example the sound will be played at full volume at 0m distance. At 5m distance the volume will be 0.7 (70%, -3dB) and at 10m the sound will be silent. You can use hundreds of points to make really smooth curves. You can either use distance values within the range (in the example from 0m to 10m) OR use ''relative'' range values, 1 being maximum range. So the above example would also work with:
<code>rangeCurve[] =
{
{0,1},
{0.5,0.7},
{1,0}
};</code>
'''Attention!''' In this case ''{0.5,0.7},'' means "at half ''range'' volume will be 0.7" and ''{1,0}'' means "at maximum ''range'' volume will be 0".


'''rangeCurve''' is pretty awesome because you can combine multiple ''SoundShaders'' with different ''rangeCurves'' within one ''SoundSet'' and play different sounds depending on distance. Imagine you have two SoundShaders:
<code>First SoundShader (close sounds)
range = 50;
rangeCurve[] =
{
{0,1},
{25,0.7},
{50,0}
};
Second SoundShader (distant sounds)
range = 1800;
rangeCurve[] =
{
{0,0.2},
{25,0.7},
{50,1},
{1800,1}
};</code>
The close sound will start to become quieter over distance and at 50m it will be completely silent. The distant sound starts off quietly and slowly becomes more loud until max volume at 50m. Max volume factor is kept within the SoundShader until 1800m (max distance of second SoundShader).
====CfgSoundCurves====
CfgSoundCurves is it's own class in the audio configuration and is defined outside CfgSoundShaders but I will bring it up here anyway because it fits.
Instead of having to define many points every time in every SoundShader you can use the class cfgSoundCurves to define specific sound curves and then just use the names of these soundCurves in your other sound configurations. Let's look at an example cfgSoundCurve entry:
<code>class CfgSoundCurves
{
class closureVolumeCurve
{
points[] =
{
{0.0,1.0},
{0.5,0.7},
{1.0,0.0}
};
};
};</code>
This entry uses relative distance values (0=0m, 1=maximum range) and is called "closureVolumeCurve". So in our example SoundShader above we could have used: '''rangeCurve[] = closureVolumeCurve''' and the result would be the same. Make sure the rangeCurve is defined in cfgSoundCurves class before using it in audio configuration!
===limitation===
{| class="wikitable"
!parameter
!unit/values
!default
!descriptions
|-
!limitation
|bool
|false
|if positive -> adds SoundShader to group of SoundShaders which will be limited within the SoundSet
|}
If enabled this adds the ''SoundShader'' to a group of ''SoundShaders'' which will be limited within the ''SoundSet'', explanation of that will be found when we go over ''SoundSets''.
==SoundSet==


WIP
{{GameCategory|arma3|Sound}}
More coming soon.

Latest revision as of 21:41, 16 May 2024

A3 SoundMainScheme.jpg

General Sound Configuration

Arma 3's sound system became much more complex with the release of the Eden Update. Sound is not anymore a single sample (array respectively) with parameters, but a structure assembled from several layers with embedded audio features.

Process of sound configuration unification is still in progress (not all gameplay features use this system), information about new implementations will be continuously updated.

This wiki page serves as a hub - linking you to the different elements of the system.

You may at some point find volume defined with db (e.g db-40). The formula for db-based volume is: 10^(number*(1/20)).
The db value is expressed in dBFS (Decibels relative to full scale). See also Arma 3 Sound: cfgSoundShaders - volume.

See Also