Packageorg.si.sion.sequencer
Classpublic class SiMMLSequencer
InheritanceSiMMLSequencer Inheritance MMLSequencer Inheritance Object

The SiMMLSequencer operates SiOPMModule by MML. SiMMLSequencer -> SiMMLTrack -> SiOPMChannelFM -> SiOPMOperator. (-> means "operates")



Public Properties
 PropertyDefined By
  callbackOnParsingSystemCommand : Function
[write-only] function called back when parse system command.
SiMMLSequencer
  currentTrack : SiMMLTrack
[read-only] Current working track
SiMMLSequencer
  isEnableChangeBPM : Boolean
[read-only] Is enable to change BPM ?
SiMMLSequencer
  isFinished : Boolean
[read-only] Is finish buffering ?
SiMMLSequencer
  isReadyToProcess : Boolean
[read-only] Is ready to process ?
SiMMLSequencer
  isSequenceFinished : Boolean
[read-only] Is finish executing sequence ?
SiMMLSequencer
  processedSampleCount : int
[read-only] Processed sample count
SiMMLSequencer
 InheritedsampleRate : int
Audio setting, sampling ratio.
MMLSequencer
 Inheritedsetting : MMLParserSetting
MML parser setting.
MMLSequencer
  streamWritingBeat : int
[read-only] current writing position (16beat count) in streaming buffer
SiMMLSequencer
  streamWritingPositionResidue : int
[read-only] current writing position in streaming buffer, always less than length of streaming buffer
SiMMLSequencer
  title : String
[read-only] Song title
SiMMLSequencer
  tracks : Vector.<SiMMLTrack>
SiMMLTrack list
SiMMLSequencer
Public Methods
 MethodDefined By
  
SiMMLSequencer(module:SiOPMModule, eventTriggerOn:Function, eventTriggerOff:Function, tempoChanged:Function)
Create new sequencer.
SiMMLSequencer
  
calcSampleDelay(sampleOffset:int = 0, beat16Offset:Number = 0, quant:Number = 0):Number
calculate delay (in sample count) quantized by beat.
SiMMLSequencer
  
calcSampleLength(beat16:Number):Number
calculate length (in sample count).
SiMMLSequencer
 Inherited
compile(interval:int = 1000):Number
Parse mml string.
MMLSequencer
  
dummyProcess(sampleCount:int):void
Dummy process.
SiMMLSequencer
 Inherited
getEventID(mmlCommand:String):int
Get MMLEvent id by mml command letter.
MMLSequencer
 Inherited
getEventLetter(eventID:int):String
Get MML command letters by event id.
MMLSequencer
  
prepareCompile(data:MMLData, mml:String):Boolean
[override] Prepare to compile mml string.
SiMMLSequencer
 Inherited
Set global sequence.
MMLSequencer
Protected Methods
 MethodDefined By
 Inherited
default operation for MMLEvent.GLOBAL_WAIT.
MMLSequencer
 Inherited
default operation for MMLEvent.INTERNAL_CALL.
MMLSequencer
 Inherited
default operation for MMLEvent.INTERNAL_WAIT.
MMLSequencer
 Inherited
default operation for MMLEvent.NOP.
MMLSequencer
 Inherited
default operation for MMLEvent.PROCESS.
MMLSequencer
 Inherited
default operation for MMLEvent.REPEAT_ALL.
MMLSequencer
 Inherited
default operation for MMLEvent.REPEAT_BEGIN.
MMLSequencer
 Inherited
default operation for MMLEvent.REPEAT_BREAK.
MMLSequencer
 Inherited
default operation for MMLEvent.REPEAT_END.
MMLSequencer
 Inherited
default operation for MMLEvent.SEQUENCE_TAIL.
MMLSequencer
 Inherited
default operation for MMLEvent.TEMPO.
MMLSequencer
 Inherited
default operation for MMLEvent.TIMER.
MMLSequencer
 Inherited
dummy operation for MMLEvent.PROCESS.
MMLSequencer
 Inherited
Operates nothing.
MMLSequencer
 Inherited
execute global sequence.
MMLSequencer
 Inherited
check global sequences pointer acheives to the end.
MMLSequencer
 Inherited
newMMLEventListener(letter:String, func:Function, isGlobal:Boolean = false):int
Register new MMLEvent letter.
MMLSequencer
 Inherited
Callback after parse.
MMLSequencer
 Inherited
onBeat(delaySamples:int, beatCounter:int):void
Callback on every 16th beats.
MMLSequencer
 Inherited
onBeforeCompile(mml:String):String
Callback before parse.
MMLSequencer
 Inherited
onProcess(length:int, e:MMLEvent):void
Callback on processing.
MMLSequencer
 Inherited
onTableParse(prev:MMLEvent, table:String):void
Callback when table event was found.
MMLSequencer
 Inherited
onTempoChanged(tempoRatio:Number):void
Callback when the tempo is changed.
MMLSequencer
 Inherited
Callback when streaming interrupted by timer .
MMLSequencer
 Inherited
processMMLExecutor(exe:MMLExecutor, bufferSampleCount:int):Boolean
Processing audio by one executor.
MMLSequencer
 Inherited
setMMLEventListener(id:int, func:Function, isGlobal:Boolean = false):void
Similar with an addEventListener(), but only one listener can be set for one event.
MMLSequencer
 Inherited
start global sequence.
MMLSequencer
Public Constants
 ConstantDefined By
 InheritedFIXED_BITS : int = 8
[static] bits for fixed decimal
MMLSequencer
 InheritedFIXED_FILTER : int
[static] filter for decimal fraction area
MMLSequencer
Property Detail
callbackOnParsingSystemCommandproperty
callbackOnParsingSystemCommand:Function  [write-only]

function called back when parse system command. The function type is function(data:SiMMLData, command: : Boolean. Return false to append the command to SiONData.systemCommands.


Implementation
    public function set callbackOnParsingSystemCommand(value:Function):void
currentTrackproperty 
currentTrack:SiMMLTrack  [read-only]

Current working track


Implementation
    public function get currentTrack():SiMMLTrack
isEnableChangeBPMproperty 
isEnableChangeBPM:Boolean  [read-only]

Is enable to change BPM ?


Implementation
    public function get isEnableChangeBPM():Boolean
isFinishedproperty 
isFinished:Boolean  [read-only]

Is finish buffering ?


Implementation
    public function get isFinished():Boolean
isReadyToProcessproperty 
isReadyToProcess:Boolean  [read-only]

Is ready to process ?


Implementation
    public function get isReadyToProcess():Boolean
isSequenceFinishedproperty 
isSequenceFinished:Boolean  [read-only]

Is finish executing sequence ?


Implementation
    public function get isSequenceFinished():Boolean
processedSampleCountproperty 
processedSampleCount:int  [read-only]

Processed sample count


Implementation
    public function get processedSampleCount():int
streamWritingBeatproperty 
streamWritingBeat:int  [read-only]

current writing position (16beat count) in streaming buffer


Implementation
    public function get streamWritingBeat():int
streamWritingPositionResidueproperty 
streamWritingPositionResidue:int  [read-only]

current writing position in streaming buffer, always less than length of streaming buffer


Implementation
    public function get streamWritingPositionResidue():int
titleproperty 
title:String  [read-only]

Song title


Implementation
    public function get title():String
tracksproperty 
public var tracks:Vector.<SiMMLTrack>

SiMMLTrack list

Constructor Detail
SiMMLSequencer()Constructor
public function SiMMLSequencer(module:SiOPMModule, eventTriggerOn:Function, eventTriggerOff:Function, tempoChanged:Function)

Create new sequencer.

Parameters
module:SiOPMModule
 
eventTriggerOn:Function
 
eventTriggerOff:Function
 
tempoChanged:Function
Method Detail
_setBeatCallbackFilter()method
_sion_internal function _setBeatCallbackFilter(filter:int):void

SiONTrackEvent.BEAT is called if (beatCount16th & onBeatCallbackFilter) == 0.

Parameters

filter:int

calcSampleDelay()method 
public function calcSampleDelay(sampleOffset:int = 0, beat16Offset:Number = 0, quant:Number = 0):Number

calculate delay (in sample count) quantized by beat.

Parameters

sampleOffset:int (default = 0) — Offset in sample count.
 
beat16Offset:Number (default = 0) — Offset in 16th beat.
 
quant:Number (default = 0) — Quantizing beat in 16th. The 0 sets no quantization, 1 sets quantization by 16th, 4 sets quantization by 4th beat.

Returns
Number
calcSampleLength()method 
public function calcSampleLength(beat16:Number):Number

calculate length (in sample count).

Parameters

beat16:Number — The beat number in 16th calculating from.

Returns
Number
dummyProcess()method 
public function dummyProcess(sampleCount:int):void

Dummy process. This funciton must be called after prepareProcess().

Parameters

sampleCount:int — dumming sample count. [NOTICE] This value is rounded by a buffer length. Not an exact value.

prepareCompile()method 
override public function prepareCompile(data:MMLData, mml:String):Boolean

Prepare to compile mml string. Calls onBeforeCompile() inside.

Parameters

data:MMLData — Data instance.
 
mml:String — MML String.

Returns
Boolean — Returns false when it's not necessary to compile.