Packageorg.si.sion.sequencer
Classpublic class SiMMLTrack
InheritanceSiMMLTrack Inheritance Object

Track is a musical sequence player for one voice.



Public Properties
 PropertyDefined By
  _callbackUpdateRegister : Function
SiMMLTrack
  channel : SiOPMChannelBase
Sound module's channel controlled by this track.
SiMMLTrack
  channelNumber : int
[read-only] Channel number, set by 2nd argument of % command.
SiMMLTrack
  effectSend1 : int
effect send level for slot1 (0-128).
SiMMLTrack
  effectSend2 : int
effect send level for slot2 (0-128).
SiMMLTrack
  effectSend3 : int
effect send level for slot3 (0-128).
SiMMLTrack
  effectSend4 : int
effect send level for slot4 (0-128).
SiMMLTrack
  eventMask : int = 0
Event mask, set by @mask command.
SiMMLTrack
  eventTriggerID : int
[read-only] event trigger ID.
SiMMLTrack
  eventTriggerTypeOff : int
[read-only] Note off event trigger type.
SiMMLTrack
  eventTriggerTypeOn : int
[read-only] Note on event trigger type.
SiMMLTrack
  executor : MMLExecutor
MML sequence executor
SiMMLTrack
  expression : int
expression(0-128).
SiMMLTrack
  expressionMode : int
expression table mode
SiMMLTrack
  isActive : Boolean
[read-only] Is activate ? This function always returns true from not-disposable track.
SiMMLTrack
  isDisposable : Boolean
[read-only] Is this track disposable ? Disposable track will free automatically when finished rendering.
SiMMLTrack
  isFinished : Boolean
[read-only] Is finish to rendering ?
SiMMLTrack
  isPlaySequence : Boolean
[read-only] Is playing sequence ?
SiMMLTrack
  keyOnDelay : int = 0
key on delay, set by 2nd argument of @q command.
SiMMLTrack
  masterVolume : int
master volume(0-128).
SiMMLTrack
  mmlData : SiMMLData
[read-only] mml data to play.
SiMMLTrack
  mute : Boolean
mute
SiMMLTrack
  note : int
[read-only] Note number
SiMMLTrack
  noteShift : int = 0
note shift, set by kt command.
SiMMLTrack
  onUpdateRegister : Function
callback function when update register event appears.
SiMMLTrack
  outputLevel : Number
[read-only] output level = @v v x.
SiMMLTrack
  pan : int
pannning (-64 - +64)
SiMMLTrack
  pitchBend : int
pitch bend
SiMMLTrack
  pitchShift : int = 0
detune, set by k command.
SiMMLTrack
  programNumber : int
[read-only] Program number, set by 2nd argument of % command and 1st arg.
SiMMLTrack
  quantCount : int = 0
quantize count, set by @q command.
SiMMLTrack
  quantRatio : Number = 0
quantize ratio, set by q command, the value is between 0-1.
SiMMLTrack
  trackID : int
[read-only] track ID, this value is specifyed by user.
SiMMLTrack
  trackNumber : int
[read-only] track number, this value is unique and set by system, the lower numbered track processes sound first.
SiMMLTrack
  trackStartDelay : int
[read-only] Start delay in sample count.
SiMMLTrack
  trackStopDelay : int
[read-only] Stop delay in sample count.
SiMMLTrack
  trackTypeID : int
[read-only] track type, this value shows what this track starts by.
SiMMLTrack
  velocity : int
velocity(0-256).
SiMMLTrack
  velocityMode : int
velocity table mode
SiMMLTrack
Public Methods
 MethodDefined By
  
SiMMLTrack
  
SiMMLTrack
  
dispatchEventTrigger(noteOn:Boolean):Boolean
dispatch EventTrigger
SiMMLTrack
  
dispatchNoteOnEvent(id:int, noteOnType:int = 1):void
dispatch note on event once (%e)
SiMMLTrack
  
keyOff(sampleDelay:int = 0, stopWithReset:Boolean = false):SiMMLTrack
Force key off.
SiMMLTrack
  
keyOn(note:int, tickLength:int = 0, sampleDelay:int = 0):SiMMLTrack
key on.
SiMMLTrack
  
limitLength(stopDelay:int):void
Limit key on length.
SiMMLTrack
  
sequenceOff(sampleDelay:int = 0, stopWithReset:Boolean = false):SiMMLTrack
Force stop sequence.
SiMMLTrack
  
sequenceOn(seq:MMLSequence, sampleLength:int = 0, sampleDelay:int = 0):SiMMLTrack
Play sequence.
SiMMLTrack
  
setAmplitudeEnvelop(noteOn:int, table:SiMMLEnvelopTable, step:int, offset:Boolean = false):void
set amplitude envelop (na, _na)
SiMMLTrack
  
setChannelModuleType(type:int, channelNum:int, toneNum:int):void
Channel module type (%) and select tone (1st argument of '_@').
SiMMLTrack
  
Set this track disposable.
SiMMLTrack
  
setEnvelopFPS(fps:int):void
set envelop step (@fps)
SiMMLTrack
  
setEventTrigger(id:int, noteOnType:int = 1, noteOffType:int = 0):void
set event trigger (%t)
SiMMLTrack
  
setFilterEnvelop(noteOn:int, table:SiMMLEnvelopTable, step:int):void
set filter envelop (nf, _nf)
SiMMLTrack
  
setModulationEnvelop(isPitchMod:Boolean, depth:int, end_depth:int, delay:int, term:int):void
amplitude/pitch modulation envelop (ma, mp)
SiMMLTrack
  
setNote(note:int, sampleLength:int, slur:Boolean = false):void
Set note immediately.
SiMMLTrack
  
setNoteEnvelop(noteOn:int, table:SiMMLEnvelopTable, step:int):void
set note envelop (nt, _nt)
SiMMLTrack
  
setPitchBend(noteFrom:int, tickLength:int):void
Set pitch bending.
SiMMLTrack
  
setPitchEnvelop(noteOn:int, table:SiMMLEnvelopTable, step:int):void
set pitch envelop (np, _np)
SiMMLTrack
  
setPortament(frame:int):void
portament (po).
SiMMLTrack
  
setReleaseSweep(sweep:int):void
release sweep (2nd argument of "s")
SiMMLTrack
  
setToneEnvelop(noteOn:int, table:SiMMLEnvelopTable, step:int):void
set tone envelop (@@, _@@)
SiMMLTrack
  
setTrackCallback(noteOn:Function = null, noteOff:Function = null):SiMMLTrack
Set track callback function.
SiMMLTrack
Public Constants
 ConstantDefined By
  DRIVER_BACKGROUND : int = 0x50000
[static] Track Type ID for SiONDriver's background sound tracks
SiMMLTrack
  DRIVER_NOTE : int = 0x30000
[static] Track Type ID for tracks created by SiONDriver.noteOn() or SiONDriver.playSound()
SiMMLTrack
  DRIVER_SEQUENCE : int = 0x40000
[static] Track Type ID for tracks created by SiONDriver.sequenceOn()
SiMMLTrack
  MASK_ENVELOP : int = 16
[static] mask all table envelop commands (@@,na,np,nt,nf,_@@,_na,_np,_nt,_nf)
SiMMLTrack
  MASK_MODULATE : int = 32
[static] mask all modulation commands (ma,mp)
SiMMLTrack
  MASK_OPERATOR : int = 8
[static] mask all operator setting commands (s,@al,@fb,i,@,@rr,@tl,@ml,@st,@ph,@fx,@se,@er)
SiMMLTrack
  MASK_PAN : int = 2
[static] mask all panning commands (p,@p)
SiMMLTrack
  MASK_QUANTIZE : int = 4
[static] mask all quantize commands (q,@q)
SiMMLTrack
  MASK_SLUR : int = 64
[static] mask all slur and pitch-bending commands (&,&&,
SiMMLTrack
  MASK_VOLUME : int = 1
[static] mask all volume commands (v,x,@v,"(",")")
SiMMLTrack
  MIDI_TRACK : int = 0x20000
[static] Track Type ID for MIDI tracks
SiMMLTrack
  MML_TRACK : int = 0x10000
[static] Track Type ID for main MML tracks
SiMMLTrack
  NO_MASK : int = 0
[static] no event mask
SiMMLTrack
  USER_CONTROLLED : int = 0x60000
[static] Track Type ID for user controlled tracks
SiMMLTrack
Property Detail
_callbackUpdateRegisterproperty
public var _callbackUpdateRegister:Function

_internalTrackIDproperty 
_sion_sequencer_internal var _internalTrackID:int

_trackNumberproperty 
_sion_sequencer_internal var _trackNumber:int

channelproperty 
public var channel:SiOPMChannelBase

Sound module's channel controlled by this track.

channelNumberproperty 
channelNumber:int  [read-only]

Channel number, set by 2nd argument of % command. Usually same as programNumber (except for APU).


Implementation
    public function get channelNumber():int

See also

programNumber
effectSend1property 
effectSend1:int

effect send level for slot1 (0-128). simple wrapper of channel.setStreamSend.


Implementation
    public function get effectSend1():int
    public function set effectSend1(value:int):void
effectSend2property 
effectSend2:int

effect send level for slot2 (0-128). simple wrapper of channel.setStreamSend.


Implementation
    public function get effectSend2():int
    public function set effectSend2(value:int):void
effectSend3property 
effectSend3:int

effect send level for slot3 (0-128). simple wrapper of channel.setStreamSend.


Implementation
    public function get effectSend3():int
    public function set effectSend3(value:int):void
effectSend4property 
effectSend4:int

effect send level for slot4 (0-128). simple wrapper of channel.setStreamSend.


Implementation
    public function get effectSend4():int
    public function set effectSend4(value:int):void
eventMaskproperty 
public var eventMask:int = 0

Event mask, set by @mask command.

eventTriggerIDproperty 
eventTriggerID:int  [read-only]

event trigger ID. eventTriggerID=-1 means tigger not set.


Implementation
    public function get eventTriggerID():int
eventTriggerTypeOffproperty 
eventTriggerTypeOff:int  [read-only]

Note off event trigger type. eventTriggerTypeOff=0 means tigger not set.


Implementation
    public function get eventTriggerTypeOff():int
eventTriggerTypeOnproperty 
eventTriggerTypeOn:int  [read-only]

Note on event trigger type. eventTriggerTypeOn=0 means tigger not set.


Implementation
    public function get eventTriggerTypeOn():int
executorproperty 
public var executor:MMLExecutor

MML sequence executor

expressionproperty 
expression:int

expression(0-128). linked to operator's total level.


Implementation
    public function get expression():int
    public function set expression(value:int):void
expressionModeproperty 
expressionMode:int

expression table mode


Implementation
    public function get expressionMode():int
    public function set expressionMode(value:int):void
isActiveproperty 
isActive:Boolean  [read-only]

Is activate ? This function always returns true from not-disposable track. (isActive = !isDisposable || !isFinished)


Implementation
    public function get isActive():Boolean
isDisposableproperty 
isDisposable:Boolean  [read-only]

Is this track disposable ? Disposable track will free automatically when finished rendering.


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

Is finish to rendering ?


Implementation
    public function get isFinished():Boolean
isPlaySequenceproperty 
isPlaySequence:Boolean  [read-only]

Is playing sequence ?


Implementation
    public function get isPlaySequence():Boolean
keyOnDelayproperty 
public var keyOnDelay:int = 0

key on delay, set by 2nd argument of @q command.

masterVolumeproperty 
masterVolume:int

master volume(0-128). simple wrapper of channel.masterVolume.


Implementation
    public function get masterVolume():int
    public function set masterVolume(value:int):void
mmlDataproperty 
mmlData:SiMMLData  [read-only]

mml data to play. this value only is available in the track playing mml sequence


Implementation
    public function get mmlData():SiMMLData
muteproperty 
mute:Boolean

mute


Implementation
    public function get mute():Boolean
    public function set mute(value:Boolean):void
noteproperty 
note:int  [read-only]

Note number


Implementation
    public function get note():int
noteShiftproperty 
public var noteShift:int = 0

note shift, set by kt command.

onUpdateRegisterproperty 
onUpdateRegister:Function

callback function when update register event appears.


Implementation
    public function get onUpdateRegister():Function
    public function set onUpdateRegister(value:Function):void
outputLevelproperty 
outputLevel:Number  [read-only]

output level = @v v x.


Implementation
    public function get outputLevel():Number
panproperty 
pan:int

pannning (-64 - +64)


Implementation
    public function get pan():int
    public function set pan(value:int):void
pitchBendproperty 
pitchBend:int

pitch bend


Implementation
    public function get pitchBend():int
    public function set pitchBend(value:int):void
pitchShiftproperty 
public var pitchShift:int = 0

detune, set by k command.

programNumberproperty 
programNumber:int  [read-only]

Program number, set by 2nd argument of % command and 1st arg. of @ command. Usually same as channelNumber (except for APU).


Implementation
    public function get programNumber():int

See also

channelNumber
quantCountproperty 
public var quantCount:int = 0

quantize count, set by @q command.

quantRatioproperty 
public var quantRatio:Number = 0

quantize ratio, set by q command, the value is between 0-1.

trackIDproperty 
trackID:int  [read-only]

track ID, this value is specifyed by user.


Implementation
    public function get trackID():int
trackNumberproperty 
trackNumber:int  [read-only]

track number, this value is unique and set by system, the lower numbered track processes sound first.


Implementation
    public function get trackNumber():int
trackStartDelayproperty 
trackStartDelay:int  [read-only]

Start delay in sample count. Ussualy this returns 0 except after SiONDriver.noteOn.


Implementation
    public function get trackStartDelay():int
trackStopDelayproperty 
trackStopDelay:int  [read-only]

Stop delay in sample count. Ussualy this returns 0 except after SiONDriver.noteOff.


Implementation
    public function get trackStopDelay():int
trackTypeIDproperty 
trackTypeID:int  [read-only]

track type, this value shows what this track starts by.


Implementation
    public function get trackTypeID():int
velocityproperty 
velocity:int

velocity(0-256). linked to operator's total level.


Implementation
    public function get velocity():int
    public function set velocity(value:int):void
velocityModeproperty 
velocityMode:int

velocity table mode


Implementation
    public function get velocityMode():int
    public function set velocityMode(value:int):void
Constructor Detail
SiMMLTrack()Constructor
public function SiMMLTrack()



Method Detail
_setChannelParameters()method
public function _setChannelParameters(param:Vector.<int>):MMLSequence

Parameters

param:Vector.<int>

Returns
MMLSequence
dispatchEventTrigger()method 
public function dispatchEventTrigger(noteOn:Boolean):Boolean

dispatch EventTrigger

Parameters

noteOn:Boolean — noteOn event or noteOff event

Returns
Boolean — returns false when the event is prevented
dispatchNoteOnEvent()method 
public function dispatchNoteOnEvent(id:int, noteOnType:int = 1):void

dispatch note on event once (%e)

Parameters

id:int — Event trigger ID of this track. This value can be refered from SiONTrackEvent.eventTriggerID.
 
noteOnType:int (default = 1) — Dispatching event type at note on. 0=no events, 1=NOTE_ON_FRAME, 2=NOTE_ON_STREAM, 3=both.

See also

keyOff()method 
public function keyOff(sampleDelay:int = 0, stopWithReset:Boolean = false):SiMMLTrack

Force key off. SiONDriver.noteOff() calls this internally.

Parameters

sampleDelay:int (default = 0) — Delay time (in sample count).
 
stopWithReset:Boolean (default = false) — Stop with channel resetting.

Returns
SiMMLTrack
keyOn()method 
public function keyOn(note:int, tickLength:int = 0, sampleDelay:int = 0):SiMMLTrack

key on. SiONDriver.noteOn() calls this internally.

Parameters

note:int — Note number
 
tickLength:int (default = 0) — note length in tick count.
 
sampleDelay:int (default = 0) — note delay in sample count.

Returns
SiMMLTrack
limitLength()method 
public function limitLength(stopDelay:int):void

Limit key on length.

Parameters

stopDelay:int — delay to key-off.

sequenceOff()method 
public function sequenceOff(sampleDelay:int = 0, stopWithReset:Boolean = false):SiMMLTrack

Force stop sequence.

Parameters

sampleDelay:int (default = 0) — Delay time (in sample count).
 
stopWithReset:Boolean (default = false) — Stop with channel resetting.

Returns
SiMMLTrack
sequenceOn()method 
public function sequenceOn(seq:MMLSequence, sampleLength:int = 0, sampleDelay:int = 0):SiMMLTrack

Play sequence.

Parameters

seq:MMLSequence — Sequence to play.
 
sampleLength:int (default = 0) — sequence playing time.
 
sampleDelay:int (default = 0) — Delaying time (in sample count).

Returns
SiMMLTrack
setAmplitudeEnvelop()method 
public function setAmplitudeEnvelop(noteOn:int, table:SiMMLEnvelopTable, step:int, offset:Boolean = false):void

set amplitude envelop (na, _na)

Parameters

noteOn:int — 1 for normal envelop, 0 for not-off envelop.
 
table:SiMMLEnvelopTable — table SiMMLEnvelopTable
 
step:int — envelop speed (same as 2nd argument)
 
offset:Boolean (default = false) — true for relative control (!na command), false for absolute control.

setChannelModuleType()method 
public function setChannelModuleType(type:int, channelNum:int, toneNum:int):void

Channel module type (%) and select tone (1st argument of '_@').

Parameters

type:int — Channel module type
 
channelNum:int (default = NaN) — Channel number. For %2-11, this value is same as 1st argument of '_@'. channel number of -1 ignores all voice settings by selectVoice.
 
toneNum:int (default = NaN) — Tone number. Ussualy, this argument is used only in %0;PSG and %1;APU.

setDisposable()method 
public function setDisposable():void

Set this track disposable.

setEnvelopFPS()method 
public function setEnvelopFPS(fps:int):void

set envelop step (@fps)

Parameters

fps:int — Frame par second

setEventTrigger()method 
public function setEventTrigger(id:int, noteOnType:int = 1, noteOffType:int = 0):void

set event trigger (%t)

Parameters

id:int — Event trigger ID of this track. This value can be refered from SiONTrackEvent.eventTriggerID.
 
noteOnType:int (default = 1) — Dispatching event type at note on. 0=no events, 1=NOTE_ON_FRAME, 2=NOTE_ON_STREAM, 3=both.
 
noteOffType:int (default = 0) — Dispatching event type at note off. 0=no events, 1=NOTE_OFF_FRAME, 2=NOTE_OFF_STREAM, 3=both.

See also

setFilterEnvelop()method 
public function setFilterEnvelop(noteOn:int, table:SiMMLEnvelopTable, step:int):void

set filter envelop (nf, _nf)

Parameters

noteOn:int — 1 for normal envelop, 0 for not-off envelop.
 
table:SiMMLEnvelopTable — table SiMMLEnvelopTable
 
step:int — envelop speed (same as 2nd argument)

setModulationEnvelop()method 
public function setModulationEnvelop(isPitchMod:Boolean, depth:int, end_depth:int, delay:int, term:int):void

amplitude/pitch modulation envelop (ma, mp)

Parameters

isPitchMod:Boolean — The command is 'ma' or 'mp'.
 
depth:int — start modulation depth (same as 1st argument)
 
end_depth:int — end modulation depth (same as 2nd argument)
 
delay:int — changing delay (same as 3rd argument)
 
term:int — changing term (same as 4th argument)

setNote()method 
public function setNote(note:int, sampleLength:int, slur:Boolean = false):void

Set note immediately. The calling path : SiONDriver.noteOn() -> SiMMLTrack.keyOn() -> executor.singleNote() ->(waiting for MMLEvent.DRIVER_NOTE) -> SiMMLSequencer._onDriverNoteOn() -> SiMMLTrack.setNote() -> SiMMLTrack._mmlKeyOn().

Parameters

note:int — note number.
 
sampleLength:int — length in sample count. 0 sets no key off (=weak slur).
 
slur:Boolean (default = false) — set as slur.

setNoteEnvelop()method 
public function setNoteEnvelop(noteOn:int, table:SiMMLEnvelopTable, step:int):void

set note envelop (nt, _nt)

Parameters

noteOn:int — 1 for normal envelop, 0 for not-off envelop.
 
table:SiMMLEnvelopTable — table SiMMLEnvelopTable
 
step:int — envelop speed (same as 2nd argument)

setPitchBend()method 
public function setPitchBend(noteFrom:int, tickLength:int):void

Set pitch bending.

Parameters

noteFrom:int — Note number bending from.
 
tickLength:int — length of pitch bending.

setPitchEnvelop()method 
public function setPitchEnvelop(noteOn:int, table:SiMMLEnvelopTable, step:int):void

set pitch envelop (np, _np)

Parameters

noteOn:int — 1 for normal envelop, 0 for not-off envelop.
 
table:SiMMLEnvelopTable — table SiMMLEnvelopTable
 
step:int — envelop speed (same as 2nd argument)

setPortament()method 
public function setPortament(frame:int):void

portament (po).

Parameters

frame:int — portament changing time in frame count.

setReleaseSweep()method 
public function setReleaseSweep(sweep:int):void

release sweep (2nd argument of "s")

Parameters

sweep:int — sweeping speed

setToneEnvelop()method 
public function setToneEnvelop(noteOn:int, table:SiMMLEnvelopTable, step:int):void

set tone envelop (@@, _@@)

Parameters

noteOn:int — 1 for normal envelop, 0 for not-off envelop.
 
table:SiMMLEnvelopTable — table SiMMLEnvelopTable
 
step:int — envelop speed (same as 2nd argument)

setTrackCallback()method 
public function setTrackCallback(noteOn:Function = null, noteOff:Function = null):SiMMLTrack

Set track callback function. The callback functions are called at the timing of streaming before SiOPMEvent.STREAM event.

Parameters

noteOn:Function (default = null) — Callback function before note on. This function refers this track instance and new pitch (0-8191) as an arguments. When the function returns false, noteOn will be canceled. function callbackNoteOn(track:SiMMLTrack) : Boolean { return true; }
 
noteOff:Function (default = null) — Callback function before note off. This function refers this track instance as an argument. When the function returns false, noteOff will be canceled. function callbackNoteOff(track:SiMMLTrack) : Boolean { return true; }

Returns
SiMMLTrack
Constant Detail
DRIVER_BACKGROUNDConstant
public static const DRIVER_BACKGROUND:int = 0x50000

Track Type ID for SiONDriver's background sound tracks

DRIVER_NOTEConstant 
public static const DRIVER_NOTE:int = 0x30000

Track Type ID for tracks created by SiONDriver.noteOn() or SiONDriver.playSound()

DRIVER_SEQUENCEConstant 
public static const DRIVER_SEQUENCE:int = 0x40000

Track Type ID for tracks created by SiONDriver.sequenceOn()

MASK_ENVELOPConstant 
public static const MASK_ENVELOP:int = 16

mask all table envelop commands (@@,na,np,nt,nf,_@@,_na,_np,_nt,_nf)

MASK_MODULATEConstant 
public static const MASK_MODULATE:int = 32

mask all modulation commands (ma,mp)

MASK_OPERATORConstant 
public static const MASK_OPERATOR:int = 8

mask all operator setting commands (s,@al,@fb,i,@,@rr,@tl,@ml,@st,@ph,@fx,@se,@er)

MASK_PANConstant 
public static const MASK_PAN:int = 2

mask all panning commands (p,@p)

MASK_QUANTIZEConstant 
public static const MASK_QUANTIZE:int = 4

mask all quantize commands (q,@q)

MASK_SLURConstant 
public static const MASK_SLUR:int = 64

mask all slur and pitch-bending commands (&,&&,

MASK_VOLUMEConstant 
public static const MASK_VOLUME:int = 1

mask all volume commands (v,x,@v,"(",")")

MIDI_TRACKConstant 
public static const MIDI_TRACK:int = 0x20000

Track Type ID for MIDI tracks

MML_TRACKConstant 
public static const MML_TRACK:int = 0x10000

Track Type ID for main MML tracks

NO_MASKConstant 
public static const NO_MASK:int = 0

no event mask

USER_CONTROLLEDConstant 
public static const USER_CONTROLLED:int = 0x60000

Track Type ID for user controlled tracks