- add <delay-sec>
- fix mixed indentation
This commit is contained in:
parent
246ce973ec
commit
95a652be17
1 changed files with 99 additions and 94 deletions
|
@ -63,136 +63,141 @@ Configuration description:
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
<fx>
|
<fx>
|
||||||
Named FX subtree living under /sim/sound
|
Named FX subtree living under /sim/sound
|
||||||
|
|
||||||
< ... >
|
< ... >
|
||||||
This is the event separator. The text inside the brackets
|
This is the event separator. The text inside the brackets
|
||||||
can be anything. Bit it is advised to give it a meaningful name
|
can be anything. Bit it is advised to give it a meaningful name
|
||||||
like: crank, engine, rumble, gear, squeal, flap, wind or stall
|
like: crank, engine, rumble, gear, squeal, flap, wind or stall
|
||||||
|
|
||||||
The value can be defined multiple times, thus anything which is
|
The value can be defined multiple times, thus anything which is
|
||||||
related may have the same name (grouping them together).
|
related may have the same name (grouping them together).
|
||||||
|
|
||||||
<name>
|
<name>
|
||||||
This defines the name of the event. This name is used internally
|
This defines the name of the event. This name is used internally
|
||||||
and, although it can me defined multiple times in the same file,
|
and, although it can me defined multiple times in the same file,
|
||||||
should normally have an unique value.
|
should normally have an unique value.
|
||||||
|
|
||||||
Multiple definitions of the same name will allow multiple sections
|
Multiple definitions of the same name will allow multiple sections
|
||||||
to interfere in the starting and stopping of the sample.
|
to interfere in the starting and stopping of the sample.
|
||||||
|
|
||||||
This method can't be used to control the pitch or volume of the
|
This method can't be used to control the pitch or volume of the
|
||||||
sample, but instead multiple volume or pitch section should be
|
sample, but instead multiple volume or pitch section should be
|
||||||
included inside the same event.
|
included inside the same event.
|
||||||
|
|
||||||
The types "raise" and "fall" will stop the playback of the sample
|
The types "raise" and "fall" will stop the playback of the sample
|
||||||
regardless of any other event. This means that when the type "raise"
|
regardless of any other event. This means that when the type "raise"
|
||||||
is supplied, sample playback will stop when the event turns false.
|
is supplied, sample playback will stop when the event turns false.
|
||||||
Using the type "fall" will stop playback when the event turns true.
|
Using the type "fall" will stop playback when the event turns true.
|
||||||
|
|
||||||
IMPORTANT:
|
IMPORTANT:
|
||||||
If the trigger is used for anything else but stopping the sound
|
If the trigger is used for anything else but stopping the sound
|
||||||
at a certain event, all sections with the same name *should* have
|
at a certain event, all sections with the same name *should* have
|
||||||
exactly the same sections for everything but property and type.
|
exactly the same sections for everything but property and type.
|
||||||
|
|
||||||
|
In the case of just stopping the sample at a certain event, the
|
||||||
|
sections for path, volume and pitch may be omitted.
|
||||||
|
|
||||||
In the case of just stopping the sample at a certain event, the
|
|
||||||
sections for path, volume and pitch may be omitted.
|
|
||||||
|
|
||||||
<path>
|
<path>
|
||||||
This defined th path to the sound file. The path is relative to the
|
This defined th path to the sound file. The path is relative to the
|
||||||
FlightGear root directory but could be specified absolute.
|
FlightGear root directory but could be specified absolute.
|
||||||
|
|
||||||
<condition>
|
<condition>
|
||||||
Define a condition that triggers the event.
|
Define a condition that triggers the event.
|
||||||
For a complete description of the FlightGear conditions,
|
For a complete description of the FlightGear conditions,
|
||||||
please read docs-mini/README.conditions
|
please read docs-mini/README.conditions
|
||||||
|
|
||||||
An event should define either a condition or a property.
|
An event should define either a condition or a property.
|
||||||
|
|
||||||
<property>
|
<property>
|
||||||
Define which property triggers the event, and refers to a node
|
Define which property triggers the event, and refers to a node
|
||||||
in the FlightGear property tree. Action is taken when the property
|
in the FlightGear property tree. Action is taken when the property
|
||||||
is non zero.
|
is non zero.
|
||||||
|
|
||||||
A more sophisticated mechanism to trigger the event is described
|
A more sophisticated mechanism to trigger the event is described
|
||||||
in <condition>
|
in <condition>
|
||||||
|
|
||||||
<mode>
|
<mode>
|
||||||
This defines how the sample should be played:
|
This defines how the sample should be played:
|
||||||
|
|
||||||
once: the sample is played once.
|
once: the sample is played once.
|
||||||
this is the default.
|
this is the default.
|
||||||
|
|
||||||
looped: the sample plays continuesly,
|
looped: the sample plays continuously,
|
||||||
until the event turns false.
|
until the event turns false.
|
||||||
|
|
||||||
in-transit: the sample plays continuesly,
|
in-transit: the sample plays continuously,
|
||||||
while the property is changing its value.
|
while the property is changing its value.
|
||||||
|
|
||||||
<volume> / <pitch>
|
<volume> / <pitch>
|
||||||
Volume or Pitch definition. Currently there may be up to 5
|
Volume or Pitch definition. Currently there may be up to 5
|
||||||
volume and up to 5 pitch definitions defined within one sound
|
volume and up to 5 pitch definitions defined within one sound
|
||||||
event. Normally all offset values are added together and the
|
event. Normally all offset values are added together and the
|
||||||
results after property calculations will be miltplied.
|
results after property calculations will be multiplied.
|
||||||
A special condition occurs when the value of factor is negative,
|
A special condition occurs when the value of factor is negative,
|
||||||
in which case the offset doesn't get added to the other offset values
|
in which case the offset doesn't get added to the other offset values
|
||||||
but instead will be used in the multiplication section.
|
but instead will be used in the multiplication section.
|
||||||
|
|
||||||
<property>
|
<property>
|
||||||
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.
|
Either a <property> or an <internal> should be defined.
|
||||||
The value is threated as a floating point number.
|
The value is treated as a floating point number.
|
||||||
|
|
||||||
<internal>
|
<internal>
|
||||||
Defines which internal variable should be used for the calculation.
|
Defines which internal variable should be used for the calculation.
|
||||||
The value is threated 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: the number of seconds since the sound started playing.
|
dt_play: the number of seconds since the sound started playing.
|
||||||
|
|
||||||
dt_stop: the number of seconds after the sound has stopped.
|
dt_stop: the number of seconds after the sound has stopped.
|
||||||
|
|
||||||
|
<delay-sec>
|
||||||
|
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.
|
||||||
|
|
||||||
<type>
|
<type>
|
||||||
Defines the function that should be used upon the property
|
Defines the function that should be used upon the property
|
||||||
before it is used for calculating the net result:
|
before it is used for calculating the net result:
|
||||||
|
|
||||||
lin: linear handling of the property value.
|
lin: linear handling of the property value.
|
||||||
this is the default.
|
this is the default.
|
||||||
|
|
||||||
ln: convert the property value to a natural logarithmic
|
ln: convert the property value to a natural logarithmic
|
||||||
value before scaling it. Anything below 1 will return
|
value before scaling it. Anything below 1 will return
|
||||||
zero.
|
zero.
|
||||||
|
|
||||||
log: convert the property value to a true logarithmic
|
log: convert the property value to a true logarithmic
|
||||||
value before scaling it. Anything below 1 will return
|
value before scaling it. Anything below 1 will return
|
||||||
zero.
|
zero.
|
||||||
|
|
||||||
inv: inverse linear handling (1/x).
|
inv: inverse linear handling (1/x).
|
||||||
|
|
||||||
abs: absolute handling of the value (always positive).
|
abs: absolute handling of the value (always positive).
|
||||||
|
|
||||||
sqrt: calculate the square root of the absolute value
|
sqrt: calculate the square root of the absolute value
|
||||||
before scaling it.
|
before scaling it.
|
||||||
|
|
||||||
<factor>
|
<factor>
|
||||||
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
|
A special condition is when scale is defined as a negative
|
||||||
value. In this case the result of |<scale>| * <property) will be
|
value. In this case the result of |<scale>| * <property) will be
|
||||||
subtracted from <default>
|
subtracted from <default>
|
||||||
|
|
||||||
<offset>
|
<offset>
|
||||||
The initial value for this sound. This value is also used as an
|
The initial value for this sound. This value is also used as an
|
||||||
offset value for calculating the end result.
|
offset value for calculating the end result.
|
||||||
|
|
||||||
<min>
|
<min>
|
||||||
Minimum allowed value.
|
Minimum allowed value.
|
||||||
This is useful if sounds start to sound funny. Anything lower
|
This is useful if sounds start to sound funny. Anything lower
|
||||||
will be truncated to this value.
|
will be truncated to this value.
|
||||||
|
|
||||||
<max>
|
<max>
|
||||||
Maximum allowed value.
|
Maximum allowed value.
|
||||||
This is useful if sounds gets to loud. Anything higher will be
|
This is useful if sounds gets to loud. Anything higher will be
|
||||||
truncated to this value.
|
truncated to this value.
|
||||||
|
|
||||||
<position>
|
<position>
|
||||||
Specify the position of the sounds source relative to the
|
Specify the position of the sounds source relative to the
|
||||||
|
@ -250,19 +255,19 @@ Configuration description:
|
||||||
This can be useful for limiting cockpit sounds to the cockpit.
|
This can be useful for limiting cockpit sounds to the cockpit.
|
||||||
|
|
||||||
|
|
||||||
Creating a configration file:
|
Creating a configuration file:
|
||||||
----------------------------
|
------------------------------
|
||||||
|
|
||||||
To make things easy, there is a default value for most entries to allow a
|
To make things easy, there is a default value for most entries to allow a
|
||||||
sane configuration when a certain entry is omitted.
|
sane configuration when a certain entry is omitted.
|
||||||
|
|
||||||
Default values are:
|
Default values are:
|
||||||
|
|
||||||
type: lin
|
type: lin
|
||||||
factor: 1.0
|
factor: 1.0
|
||||||
offset: 0.0 for volume, 1.0 for pitch
|
offset: 0.0 for volume, 1.0 for pitch
|
||||||
min: 0.0
|
min: 0.0
|
||||||
max: 0.0 (don't check)
|
max: 0.0 (don't check)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -274,12 +279,12 @@ Calculations are made the following way (for both pitch and volume):
|
||||||
for (n = 0; n < max; n++) {
|
for (n = 0; n < max; n++) {
|
||||||
if (factor < 0)
|
if (factor < 0)
|
||||||
{
|
{
|
||||||
value += offset[n] - abs(factor[n]) * function(property[n]);
|
value += offset[n] - abs(factor[n]) * function(property[n]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
value += factor[n] * function(property[n]);
|
value += factor[n] * function(property[n]);
|
||||||
offs += offset[n];
|
offs += offset[n];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue