Packagecom.noteflight.standingwave2.filters
Classpublic class EnvelopeFilter
InheritanceEnvelopeFilter Inheritance AbstractFilter Inheritance Object

EnvelopeFilter applies a so-called ADSR (attack/decay/sustain/release) amplitude envelope to its underlying source, to provide a shape to a sound source that typically has no amplitude envelope.



Public Properties
 PropertyDefined By
  attack : Number
The duration of the attack envelope in frames.
EnvelopeFilter
  decay : Number
The duration of the decay envelope in frames.
EnvelopeFilter
 Inheriteddescriptor : AudioDescriptor
[read-only] The AudioDescriptor describing the audio characteristics of this source.
AbstractFilter
  frameCount : Number
[override] [read-only] Return the length of this source, which is in effect gated by the overall length of the envelope.
EnvelopeFilter
  hold : Number
The duration of the hold phase of the element in frames.
EnvelopeFilter
 Inheritedposition : Number
[read-only] The position of the audio cursor in this source, as a frame index.
AbstractFilter
  release : Number
The release duration for the envelope, in frames.
EnvelopeFilter
 Inheritedsource : IAudioSource
The underlying audio source for this filter.
AbstractFilter
  sustain : Number
The sustain level of the envelope, expressed as a multiplying factor.
EnvelopeFilter
Protected Properties
 PropertyDefined By
 Inherited_source : IAudioSource
The underlying source that acts as input to this filter.
AbstractFilter
Public Methods
 MethodDefined By
  
EnvelopeFilter(source:IAudioSource, attackTime:Number, decayTime:Number, sustain:Number, holdTime:Number, releaseTime:Number)
Create a new EnvelopeFilter.
EnvelopeFilter
  
[override]
EnvelopeFilter
  
getSample(numFrames:Number):Sample
[override]
EnvelopeFilter
  
[override]
EnvelopeFilter
Protected Methods
 MethodDefined By
 Inherited
transformChannel(data:Vector.<Number>, channel:Number, start:Number, numFrames:Number):void
Transform the data for a channel by modifying it in place; called by the default implementation of getSample().
AbstractFilter
Property Detail
attackproperty
public var attack:Number

The duration of the attack envelope in frames.

decayproperty 
public var decay:Number

The duration of the decay envelope in frames.

frameCountproperty 
frameCount:Number  [read-only] [override]

Return the length of this source, which is in effect gated by the overall length of the envelope.


Implementation
    public function get frameCount():Number
holdproperty 
public var hold:Number

The duration of the hold phase of the element in frames.

releaseproperty 
public var release:Number

The release duration for the envelope, in frames.

sustainproperty 
public var sustain:Number

The sustain level of the envelope, expressed as a multiplying factor.

Constructor Detail
EnvelopeFilter()Constructor
public function EnvelopeFilter(source:IAudioSource, attackTime:Number, decayTime:Number, sustain:Number, holdTime:Number, releaseTime:Number)

Create a new EnvelopeFilter.

Parameters
source:IAudioSource — the underlying audio source
 
attackTime:Number — the time of the attack phase of the envelope, during which it rises linearly from zero to unity (if decayTime is nonzero) or to the sustain level (if decayTime is zero).
 
decayTime:Number — the time of the decay phase of the envelope, during which it decays exponentially from unity to the sustain level.
 
sustain:Number — the gain factor for the sustain level.
 
holdTime:Number — the time for which the sustain level is maintained
 
releaseTime:Number — the time of the release phase, during which the envelope decays exponentially from the sustain level to a near-zero factor.
Method Detail
clone()method
override public function clone():IAudioSource

Returns
IAudioSource
getSample()method 
override public function getSample(numFrames:Number):Sample

Parameters

numFrames:Number

Returns
Sample
resetPosition()method 
override public function resetPosition():void