Adding Sounds II

Revision as of 15:38, 29 January 2008 by Paradox (Talk | contribs) (Adding Sound II moved to Adding Sounds II)

Fading your Sound

Plasma supports FadeIn and FadeOut properties on sound objects. These can make a sound fade gradually. The properties are set in AlcScript on the Sound Emitter object.

        fadein:
            length: 
            start: <starting volume>
            end: <ending volume>
            type: <fade type>
            stop: <stop when finished fading>

The fadeout params are identical, but defined under fadeout rather than fadein.

Length

Length controls how long it takes for the sound to fade in or out. This is a decimal value in number of seconds.

Start

Starting volume defines the percentage of the volume (as a decimal) to use when fading. For fading in, this value should be 0.0. For fading out, this value should be 1.0.

End

The final volume of the sound at the end of the effect, expressed as a decimal percentage. For fading in, this value should be 1.0. For fading out, this value should be 0.0.

Type

Plasma supports three types of fading, these are mathematical equations used internally to produce the fading effect. The three options are

linear        #Default fade type
logarithmic   #Fade using logarithms, best for fading in
exponential   #Fade using exponents, best for fading out

The fade type is defined as a string of text in AlcScript, using the type names above.

Stop

A boolean value determining whether to stop playing the sound when the effect finishes. This should be set for fadeout effects.

Making your Sound 3D

3D sounds are setup the same way as other sounds, but include two new params in AlcScript and an additional flag.

        flags: 3d|<other flags>
        minfdist: <minimum distance>
        maxfdist: <maximum distance>

Minfdist

This value is the distance before the sound starts to fade out. Keep in mind that this value is in Blender units, and should be quite large.

Maxfdist

This value is the distance at which the sound can no longer be heard. Keep in mind that this value is in Blender units, and should be quite large.

Controlling your Sound with Regions

(To be continued)