7.28. SetSoundAttributeValue

set_sound_attribute_value ‐ Dynamic modification of the sound properties

7.28.1. Attributes

NameTypeDefaults
operatorSTRINGNone (required)

7.28.2. Description

This action is used to modify the values associated with attributes in a sound property. If the attribute values contain parenthesized expressions, they are dynamically evaluated as numerical expressions and their values are replaced in the attribute value strings. The string value of the operator attribute is an operator string. The values of the operator must be "=", "=", "+=", "-=", "*=", or "/=". The child node is a sound element that contains at least one attribute and its associated value.

The attributes of the child node are called source attributes. The target node must have sound properties. In this case, the values of the source attributes are used to modify the values of the corresponding attributes in the target sound properties.

For instance if the source element has attributes begin and end that define the begin and end time of sound playing, and if the operator is "=", the source values define the begin and end time of the target sound property. The other operators respectively correspond to addition, substraction, multiplication, and division of the target values by the source values. The attributes of the target element that are not instantiated in the source sound element (the child node) are not modified by this action.

7.28.3. Expected children

The following element must occur in set_sound_attribute_value: one sound property element.

7.28.4. Expected target

The target node must have sound properties.

7.28.5. Example

The example below defines an action that starts immediately the playing of the sound file associated with a sound property and stops it after 10 time units.

<set_sound_attribute_value operator="="> 
  <sound  begin="now" end="(now + 10)" /> 
</set_sound_attribute_value>