Package | org.si.sion |
Class | public class SiONDriver |
Inheritance | SiONDriver ![]() |
Implements | ISiOPMWaveInterface |
See also
Property | Defined By | ||
---|---|---|---|
allowPluralDrivers : Boolean [static] Allow plural drivers [CAUTION] This function is quite experimental and plural drivers require large memory area. | SiONDriver | ||
autoStop : Boolean Auto stop when the sequence finished or fade-outed. | SiONDriver | ||
backgroundSound : Sound [read-only] background sound | SiONDriver | ||
backgroundSoundFadeGapTime : Number [read-only] background sound fading time in seconds | SiONDriver | ||
backgroundSoundFadeInTime : Number [read-only] background sound fading in time in seconds | SiONDriver | ||
backgroundSoundFadeOutTime : Number [read-only] background sound fading out time in seconds | SiONDriver | ||
backgroundSoundTrack : SiMMLTrack [read-only] track for background sound | SiONDriver | ||
backgroundSoundVolume : Number background sound volume | SiONDriver | ||
bitRate : Number [read-only] bit rate, the value of 0 means the wave is represented as float value[-1 - +1]. | SiONDriver | ||
bpm : Number Beat par minute value of SiON's play. | SiONDriver | ||
bufferLength : int [read-only] Streaming buffer length. | SiONDriver | ||
compileTime : int [read-only] previous compiling time [ms]. | SiONDriver | ||
data : SiONData [read-only] Data to compile, render and process. | SiONDriver | ||
debugMode : Boolean Debug mode, true; throw Error / false; throw ErrorEvent when error appears inside. | SiONDriver | ||
dispatchChangeBPMEventWhenPositionChanged : Boolean dispatch CHANGE_BPM Event When position changed | SiONDriver | ||
effector : SiEffectModule Effector module instance. | SiONDriver | ||
fader : Fader [read-only] Fader to control fade-in/out. | SiONDriver | ||
isJobExecuting : Boolean [read-only] Is job executing ? | SiONDriver | ||
isPaused : Boolean [read-only] Is paused ? | SiONDriver | ||
isPlaying : Boolean [read-only] Is streaming ? | SiONDriver | ||
jobProgress : Number [read-only] progression of current compiling/rendering (0=start -> 1=finish). | SiONDriver | ||
jobQueueLength : int [read-only] compiling/rendering jobs queue length. | SiONDriver | ||
jobQueueProgress : Number [read-only] progression of all queued jobs (0=start -> 1=finish). | SiONDriver | ||
latency : Number [read-only] streaming latency [ms]. | SiONDriver | ||
maxTrackCount : int The maximum limit of sound tracks. | SiONDriver | ||
midiModule : MIDIModule [read-only] MIDI sound module | SiONDriver | ||
mmlString : String [read-only] MML string (this property is only available during compiling). | SiONDriver | ||
module : SiOPMModule SiOPM digital signal processor module instance. | SiONDriver | ||
mutex : SiONDriver [static] [read-only] Instance of unique SiONDriver. | SiONDriver | ||
noteOnExceptionMode : int Note on exception mode, this mode is refered when the noteOn() sound's track IDs are conflicted at the same moment. | SiONDriver | ||
pan : Number Sound panning. | SiONDriver | ||
pauseWhileLoading : Boolean pause while loading sound | SiONDriver | ||
position : Number Get playing position[ms] of current data, or Set initial position of playing data. | SiONDriver | ||
processTime : int [read-only] average processing time in 1sec [ms]. | SiONDriver | ||
renderTime : int [read-only] previous rendering time [ms]. | SiONDriver | ||
sampleRate : Number [read-only] Sample rate (44100 is only available in current version). | SiONDriver | ||
sequencer : SiMMLSequencer Sequencer module instance. | SiONDriver | ||
sound : Sound [read-only] flash.media.Sound instance to stream SiON's sound. | SiONDriver | ||
soundChannel : SoundChannel [read-only] flash.media.SoundChannel instance of SiON's sound stream (this property is only available during streaming). | SiONDriver | ||
trackCount : int [read-only] The number of sound tracks (this property is only available during streaming). | SiONDriver | ||
volume : Number Sound volume. | SiONDriver |
Method | Defined By | ||
---|---|---|---|
SiONDriver(bufferLength:int = 2048, channelCount:int = 2, sampleRate:int = 44100, bitRate:int = 0) Create driver to manage the synthesizer, sequencer and effector. | SiONDriver | ||
clearAllUserTables():void Clear all of WaveTables, FM Voices, EnvelopTables, Sampler waves and PCM waves. | SiONDriver | ||
clearSoundLoadingList():void Clear all listening sound list registerd by SiONDriver.listenLoadingStatus(). | SiONDriver | ||
Compile MML string to SiONData. | SiONDriver | ||
compileQueue(mml:String, data:SiONData):int Push queue job to compile MML string. | SiONDriver | ||
dispatchUserDefinedTrackEvent(eventTriggerID:int, note:int):void dispatch SiONTrackEvent.USER_DEFINED event with latency delay
| SiONDriver | ||
fadeIn(time:Number):void Fade in all sound played by SiONDriver. | SiONDriver | ||
fadeOut(time:Number):void Fade out all sound played by SiONDriver. | SiONDriver | ||
listenSoundLoadingStatus(sound:*, prior:int = -99999):Boolean Listen loading status of flash.media.Sound instance. | SiONDriver | ||
newUserControlableTrack(trackID:int = 0):SiMMLTrack Create new user controlable track. | SiONDriver | ||
noteOff(note:int, trackID:int = 0, delay:Number = 0, quant:Number = 0, stopImmediately:Boolean = false):Vector.<SiMMLTrack> Note off. | SiONDriver | ||
noteOn(note:int, voice:SiONVoice = null, length:Number = 0, delay:Number = 0, quant:Number = 0, trackID:int = 0, isDisposable:Boolean = true):SiMMLTrack Note on. | SiONDriver | ||
pause():void Pause sound. | SiONDriver | ||
play(data:* = null, resetEffector:Boolean = true):SoundChannel Play SiONData or MML string. | SiONDriver | ||
playSound(sampleNumber:int, length:Number = 0, delay:Number = 0, quant:Number = 0, trackID:int = 0, isDisposable:Boolean = true):SiMMLTrack Play sound registered in sampler table (registered by setSamplerData()), same as noteOn(note, new SiONVoice(10), ...). | SiONDriver | ||
render(data:*, renderBuffer:Vector.<Number> = null, renderBufferChannelCount:int = 2, resetEffector:Boolean = true):Vector.<Number> Render wave data from MML string or SiONData. | SiONDriver | ||
renderQueue(data:*, renderBuffer:Vector.<Number>, renderBufferChannelCount:int = 2, resetEffector:Boolean = false):int Push queue job to render sound. | SiONDriver | ||
reset():void Reset signal processor. | SiONDriver | ||
resume():void Resume sound. | SiONDriver | ||
sequenceOff(trackID:int, delay:Number = 0, quant:Number = 1, stopWithReset:Boolean = false):Vector.<SiMMLTrack> Stop the sequences with synchronizing. | SiONDriver | ||
sequenceOn(data:SiONData, voice:SiONVoice = null, length:Number = 0, delay:Number = 0, quant:Number = 1, trackID:int = 0, isDisposable:Boolean = true):Vector.<SiMMLTrack> Play sequences with synchronizing. | SiONDriver | ||
setBackgroundSound(sound:Sound, mixLevel:Number = 0.5, loopPoint:Number = -1):void Play Sound as a background. | SiONDriver | ||
setBackgroundSoundFadeTime(fadeInTime:Number, fadeOutTime:Number, gapTime:Number):void set fading time of background sound
| SiONDriver | ||
setBeatCallbackInterval(length16th:Number = 1):void Set callback interval of SiONTrackEvent.BEAT. | SiONDriver | ||
setEnvelopTable(index:int, table:Vector.<int>, loopPoint:int = -1):void Set envelop table data refered by @@,na,np,nt,nf,_@@,_na,_np,_nt and _nf. | SiONDriver | ||
setPCMData(index:int, data:Vector.<Number>, samplingOctave:int = 5, keyRangeFrom:int = 0, keyRangeTo:int = 127, isSourceDataStereo:Boolean = false):SiOPMWavePCMData [NOT RECOMMENDED] This function is for a compatibility with previous versions, please use setPCMWave instead of this function. | SiONDriver | ||
setPCMSound(index:int, sound:Sound, samplingOctave:int = 5, keyRangeFrom:int = 0, keyRangeTo:int = 127):SiOPMWavePCMData [NOT RECOMMENDED] This function is for a compatibility with previous versions, please use setPCMWave instead of this function. | SiONDriver | ||
setPCMVoice(index:int, voice:SiONVoice):void Set pcm voice
| SiONDriver | ||
setPCMWave(index:int, data:*, samplingNote:Number = 69, keyRangeFrom:int = 0, keyRangeTo:int = 127, srcChannelCount:int = 2, channelCount:int = 0):SiOPMWavePCMData Set PCM wave data rederd by %7. | SiONDriver | ||
setSamplerData(index:int, data:Vector.<Number>, ignoreNoteOff:Boolean = false, channelCount:int = 1):SiOPMWaveSamplerData [NOT RECOMMENDED] This function is for a compatibility with previous versions, please use setSamplerWave instead of this function. | SiONDriver | ||
setSamplerSound(index:int, sound:Sound, ignoreNoteOff:Boolean = false, channelCount:int = 2):SiOPMWaveSamplerData [NOT RECOMMENDED] This function is for a compatibility with previous versions, please use setSamplerWave instead of this function. | SiONDriver | ||
setSamplerTable(bank:int, table:SiOPMWaveSamplerTable):void Set sampler table
| SiONDriver | ||
setSamplerWave(index:int, data:*, ignoreNoteOff:Boolean = false, pan:int = 0, srcChannelCount:int = 2, channelCount:int = 0):SiOPMWaveSamplerData Set sampler wave data refered by %10. | SiONDriver | ||
setSoundReferenceTable(soundReferenceTable:* = null):void Set hash table of Sound instance refered from #SAMPLER and #PCMWAVE commands. | SiONDriver | ||
setTimerInterruption(length16th:Number = 1, callback:Function = null):void Set timer interruption. | SiONDriver | ||
Set wave table data refered by %6. | SiONDriver | ||
setWaveTable(index:int, table:Vector.<Number>):SiOPMWaveTable Set wave table data refered by %4. | SiONDriver | ||
startQueue(interval:int = 500):int Execute all elements queued by compileQueue() and renderQueue(). | SiONDriver | ||
stop():void Stop sound. | SiONDriver | ||
stopBackgroundSound():void Stop background sound. | SiONDriver |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatch on beat while streaming. | SiONDriver | |||
Dispatch when the bpm changes. | SiONDriver | |||
Dispatch when fade in is finished. | SiONDriver | |||
Dispatch when fade out is finished. | SiONDriver | |||
Dispatch while fading. | SiONDriver | |||
Dispatch when finish executing all sequences. | SiONDriver | |||
Dispatch when the sound ends. | SiONDriver | |||
Dispatch when the note off appears in the sequence with "%t" command. | SiONDriver | |||
Dispatch when the sound starts. | SiONDriver | |||
Dispatch when the note on appears in the sequence with "%t" command. | SiONDriver | |||
Dispatch when cancel all queued jobs. | SiONDriver | |||
Dispatch when finish all queued jobs. | SiONDriver | |||
Dispatch when executing queued jobs. | SiONDriver | |||
Dispatch while streaming. | SiONDriver | |||
Dispatch when start streaming. | SiONDriver | |||
Dispatch when stop streaming. | SiONDriver |
Constant | Defined By | ||
---|---|---|---|
NEM_IGNORE : int = 0 [static] note-on exception mode "ignore", SiON does not consider about track ID's conflict in noteOn() method (default). | SiONDriver | ||
NEM_OVERWRITE : int = 2 [static] note-on exception mode "overwrite", Overwrite current note when the track IDs are conflicted. | SiONDriver | ||
NEM_REJECT : int = 1 [static] note-on exception mode "reject", Reject new note when the track IDs are conflicted. | SiONDriver | ||
NEM_SHIFT : int = 3 [static] note-on exception mode "shift", Shift the sound timing to next quantize when the track IDs are conflicted. | SiONDriver | ||
VERSION : String = 0.6.6.0 [static] version number | SiONDriver |
allowPluralDrivers | property |
allowPluralDrivers:Boolean
Allow plural drivers [CAUTION] This function is quite experimental and plural drivers require large memory area.
public static function get allowPluralDrivers():Boolean
public static function set allowPluralDrivers(value:Boolean):void
autoStop | property |
autoStop:Boolean
Auto stop when the sequence finished or fade-outed.
The default value is false
.
public function get autoStop():Boolean
public function set autoStop(value:Boolean):void
backgroundSound | property |
backgroundSound:Sound
[read-only] background sound
public function get backgroundSound():Sound
backgroundSoundFadeGapTime | property |
backgroundSoundFadeGapTime:Number
[read-only] background sound fading time in seconds
public function get backgroundSoundFadeGapTime():Number
backgroundSoundFadeInTime | property |
backgroundSoundFadeInTime:Number
[read-only] background sound fading in time in seconds
public function get backgroundSoundFadeInTime():Number
backgroundSoundFadeOutTime | property |
backgroundSoundFadeOutTime:Number
[read-only] background sound fading out time in seconds
public function get backgroundSoundFadeOutTime():Number
backgroundSoundTrack | property |
backgroundSoundTrack:SiMMLTrack
[read-only] track for background sound
public function get backgroundSoundTrack():SiMMLTrack
backgroundSoundVolume | property |
backgroundSoundVolume:Number
background sound volume
The default value is 0.5
.
public function get backgroundSoundVolume():Number
public function set backgroundSoundVolume(value:Number):void
bitRate | property |
bitRate:Number
[read-only] bit rate, the value of 0 means the wave is represented as float value[-1 - +1].
public function get bitRate():Number
bpm | property |
bpm:Number
Beat par minute value of SiON's play.
The default value is 120
.
public function get bpm():Number
public function set bpm(value:Number):void
bufferLength | property |
bufferLength:int
[read-only] Streaming buffer length.
public function get bufferLength():int
compileTime | property |
compileTime:int
[read-only] previous compiling time [ms].
public function get compileTime():int
data | property |
data:SiONData
[read-only] Data to compile, render and process.
public function get data():SiONData
debugMode | property |
debugMode:Boolean
Debug mode, true; throw Error / false; throw ErrorEvent when error appears inside.
The default value is false
.
public function get debugMode():Boolean
public function set debugMode(value:Boolean):void
dispatchChangeBPMEventWhenPositionChanged | property |
dispatchChangeBPMEventWhenPositionChanged:Boolean
dispatch CHANGE_BPM Event When position changed
The default value is true
.
public function get dispatchChangeBPMEventWhenPositionChanged():Boolean
public function set dispatchChangeBPMEventWhenPositionChanged(value:Boolean):void
effector | property |
public var effector:SiEffectModule
Effector module instance.
fader | property |
fader:Fader
[read-only] Fader to control fade-in/out. You can check activity by "fader.isActive".
public function get fader():Fader
isJobExecuting | property |
isJobExecuting:Boolean
[read-only] Is job executing ?
public function get isJobExecuting():Boolean
isPaused | property |
isPaused:Boolean
[read-only] Is paused ?
public function get isPaused():Boolean
isPlaying | property |
isPlaying:Boolean
[read-only] Is streaming ?
public function get isPlaying():Boolean
jobProgress | property |
jobProgress:Number
[read-only] progression of current compiling/rendering (0=start -> 1=finish).
public function get jobProgress():Number
jobQueueLength | property |
jobQueueLength:int
[read-only] compiling/rendering jobs queue length.
public function get jobQueueLength():int
jobQueueProgress | property |
jobQueueProgress:Number
[read-only] progression of all queued jobs (0=start -> 1=finish).
public function get jobQueueProgress():Number
latency | property |
latency:Number
[read-only] streaming latency [ms].
public function get latency():Number
maxTrackCount | property |
maxTrackCount:int
The maximum limit of sound tracks.
The default value is 128
.
public function get maxTrackCount():int
public function set maxTrackCount(value:int):void
midiModule | property |
midiModule:MIDIModule
[read-only] MIDI sound module
public function get midiModule():MIDIModule
mmlString | property |
mmlString:String
[read-only] MML string (this property is only available during compiling).
public function get mmlString():String
module | property |
public var module:SiOPMModule
SiOPM digital signal processor module instance.
mutex | property |
mutex:SiONDriver
[read-only] Instance of unique SiONDriver. null when new SiONDriver is not created yet.
public static function get mutex():SiONDriver
noteOnExceptionMode | property |
noteOnExceptionMode:int
Note on exception mode, this mode is refered when the noteOn() sound's track IDs are conflicted at the same moment. This value have to be SiONDriver.NEM_
The default value is NEM_IGNORE.
.
public function get noteOnExceptionMode():int
public function set noteOnExceptionMode(value:int):void
See also
pan | property |
pan:Number
Sound panning.
public function get pan():Number
public function set pan(value:Number):void
pauseWhileLoading | property |
pauseWhileLoading:Boolean
pause while loading sound
The default value is true
.
public function get pauseWhileLoading():Boolean
public function set pauseWhileLoading(value:Boolean):void
position | property |
position:Number
Get playing position[ms] of current data, or Set initial position of playing data.
The default value is 0
.
public function get position():Number
public function set position(value:Number):void
processTime | property |
processTime:int
[read-only] average processing time in 1sec [ms].
public function get processTime():int
renderTime | property |
renderTime:int
[read-only] previous rendering time [ms].
public function get renderTime():int
sampleRate | property |
sampleRate:Number
[read-only] Sample rate (44100 is only available in current version).
public function get sampleRate():Number
sequencer | property |
public var sequencer:SiMMLSequencer
Sequencer module instance.
sound | property |
sound:Sound
[read-only] flash.media.Sound instance to stream SiON's sound.
public function get sound():Sound
soundChannel | property |
soundChannel:SoundChannel
[read-only] flash.media.SoundChannel instance of SiON's sound stream (this property is only available during streaming).
public function get soundChannel():SoundChannel
trackCount | property |
trackCount:int
[read-only] The number of sound tracks (this property is only available during streaming).
public function get trackCount():int
volume | property |
volume:Number
Sound volume.
public function get volume():Number
public function set volume(value:Number):void
SiONDriver | () | Constructor |
public function SiONDriver(bufferLength:int = 2048, channelCount:int = 2, sampleRate:int = 44100, bitRate:int = 0)
Create driver to manage the synthesizer, sequencer and effector. Only one SiONDriver instance can be created.
ParametersbufferLength:int (default = 2048 ) — Buffer size of sound stream. The value of 8192, 4096 or 2048 is available.
| |
channelCount:int (default = 2 ) — Channel count. 1(monoral) or 2(stereo) is available.
| |
sampleRate:int (default = 44100 ) — Sampling ratio of wave. 44100 is only available in current version.
| |
bitRate:int (default = 0 ) — Bit ratio of wave. 0 means float value [-1 to 1].
|
clearAllUserTables | () | method |
public function clearAllUserTables():void
Clear all of WaveTables, FM Voices, EnvelopTables, Sampler waves and PCM waves.
See also
clearSoundLoadingList | () | method |
public function clearSoundLoadingList():void
Clear all listening sound list registerd by SiONDriver.listenLoadingStatus().
compile | () | method |
public function compile(mml:String, data:SiONData = null):SiONData
Compile MML string to SiONData.
Parameters
mml:String — MML string to compile.
| |
data:SiONData (default = null ) — SiONData to compile. The SiONDriver creates new SiONData instance when this argument is null.
|
SiONData — Compiled data.
|
compileQueue | () | method |
public function compileQueue(mml:String, data:SiONData):int
Push queue job to compile MML string. Start compiling after calling startQueue.
Parameters
mml:String — MML string to compile.
| |
data:SiONData — SiONData to compile.
|
int — Queue length.
|
See also
dispatchUserDefinedTrackEvent | () | method |
public function dispatchUserDefinedTrackEvent(eventTriggerID:int, note:int):void
dispatch SiONTrackEvent.USER_DEFINED event with latency delay
Parameters
eventTriggerID:int — SiONTrackEvent.eventTriggerID
| |
note:int — SiONTrackEvent.note
|
fadeIn | () | method |
public function fadeIn(time:Number):void
Fade in all sound played by SiONDriver. You can set this method before calling play().
Parameters
time:Number — Fading time [second].
|
fadeOut | () | method |
public function fadeOut(time:Number):void
Fade out all sound played by SiONDriver.
Parameters
time:Number — Fading time [second].
|
forceDispatchStreamEvent | () | method |
_sion_internal function forceDispatchStreamEvent(dispatch:Boolean = true):void
Force dispatch stream event. The SiONEvent.STREAM is dispatched only when the event listener is set BEFORE calling play(). You can let SiONDriver to dispatch SiONEvent.STREAM event by this function.
Parameters
dispatch:Boolean (default = true ) — Set true to force dispatching. Or set false to not dispatching if there are no listeners.
|
listenSoundLoadingStatus | () | method |
public function listenSoundLoadingStatus(sound:*, prior:int = -99999):Boolean
Listen loading status of flash.media.Sound instance. When SiONDriver.pauseWhileLoading is true, SiONDriver starts streaming after all Sound instances passed by this function are loaded.
Parameters
sound:* — Sound or SoundLoader instance to listern
| |
prior:int (default = -99999 ) — listening priority
|
Boolean — return false when the sound is loaded already.
|
See also
newUserControlableTrack | () | method |
public function newUserControlableTrack(trackID:int = 0):SiMMLTrack
Create new user controlable track. This function only is available after play().
Parameters
trackID:int (default = 0 )
|
SiMMLTrack — new user controlable track. This track is NOT disposable.
|
noteOff | () | method |
public function noteOff(note:int, trackID:int = 0, delay:Number = 0, quant:Number = 0, stopImmediately:Boolean = false):Vector.<SiMMLTrack>
Note off. This function only is available after play(). The NOTE_OFF_STREAM event is dispatched inside.
Parameters
note:int — note number [-1-127]. The value of -1 ignores note number.
| |
trackID:int (default = 0 ) — track id to note off.
| |
delay:Number (default = 0 ) — note off delay units in 16th beat.
| |
quant:Number (default = 0 ) — quantize in 16th beat. 0 sets no quantization. 4 sets quantization by 4th beat.
| |
stopImmediately:Boolean (default = false ) — stop sound with reseting channel's process
|
Vector.<SiMMLTrack> — All SiMMLTracks switched key off.
|
noteOn | () | method |
public function noteOn(note:int, voice:SiONVoice = null, length:Number = 0, delay:Number = 0, quant:Number = 0, trackID:int = 0, isDisposable:Boolean = true):SiMMLTrack
Note on. This function only is available after play(). The NOTE_ON_STREAM event is dispatched inside.
Parameters
note:int — note number [0-127].
| |
voice:SiONVoice (default = null ) — SiONVoice to play note. You can specify null, but it sets only a default square wave.
| |
length:Number (default = 0 ) — note length in 16th beat. 0 sets no note off, this means you should call noteOff().
| |
delay:Number (default = 0 ) — note on delay units in 16th beat.
| |
quant:Number (default = 0 ) — quantize in 16th beat. 0 sets no quantization. 4 sets quantization by 4th beat.
| |
trackID:int (default = 0 ) — new tracks id (0-65535).
| |
isDisposable:Boolean (default = true ) — use disposable track. The disposable track will free automatically when finished rendering.
This means you should not keep a dieposable track in your code perpetually.
If you want to keep track, set this argument false. And after using, call SiMMLTrack::setDisposal() to disposed by system.
[REMARKS] Not disposable track is kept in the system perpetually while streaming, this may causes critical performance loss.
|
SiMMLTrack — SiMMLTrack to play the note.
|
pause | () | method |
public function pause():void
Pause sound. You can resume it by resume() or play().
See also
play | () | method |
public function play(data:* = null, resetEffector:Boolean = true):SoundChannel
Play SiONData or MML string.
Parameters
data:* (default = null ) — SiONData, mml String, Sound object, mp3 file URLRequest or SMFData object to play. You can pass null when resume after pause or streaming without any data.
| |
resetEffector:Boolean (default = true ) — reset all effectors before play data.
|
SoundChannel — SoundChannel instance to play data. This instance is same as soundChannel property.
|
See also
playSound | () | method |
public function playSound(sampleNumber:int, length:Number = 0, delay:Number = 0, quant:Number = 0, trackID:int = 0, isDisposable:Boolean = true):SiMMLTrack
Play sound registered in sampler table (registered by setSamplerData()), same as noteOn(note, new SiONVoice(10), ...).
Parameters
sampleNumber:int — sample number [0-127].
| |
length:Number (default = 0 ) — note length in 16th beat. 0 sets no note off, this means you should call noteOff().
| |
delay:Number (default = 0 ) — note on delay units in 16th beat.
| |
quant:Number (default = 0 ) — quantize in 16th beat. 0 sets no quantization. 4 sets quantization by 4th beat.
| |
trackID:int (default = 0 ) — new tracks id (0-65535).
| |
isDisposable:Boolean (default = true ) — use disposable track. The disposable track will free automatically when finished rendering.
This means you should not keep a dieposable track in your code perpetually.
If you want to keep track, set this argument false. And after using, SiMMLTrack::setDisposal() to disposed by system.
[REMARKS] Not disposable track is kept perpetually in the system while streaming, this may causes critical performance loss.
|
SiMMLTrack — SiMMLTrack to play the note.
|
render | () | method |
public function render(data:*, renderBuffer:Vector.<Number> = null, renderBufferChannelCount:int = 2, resetEffector:Boolean = true):Vector.<Number>
Render wave data from MML string or SiONData. This method may take long time, please consider the using renderQueue() instead.
Parameters
data:* — SiONData or mml String to play.
| |
renderBuffer:Vector.<Number> (default = null ) — Rendering target. null to create new buffer. The length of this argument limits the rendering length (except for 0).
| |
renderBufferChannelCount:int (default = 2 ) — Channel count of renderBuffer. 2 for stereo and 1 for monoral.
| |
resetEffector:Boolean (default = true ) — reset all effectors before play data.
|
Vector.<Number> — rendered wave data as Vector.<Number>.
|
renderQueue | () | method |
public function renderQueue(data:*, renderBuffer:Vector.<Number>, renderBufferChannelCount:int = 2, resetEffector:Boolean = false):int
Push queue job to render sound. Start rendering after calling startQueue.
Parameters
data:* — SiONData or mml String to render.
| |
renderBuffer:Vector.<Number> — Rendering target. The length of renderBuffer limits rendering length except for 0.
| |
renderBufferChannelCount:int (default = 2 ) — Channel count of renderBuffer. 2 for stereo and 1 for monoral.
| |
resetEffector:Boolean (default = false )
|
int — Queue length.
|
See also
reset | () | method |
public function reset():void
Reset signal processor. The effector and sequencer will not be reset. If you want to reset all, call SiONDriver.stop() instead.
resume | () | method |
public function resume():void
Resume sound. same as play() after pause().
See also
sequenceOff | () | method |
public function sequenceOff(trackID:int, delay:Number = 0, quant:Number = 1, stopWithReset:Boolean = false):Vector.<SiMMLTrack>
Stop the sequences with synchronizing. This function only is available after play().
Parameters
trackID:int — tracks id to stop.
| |
delay:Number (default = 0 ) — sequence off delay units in 16th beat.
| |
quant:Number (default = 1 ) — quantize in 16th beat. 0 sets no quantization. 4 sets quantization by 4th beat.
| |
stopWithReset:Boolean (default = false ) — stop sound with reseting channel's process
|
Vector.<SiMMLTrack> — list of SiMMLTracks stopped to play sequence.
|
sequenceOn | () | method |
public function sequenceOn(data:SiONData, voice:SiONVoice = null, length:Number = 0, delay:Number = 0, quant:Number = 1, trackID:int = 0, isDisposable:Boolean = true):Vector.<SiMMLTrack>
Play sequences with synchronizing. This function only is available after play().
Parameters
data:SiONData — The SiONData including sequences. This data is used only for sequences. The system ignores wave, envelop and voice data.
| |
voice:SiONVoice (default = null ) — SiONVoice to play sequence. The voice setting in the sequence has priority.
| |
length:Number (default = 0 ) — note length in 16th beat. 0 sets no note off, this means you should call noteOff().
| |
delay:Number (default = 0 ) — note on delay units in 16th beat.
| |
quant:Number (default = 1 ) — quantize in 16th beat. 0 sets no quantization. 4 sets quantization by 4th beat.
| |
trackID:int (default = 0 ) — new tracks id (0-65535).
| |
isDisposable:Boolean (default = true ) — use disposable track. The disposable track will free automatically when finished rendering.
This means you should not keep a dieposable track in your code perpetually.
If you want to keep track, set this argument false. And after using, call SiMMLTrack::setDisposal() to disposed by system.
[REMARKS] Not disposable track is kept in the system perpetually while streaming, this may causes critical performance loss.
|
Vector.<SiMMLTrack> — list of SiMMLTracks to play sequence.
|
setBackgroundSound | () | method |
public function setBackgroundSound(sound:Sound, mixLevel:Number = 0.5, loopPoint:Number = -1):void
Play Sound as a background.
Parameters
sound:Sound — Sound instance to play background.
| |
mixLevel:Number (default = 0.5 ) — Mixing level (0-1), this value same as backgroundSoundVolume.
| |
loopPoint:Number (default = -1 ) — loop point in second. -1 sets no loop
|
See also
setBackgroundSoundFadeTime | () | method |
public function setBackgroundSoundFadeTime(fadeInTime:Number, fadeOutTime:Number, gapTime:Number):void
set fading time of background sound
Parameters
fadeInTime:Number — fade in time [sec]. positive value only
| |
fadeOutTime:Number — fade out time [sec]. positive value only
| |
gapTime:Number — gap between 2 sound [sec]. You can specify negative values to play with cross fading.
|
setBeatCallbackInterval | () | method |
public function setBeatCallbackInterval(length16th:Number = 1):void
Set callback interval of SiONTrackEvent.BEAT.
Parameters
length16th:Number (default = 1 ) — Interval in 16th beat. 2^n is only available(1,2,4,8,16....).
|
setEnvelopTable | () | method |
public function setEnvelopTable(index:int, table:Vector.<int>, loopPoint:int = -1):void
Set envelop table data refered by @@,na,np,nt,nf,_@@,_na,_np,_nt and _nf.
Parameters
index:int — envelop table number.
| |
table:Vector.<int> — envelop table vector.
| |
loopPoint:int (default = -1 ) — returning point index of looping. -1 sets no loop.
|
setPCMData | () | method |
public function setPCMData(index:int, data:Vector.<Number>, samplingOctave:int = 5, keyRangeFrom:int = 0, keyRangeTo:int = 127, isSourceDataStereo:Boolean = false):SiOPMWavePCMData
[NOT RECOMMENDED] This function is for a compatibility with previous versions, please use setPCMWave instead of this function.
Parameters
index:int | |
data:Vector.<Number> | |
samplingOctave:int (default = 5 )
| |
keyRangeFrom:int (default = 0 )
| |
keyRangeTo:int (default = 127 )
| |
isSourceDataStereo:Boolean (default = false )
|
SiOPMWavePCMData |
See also
setPCMSound | () | method |
public function setPCMSound(index:int, sound:Sound, samplingOctave:int = 5, keyRangeFrom:int = 0, keyRangeTo:int = 127):SiOPMWavePCMData
[NOT RECOMMENDED] This function is for a compatibility with previous versions, please use setPCMWave instead of this function.
Parameters
index:int | |
sound:Sound | |
samplingOctave:int (default = 5 )
| |
keyRangeFrom:int (default = 0 )
| |
keyRangeTo:int (default = 127 )
|
SiOPMWavePCMData |
See also
setPCMVoice | () | method |
public function setPCMVoice(index:int, voice:SiONVoice):void
Set pcm voice
Parameters
index:int — PCM data number.
| |
voice:SiONVoice — pcm voice to set, ussualy from SiONSoundFont
|
See also
setPCMWave | () | method |
public function setPCMWave(index:int, data:*, samplingNote:Number = 69, keyRangeFrom:int = 0, keyRangeTo:int = 127, srcChannelCount:int = 2, channelCount:int = 0):SiOPMWavePCMData
Set PCM wave data rederd by %7.
Parameters
index:int — PCM data number.
| |
data:* — wave data, Sound, Vector.<Number> or Vector.<int> is available. The Sound instance is extracted internally, the maximum length to extract is SiOPMWavePCMData.maxSampleLengthFromSound[samples].
| |
samplingNote:Number (default = 69 ) — Sampling wave's original note number, this allows decimal number
| |
keyRangeFrom:int (default = 0 ) — Assigning key range starts from (not implemented in current version)
| |
keyRangeTo:int (default = 127 ) — Assigning key range ends at (not implemented in current version)
| |
srcChannelCount:int (default = 2 ) — channel count of source data, 1 for monoral, 2 for stereo.
| |
channelCount:int (default = 0 ) — channel count of this data, 1 for monoral, 2 for stereo, 0 sets same with srcChannelCount.
|
SiOPMWavePCMData |
See also
setSamplerData | () | method |
public function setSamplerData(index:int, data:Vector.<Number>, ignoreNoteOff:Boolean = false, channelCount:int = 1):SiOPMWaveSamplerData
[NOT RECOMMENDED] This function is for a compatibility with previous versions, please use setSamplerWave instead of this function.
Parameters
index:int | |
data:Vector.<Number> | |
ignoreNoteOff:Boolean (default = false )
| |
channelCount:int (default = 1 )
|
SiOPMWaveSamplerData |
See also
setSamplerSound | () | method |
public function setSamplerSound(index:int, sound:Sound, ignoreNoteOff:Boolean = false, channelCount:int = 2):SiOPMWaveSamplerData
[NOT RECOMMENDED] This function is for a compatibility with previous versions, please use setSamplerWave instead of this function.
Parameters
index:int | |
sound:Sound | |
ignoreNoteOff:Boolean (default = false )
| |
channelCount:int (default = 2 )
|
SiOPMWaveSamplerData |
See also
setSamplerTable | () | method |
public function setSamplerTable(bank:int, table:SiOPMWaveSamplerTable):void
Set sampler table
Parameters
bank:int — bank number
| |
table:SiOPMWaveSamplerTable — sampler table class, ussualy from SiONSoundFont
|
See also
setSamplerWave | () | method |
public function setSamplerWave(index:int, data:*, ignoreNoteOff:Boolean = false, pan:int = 0, srcChannelCount:int = 2, channelCount:int = 0):SiOPMWaveSamplerData
Set sampler wave data refered by %10.
Parameters
index:int — note number. 0-127 for bank0, 128-255 for bank1.
| |
data:* — wave data, Sound, Vector.<Number> or Vector.<int> is available. The Sound is extracted when the length is shorter than SiOPMWaveSamplerData.extractThreshold[msec].
| |
ignoreNoteOff:Boolean (default = false ) — True to set ignoring note off.
| |
pan:int (default = 0 ) — pan of this sample [-64 - 64].
| |
srcChannelCount:int (default = 2 ) — channel count of source data, 1 for monoral, 2 for stereo.
| |
channelCount:int (default = 0 ) — channel count of this data, 1 for monoral, 2 for stereo, 0 sets same with srcChannelCount.
|
SiOPMWaveSamplerData — created data instance
|
See also
setSoundReferenceTable | () | method |
public function setSoundReferenceTable(soundReferenceTable:* = null):void
Set hash table of Sound instance refered from #SAMPLER and #PCMWAVE commands. You have to set this table BEFORE compile mml.
Parameters
soundReferenceTable:* (default = null )
|
setTimerInterruption | () | method |
public function setTimerInterruption(length16th:Number = 1, callback:Function = null):void
Set timer interruption.
Parameters
length16th:Number (default = 1 ) — Interupting interval in 16th beat.
| |
callback:Function (default = null ) — Callback function. the Type is function():void.
|
setVoice | () | method |
public function setVoice(index:int, voice:SiONVoice):void
Set wave table data refered by %6.
Parameters
index:int — wave table number.
| |
voice:SiONVoice — voice to register.
|
setWaveTable | () | method |
public function setWaveTable(index:int, table:Vector.<Number>):SiOPMWaveTable
Set wave table data refered by %4.
Parameters
index:int — wave table number.
| |
table:Vector.<Number> — wave shape vector ranges in -1 to 1.
|
SiOPMWaveTable |
startQueue | () | method |
public function startQueue(interval:int = 500):int
Execute all elements queued by compileQueue() and renderQueue(). After calling this function, the SiONEvent.QUEUE_PROGRESS, SiONEvent.QUEUE_COMPLETE and ErrorEvent.ERROR events will be dispatched. The SiONEvent.QUEUE_PROGRESS is dispatched when it's executing queued job. The SiONEvent.QUEUE_COMPLETE is dispatched when finish all queued jobs. The ErrorEvent.ERROR is dispatched when some error appears during the compile.
Parameters
interval:int (default = 500 ) — Interupting interval
|
int — Queue length.
|
See also
stop | () | method |
public function stop():void
Stop sound.
stopBackgroundSound | () | method |
public function stopBackgroundSound():void
Stop background sound.
beat | Event |
org.si.sion.events.SiONTrackEvent
org.si.sion.events.SiONTrackEvent.BEAT
Dispatch on beat while streaming. This event is called in each beat timing on frame. When you want to listen this event, you have to set addEventListener() before SiONDriver.play().
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | false |
driver | SiONDriver instance playing now. |
data | SiONData instance playing now. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | null. |
track | null |
eventTriggerID | Counter in 16th beat. |
note | 0 |
bufferIndex | Buffering index |
changeBPM | Event |
org.si.sion.events.SiONTrackEvent
org.si.sion.events.SiONTrackEvent.CHANGE_BPM
Dispatch when the bpm changes.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | false |
driver | SiONDriver instance. |
data | SiONData instance. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | null |
track | null |
eventTriggerID | null |
note | 0 |
bufferIndex | Buffering index |
fadeInComplete | Event |
org.si.sion.events.SiONEvent
org.si.sion.events.SiONEvent.FADE_IN_COMPLETE
Dispatch when fade in is finished. This event is dispatched after SiONEvent.STREAM.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | false |
driver | SiONDriver instance to stop streaming. |
data | SiONData instance playing now. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | ByteArray instance of this stream. The length is twice of SiONDriver.bufferLength in the unit of float. You can get the renderd wave data by this propertiy. |
fadeOutComplete | Event |
org.si.sion.events.SiONEvent
org.si.sion.events.SiONEvent.FADE_OUT_COMPLETE
Dispatch when fade out is finished. This event is dispatched after SiONEvent.STREAM.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | false |
driver | SiONDriver instance to stop streaming. |
data | SiONData instance playing now. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | ByteArray instance of this stream. The length is twice of SiONDriver.bufferLength in the unit of float. You can get the renderd wave data by this propertiy. |
fadeProgress | Event |
org.si.sion.events.SiONEvent
org.si.sion.events.SiONEvent.FADE_PROGRESS
Dispatch while fading. This event is dispatched after SiONEvent.STREAM.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | true to cancel fading. |
driver | SiONDriver instance to stop streaming. |
data | SiONData instance playing now. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | null |
finishSequence | Event |
org.si.sion.events.SiONEvent
org.si.sion.events.SiONEvent.FINISH_SEQUENCE
Dispatch when finish executing all sequences.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | false |
driver | SiONDriver instance playing now. |
data | SiONData instance playing now. |
streamBuffer | null |
noteOffFrame | Event |
org.si.sion.events.SiONTrackEvent
org.si.sion.events.SiONTrackEvent.NOTE_OFF_FRAME
Dispatch when the sound ends.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | false |
driver | SiONDriver instance. |
data | SiONData instance. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | null |
track | SiMMLTrack instance executing sequence. |
eventTriggerID | Trigger ID specifyed in "%t" commands 1st argument. |
note | Note number. |
bufferIndex | Buffering index |
noteOffStream | Event |
org.si.sion.events.SiONTrackEvent
org.si.sion.events.SiONTrackEvent.NOTE_OFF_STREAM
Dispatch when the note off appears in the sequence with "%t" command.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | true; mute the note |
driver | SiONDriver instance. |
data | SiONData instance. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | null |
track | SiMMLTrack instance executing sequence. |
eventTriggerID | Trigger ID specifyed in "%t" commands 1st argument. |
note | Note number. |
bufferIndex | Buffering index |
noteOnFrame | Event |
org.si.sion.events.SiONTrackEvent
org.si.sion.events.SiONTrackEvent.NOTE_ON_FRAME
Dispatch when the sound starts.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | false |
driver | SiONDriver instance. |
data | SiONData instance. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | null |
track | SiMMLTrack instance executing sequence. |
eventTriggerID | Trigger ID specifyed in "%t" commands 1st argument. |
note | Note number. |
bufferIndex | Buffering index |
noteOnStream | Event |
org.si.sion.events.SiONTrackEvent
org.si.sion.events.SiONTrackEvent.NOTE_ON_STREAM
Dispatch when the note on appears in the sequence with "%t" command.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | true; mute the note |
driver | SiONDriver instance. |
data | SiONData instance. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | null |
track | SiMMLTrack instance executing sequence. |
eventTriggerID | Trigger ID specifyed in "%t" commands 1st argument. |
note | Note number. |
bufferIndex | Buffering index |
queueCancel | Event |
org.si.sion.events.SiONEvent
org.si.sion.events.SiONEvent.QUEUE_CANCEL
Dispatch when cancel all queued jobs.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | false |
driver | SiONDriver instance compiled/rendered. |
driver.mmlString | null |
data | null |
streamBuffer | null |
queueComplete | Event |
org.si.sion.events.SiONEvent
org.si.sion.events.SiONEvent.QUEUE_COMPLETE
Dispatch when finish all queued jobs.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | false |
driver | SiONDriver instance compiled/rendered. |
driver.mmlString | MML string compiled. null when the job is "render". |
data | SiONData instance compiled/rendered. |
streamBuffer | null |
queueProgress | Event |
org.si.sion.events.SiONEvent
org.si.sion.events.SiONEvent.QUEUE_PROGRESS
Dispatch when executing queued jobs.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | true; Cancel compiling/rendering immediately. |
driver | SiONDriver instance compiling/rendering compiling now. |
driver.mmlString | MML string compiling now. null when the job is "render". |
data | SiONData instance compiling/rendering now. This data is not available when compiling. |
streamBuffer | null |
stream | Event |
org.si.sion.events.SiONEvent
org.si.sion.events.SiONEvent.STREAM
Dispatch while streaming. This event is called inside SiONDriver.play() after SiONEvent.STREAM_START, and each streaming timing.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | true; Stop streaming. SiONDriver.stop() s called inside |
driver | SiONDriver instance playing now. |
data | SiONData instance playing now. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | ByteArray instance of this stream. The length is twice of SiONDriver.bufferLength in the unit of float. You can get the renderd wave data by this propertiy. |
streamStart | Event |
org.si.sion.events.SiONEvent
org.si.sion.events.SiONEvent.STREAM_START
Dispatch when start streaming. This event is called inside SiONDriver.play() before SiONEvent.STREAM.
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | true; Cancel to start streaming. |
driver | SiONDriver instance to start streaming. |
data | SiONData instance to start streaming. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | null |
streamStop | Event |
org.si.sion.events.SiONEvent
org.si.sion.events.SiONEvent.STREAM_STOP
Dispatch when stop streaming. This event is dispatched inside SiONDriver.stop().
The properties of the event object have the following values:
Property | Value |
---|---|
cancelable | false |
driver | SiONDriver instance to stop streaming. |
data | SiONData instance to stop streaming. This property is null if you call SiONDriver.play() with null of the 1st argument. |
streamBuffer | null |
NEM_IGNORE | Constant |
public static const NEM_IGNORE:int = 0
note-on exception mode "ignore", SiON does not consider about track ID's conflict in noteOn() method (default).
NEM_OVERWRITE | Constant |
public static const NEM_OVERWRITE:int = 2
note-on exception mode "overwrite", Overwrite current note when the track IDs are conflicted.
NEM_REJECT | Constant |
public static const NEM_REJECT:int = 1
note-on exception mode "reject", Reject new note when the track IDs are conflicted.
NEM_SHIFT | Constant |
public static const NEM_SHIFT:int = 3
note-on exception mode "shift", Shift the sound timing to next quantize when the track IDs are conflicted.
VERSION | Constant |
public static const VERSION:String = 0.6.6.0
version number
// create driver instance. var driver:SiONDriver = new SiONDriver(); // call play() with mml string whenever you want to play sound. driver.play("t100 l8 [ ccggaag4 ffeeddc4 | [ggffeed4]2 ]2");