Packageorg.si.sound
Classpublic class PatternSequencer
InheritancePatternSequencer Inheritance SoundObject Inheritance flash.events.EventDispatcher
Subclasses Arpeggiator, BassSequencer, FlashSoundPlayer, MonophonicSynthesizer

Pattern sequencer class provides simple one track pattern player. The sequence pattern is represented as Vector.<Note>.

View the examples

See also

org.si.sound.patterns.Note


Public Properties
 PropertyDefined By
 InheritedcoarseTune : int
Master coarse tuning, 1 for half-tone.
SoundObject
 Inheriteddelay : Number
Sound delay, uint in 16th beat.
SoundObject
 Inheriteddriver : SiONDriver
[read-only] SiONDriver instrance to operate.
SoundObject
 Inheritedeffectors : Array
Array of SiEffectBase to modify this sound object's output.
SoundObject
 InheritedeffectSend1 : Number
Channel effect send level for slot 1 (0:Minimum - 1:Maximum), this property can control track after play().
SoundObject
 InheritedeffectSend2 : Number
Channel effect send level for slot 2 (0:Minimum - 1:Maximum), this property can control track after play().
SoundObject
 InheritedeffectSend3 : Number
Channel effect send level for slot 3 (0:Minimum - 1:Maximum), this property can control track after play().
SoundObject
 InheritedeffectSend4 : Number
Channel effect send level for slot 4 (0:Minimum - 1:Maximum), this property can control track after play().
SoundObject
 InheritedeventMask : int
Track event mask.
SoundObject
 InheritedeventTriggerID : int
Track event trigger ID
SoundObject
 InheritedfineTune : Number
Master fine tuning, 1 for half-tone, you can specify fineTune<-1 or fineTune>1.
SoundObject
  gateTime : Number
[override] current length in the sequence, you cannot change this property.
PatternSequencer
 InheritedisPlaying : Boolean
[read-only] is playing ?
SoundObject
  length : Number
[override] current length in the sequence, you cannot change this property.
PatternSequencer
 Inheritedmute : Boolean
Channel mute, this property can control track after play().
SoundObject
 Inheritedname : String
Name.
SoundObject
  note : int
[override] current note in the sequence, you cannot change this property.
PatternSequencer
 InheritednoteOffTriggerType : int
[read-only] Track note off trigger type
SoundObject
 InheritednoteOnTriggerType : int
[read-only] Track note on trigger type
SoundObject
  onEnterFrame : Function
callback on enter frame
PatternSequencer
  onEnterSegment : Function
callback on enter segment
PatternSequencer
  onExitFrame : Function
callback on exit frame
PatternSequencer
 Inheritedpan : Number
Channel panning (-1:Left - 0:Center - +1:Right), this property can control track after play().
SoundObject
 Inheritedparent : SoundObjectContainer
[read-only] parent container.
SoundObject
 InheritedpitchBend : Number
Channel pitch bend, 1 for halftone, this property can control track after play().
SoundObject
  portament : int
portament
PatternSequencer
 Inheritedquantize : Number
Synchronizing quantizing, uint in 16th beat.
SoundObject
  sequencer : Sequencer
[read-only] the Sequencer instance belonging to this PatternSequencer, where the sequence pattern appears.
PatternSequencer
 Inheritedsynthesizer : VoiceReference
Synthesizer to generate sound
SoundObject
 InheritedtrackID : int
[read-only] Track id
SoundObject
 Inheritedvoice : SiONVoice
Voice data to play
SoundObject
 Inheritedvolume : Number
Channel volume (0:Minimum - 1:Maximum), this property can control track after play().
SoundObject
Public Methods
 MethodDefined By
  
PatternSequencer(defaultNote:int = 60, defaultVelocity:int = 128, defaultLength:Number = 0, synth:VoiceReference = null)
constructor
PatternSequencer
 Inherited
fadeIn(time:Number):void
Set fading in.
SoundObject
 Inherited
fadeOut(time:Number):void
Set fading out.
SoundObject
  
play():void
[override] start sequence
PatternSequencer
 Inherited
reset():void
Reset
SoundObject
 Inherited
setVolume(slot:int, volume:Number):void
Set volume by index.
SoundObject
  
stop():void
[override] stop sequence
PatternSequencer
Events
 Event Summary Defined By
 Inherited Dispatch when the sound ends.SoundObject
 Inherited Dispatch when the note off appears in the sequence.SoundObject
 Inherited Dispatch when the sound starts.SoundObject
 Inherited Dispatch when the note on appears.SoundObject
Property Detail
gateTimeproperty
gateTime:Number[override]

current length in the sequence, you cannot change this property.


Implementation
    public function get gateTime():Number
    public function set gateTime(value:Number):void
lengthproperty 
length:Number[override]

current length in the sequence, you cannot change this property.


Implementation
    public function get length():Number
    public function set length(value:Number):void
noteproperty 
note:int[override]

current note in the sequence, you cannot change this property.


Implementation
    public function get note():int
    public function set note(value:int):void
onEnterFrameproperty 
onEnterFrame:Function

callback on enter frame


Implementation
    public function get onEnterFrame():Function
    public function set onEnterFrame(value:Function):void
onEnterSegmentproperty 
onEnterSegment:Function

callback on enter segment


Implementation
    public function get onEnterSegment():Function
    public function set onEnterSegment(value:Function):void
onExitFrameproperty 
onExitFrame:Function

callback on exit frame


Implementation
    public function get onExitFrame():Function
    public function set onExitFrame(value:Function):void
portamentproperty 
portament:int

portament


Implementation
    public function get portament():int
    public function set portament(value:int):void
sequencerproperty 
sequencer:Sequencer  [read-only]

the Sequencer instance belonging to this PatternSequencer, where the sequence pattern appears.


Implementation
    public function get sequencer():Sequencer
Constructor Detail
PatternSequencer()Constructor
public function PatternSequencer(defaultNote:int = 60, defaultVelocity:int = 128, defaultLength:Number = 0, synth:VoiceReference = null)

constructor

Parameters
defaultNote:int (default = 60) — Default note, this value is referenced when Note.note property is -1.
 
defaultVelocity:int (default = 128) — Default velocity, this value is referenced when Note.velocity property is -1.
 
defaultLength:Number (default = 0) — Default length, this value is referenced when Note.length property is Number.NaN.
 
synth:VoiceReference (default = null) — synthesizer to play
Method Detail
play()method
override public function play():void

start sequence

stop()method 
override public function stop():void

stop sequence

Examples
Simple usage
// create new instance
var ps:PatternSequencer = new PatternSequencer();
    
// set sequence pattern by Note vector
var pat:Vector.<Note> = new Vector.<Note>();
pat.push(new Note(60, 64, 1));  // note C
pat.push(new Note(62, 64, 1));  // note D
pat.push(new Note(64, 64, 2));  // note E with length of 2
pat.push(null);                 // rest; null means no operation
pat.push(new Note(62, 64, 2));  // note D with length of 2
pat.push(new Note().setRest()); // rest; Note.setRest() method set no operation

// PatternSequencer.sequencer is the sound player
ps.sequencer.pattern = pat;
    
// play sequence "l16 $cde8d8" in MML
ps.play();