Howto:Add sound effects to aircraft: Difference between revisions

Jump to navigation Jump to search
→‎Configuration tags: Volume and pitch tags are now indented
(→‎Configuration tags: added random tag for pitch)
(→‎Configuration tags: Volume and pitch tags are now indented)
Line 159: Line 159:
: Volume final output can range from 0 to 1. 1 represents full volume and 0 is silence.
: Volume final output can range from 0 to 1. 1 represents full volume and 0 is silence.


; <code>&lt;expression&gt;</code>
:; <code>&lt;expression&gt;</code>
: Defines an expression, and will replace all other tags in this volume/pitch tag.
:: Defines an expression, and will replace all other tags in this volume/pitch tag.


; <code>&lt;property&gt;</code>
:; <code>&lt;property&gt;</code>
: Defines which property supplies the value for the calculation.
:: Defines which property supplies the value for the calculation.


: Either a <property> or an <internal> should be defined.  If none is defined, the property reverts to its default.  For volume this is 0, meaning the sound will not be audible at all.
:: Either a <property> or an <internal> should be defined.  If none is defined, the property reverts to its default.  For volume this is 0, meaning the sound will not be audible at all.


: The value is treated as a floating point number.
:: The value is treated as a floating point number.


; <code>&lt;internal&gt;</code>
:; <code>&lt;internal&gt;</code>
: Defines which internal variable should be used for the calculation.
:: Defines which internal variable should be used for the calculation.


: The value is treated as a floating point number.
:: The value is treated as a floating point number.


: The following internals are available at this time:
:: The following internals are available at this time:


:; dt_play
::; dt_play
:: The number of seconds since the sound started playing.
::: The number of seconds since the sound started playing.


:; dt_stop
::; dt_stop
:: The number of seconds after the sound has stopped.
::: The number of seconds after the sound has stopped.


; <code>&lt;delay-sec&gt;</code>
:; <code>&lt;delay-sec&gt;</code>
: Delay after which the sound starts playing.
:: Delay after which the sound starts playing.


: This is useful to let a property start two sounds at the same time, where the second is delayed until the first stopped playing.
:: This is useful to let a property start two sounds at the same time, where the second is delayed until the first stopped playing.


; <code>&lt;type&gt;</code>
:; <code>&lt;type&gt;</code>
: Defines the function that should be used upon the property before it is used for calculating the net result:
:: Defines the function that should be used upon the property before it is used for calculating the net result:


:; lin
::; lin
:: Linear handling of the property value. This is the default.
::: Linear handling of the property value. This is the default.
   
   
:; ln
::; ln
:: Convert the property value to a natural logarithmic value before scaling it.
:: Convert the property value to a natural logarithmic value before scaling it.


:: Anything below 1 will return zero.
::: Anything below 1 will return zero.
   
   
:; log
::; log
:: convert the property value to a true logarithmic value before scaling it. (log base 10)
::: convert the property value to a true logarithmic value before scaling it. (log base 10)


:: Anything below 1 will return zero.
::: Anything below 1 will return zero.


:; inv
::; inv
:: Inverse linear handling (1/x).
::: Inverse linear handling (1/x).


:; abs
::; abs
:: Absolute handling of the value (always positive).
:: Absolute handling of the value (always positive).


:; sqrt
::; sqrt
:: Calculate the square root of the absolute value before scaling it.
::: Calculate the square root of the absolute value before scaling it.


; <code>&lt;factor&gt;</code>
:; <code>&lt;factor&gt;</code>
: Defines the multiplication factor for the property value.
:: Defines the multiplication factor for the property value.


: A special condition is when scale is defined as a negative value. In this case the result of |<scale>| * <property) will be subtracted from &lt;default&gt;
:: A special condition is when scale is defined as a negative value. In this case the result of |<scale>| * <property) will be subtracted from &lt;default&gt;


; <code>&lt;offset&gt;</code>
:; <code>&lt;offset&gt;</code>
: The initial value for this sound.
:: The initial value for this sound.


: This value is also used as an offset value for calculating the end result.
:: This value is also used as an offset value for calculating the end result.


; <code>&lt;random&gt;</code>
:; <code>&lt;random&gt;</code>
: Add a bit of randomness to the offset. Only used for pitch.
:: Add a bit of randomness to the offset. Only used for pitch.


; <code>&lt;min&gt;</code>
:; <code>&lt;min&gt;</code>
: Minimum allowed value.
:: Minimum allowed value.


: This is useful if sounds start to sound funny. Anything lower will be truncated to this value.
:: This is useful if sounds start to sound funny. Anything lower will be truncated to this value.


; <code>&lt;max&gt;</code>
:; <code>&lt;max&gt;</code>
: Maximum allowed value.
:: Maximum allowed value.


: This is useful if sounds gets to loud. Anything higher will be truncated to this value.
:: This is useful if sounds gets to loud. Anything higher will be truncated to this value.


: Keep in mind that min & max are applied first, then offset.  So for example if min = 0, max = 0.5 and offset = 1.0, then the resulting values will range 1 to 1.5.
:: Keep in mind that min & max are applied first, then offset.  So for example if min = 0, max = 0.5 and offset = 1.0, then the resulting values will range 1 to 1.5.


; <code>&lt;position&gt;</code>
; <code>&lt;position&gt;</code>
574

edits

Navigation menu