Packagecom.yoambulante.midifiles
Classpublic class SamplerKey
InheritanceSamplerKey Inheritance Object

This class uses a waveform (samples) and change its pitch using hermite interpolation for generating different musical notes tones.



Public Properties
 PropertyDefined By
  isPressed : Boolean
[read-only]
SamplerKey
  lastSample : Point
[read-only]
SamplerKey
  midiNote : int
[read-only]
SamplerKey
  noteFactor : int
[read-only]
SamplerKey
  noteIndex : int
[read-only]
SamplerKey
  playing : Boolean
[read-only] It is true whenever the sampler key is generating audio, normally it generates some samples more even after you call the releaseKey method.
SamplerKey
Public Methods
 MethodDefined By
  
SamplerKey(ext:SamplesExtractor, key:int, midi_key:int)
SamplerKey
  
getSample():Point
SamplerKey
  
pressKey(velocity:uint):void
SamplerKey
  
releaseKey():void
SamplerKey
Property Detail
isPressedproperty
isPressed:Boolean  [read-only]


Implementation
    public function get isPressed():Boolean
lastSampleproperty 
lastSample:Point  [read-only]


Implementation
    public function get lastSample():Point
midiNoteproperty 
midiNote:int  [read-only]


Implementation
    public function get midiNote():int
noteFactorproperty 
noteFactor:int  [read-only]


Implementation
    public function get noteFactor():int
noteIndexproperty 
noteIndex:int  [read-only]


Implementation
    public function get noteIndex():int
playingproperty 
playing:Boolean  [read-only]

It is true whenever the sampler key is generating audio, normally it generates some samples more even after you call the releaseKey method. False when it is completely in silence, note getSample() also may return null.


Implementation
    public function get playing():Boolean
Constructor Detail
SamplerKey()Constructor
public function SamplerKey(ext:SamplesExtractor, key:int, midi_key:int)

Parameters
ext:SamplesExtractor — SamplesExtractor which has already extracted all samples from waveform (Sound file based on a waveform A440 frequency)
 
key:int — Key-note representation in the Keyboard
 
midi_key:int — Key-note representation in the Keyboard related to MIDI protocol
Method Detail
getSample()method
public function getSample():Point

Returns
Point
pressKey()method 
public function pressKey(velocity:uint):void

Parameters

velocity:uint

releaseKey()method 
public function releaseKey():void