Packagecom.noteflight.standingwave3.generators
Classpublic class AbstractGenerator
InheritanceAbstractGenerator Inheritance Object
Implements IDirectAccessSource, IRandomAccessSource
Subclasses ADSREnvelopeGenerator, FadeEnvelopeGenerator

AbstractGenerator is an implementation superclass for generator implementations. A Generator implements both IRandomAccessSource and IDirectAccessSource. It is intended to create functions that are "generated" once, and reused many times across different sources and filters. They can be generated bit by bit as needed, or all in one go.



Public Properties
 PropertyDefined By
  descriptor : AudioDescriptor
[read-only]
AbstractGenerator
  duration : Number
[read-only]
AbstractGenerator
  frameCount : Number
[read-only]
AbstractGenerator
  position : Number
[read-only] Position indicates the position that it's been generated to.
AbstractGenerator
Protected Properties
 PropertyDefined By
  _position : Number
The next position to keep generating at
AbstractGenerator
  _sample : Sample
The sample data to which we generate a function
AbstractGenerator
Public Methods
 MethodDefined By
  
AbstractGenerator(descriptor:AudioDescriptor, duration:Number)
AbstractGenerator
  
destroy():void
Destroy the generator when it is no longer needed, to free sample memory
AbstractGenerator
  
fill(toOffset:Number = -1):void
This abstract class assumes you will override generateChannel() and write the sample through a channelData Vector.
AbstractGenerator
  
getSamplePointer(offset:Number = 0):uint
AbstractGenerator
  
getSampleRange(fromOffset:Number, toOffset:Number):Sample
AbstractGenerator
  
useSample(frames:Number):void
AbstractGenerator
Protected Methods
 MethodDefined By
  
generateChannel(data:Vector.<Number>, channel:int, numFrames:Number):void
AbstractGenerator
  
generateExponentialTable(table:Sample, minimum:Number, maximum:Number):void
[static] Generates an exponential curve from minimum to maximum into the Sample provided
AbstractGenerator
  
generateLinearTable(table:Sample, minimum:Number, maximum:Number):void
[static] Generates a linear function from minimum to maximum into the Sample provided
AbstractGenerator
Property Detail
_positionproperty
protected var _position:Number

The next position to keep generating at

_sampleproperty 
protected var _sample:Sample

The sample data to which we generate a function

descriptorproperty 
descriptor:AudioDescriptor  [read-only]


Implementation
    public function get descriptor():AudioDescriptor
durationproperty 
duration:Number  [read-only]


Implementation
    public function get duration():Number
frameCountproperty 
frameCount:Number  [read-only]


Implementation
    public function get frameCount():Number
positionproperty 
position:Number  [read-only]

Position indicates the position that it's been generated to.


Implementation
    public function get position():Number
Constructor Detail
AbstractGenerator()Constructor
public function AbstractGenerator(descriptor:AudioDescriptor, duration:Number)



Parameters
descriptor:AudioDescriptor
 
duration:Number
Method Detail
destroy()method
public function destroy():void

Destroy the generator when it is no longer needed, to free sample memory

fill()method 
public function fill(toOffset:Number = -1):void

This abstract class assumes you will override generateChannel() and write the sample through a channelData Vector. If you would prefer to generate directly into sample data in your own potentially faster way, override fill() instead.

Parameters

toOffset:Number (default = -1)

generateChannel()method 
protected function generateChannel(data:Vector.<Number>, channel:int, numFrames:Number):void

Parameters

data:Vector.<Number>
 
channel:int
 
numFrames:Number

generateExponentialTable()method 
protected static function generateExponentialTable(table:Sample, minimum:Number, maximum:Number):void

Generates an exponential curve from minimum to maximum into the Sample provided

Parameters

table:Sample
 
minimum:Number
 
maximum:Number

generateLinearTable()method 
protected static function generateLinearTable(table:Sample, minimum:Number, maximum:Number):void

Generates a linear function from minimum to maximum into the Sample provided

Parameters

table:Sample
 
minimum:Number
 
maximum:Number

getSamplePointer()method 
public function getSamplePointer(offset:Number = 0):uint

Parameters

offset:Number (default = 0)

Returns
uint
getSampleRange()method 
public function getSampleRange(fromOffset:Number, toOffset:Number):Sample

Parameters

fromOffset:Number
 
toOffset:Number

Returns
Sample
useSample()method 
public function useSample(frames:Number):void

Parameters

frames:Number