Packageorg.si.sion.module.channels
Classpublic class SiOPMChannelFM
InheritanceSiOPMChannelFM Inheritance SiOPMChannelBase Inheritance Object
Subclasses SiOPMChannelKS

FM sound channel.

The calculation of this class is based on OPM emulation (refer from sources of mame, fmgen and x68sound). And it has some extension to simulate other sevral fm sound modules (OPNA, OPLL, OPL2, OPL3, OPX, MA3, MA5, MA7, TSS and DX7).



Public Properties
 PropertyDefined By
  activeOperator : SiOPMOperator
active operator
SiOPMChannelFM
  activeOperatorIndex : int
[override] [write-only] active operator index (i)
SiOPMChannelFM
 InheritedbufferIndex : int
[read-only] buffer index
SiOPMChannelBase
 InheritedchannelType : int
[read-only] channel type
SiOPMChannelBase
  detune : int
[override] [write-only] detune (@dt)
SiOPMChannelFM
  erst : Boolean
[override] [write-only] envelop reset (@er)
SiOPMChannelFM
 InheritedfilterType : int
filter mode
SiOPMChannelBase
  fixedPitch : int
[override] [write-only] fixed pitch (@fx)
SiOPMChannelFM
  fmul : int
[override] [write-only] fine multiple (@ml)
SiOPMChannelFM
 InheritedisFilterActive : Boolean
[read-only] Is filter active ?
SiOPMChannelBase
 InheritedisIdling : Boolean
[read-only] Is idling ?
SiOPMChannelBase
 InheritedisNoteOn : Boolean
[read-only] is this channel note on ?
SiOPMChannelBase
 InheritedmasterVolume : int
Master volume (0-128)
SiOPMChannelBase
 Inheritedmute : Boolean
Mute
SiOPMChannelBase
  operator : Vector.<SiOPMOperator>
operators
SiOPMChannelFM
 Inheritedpan : int
Pan (-64-64 left=-64, center=0, right=64). [left volume] = cos((pan+64)/128I.5) volume; [right volume] = sin((pan+64)/128I.5) volume;
SiOPMChannelBase
  phase : int
[override] [write-only] phase (@ph)
SiOPMChannelFM
  pitch : int
[override] pitch = (note << 6) | (kf & 63) [0,8191]
SiOPMChannelFM
  rr : int
[override] [write-only] release rate (@rr)
SiOPMChannelFM
  ssgec : int
[override] [write-only] ssgec (@se)
SiOPMChannelFM
  tl : int
[override] [write-only] total level (@tl)
SiOPMChannelFM
Protected Properties
 PropertyDefined By
  _algorism : int
algorism
SiOPMChannelFM
  _am_depth : int
am depth
SiOPMChannelFM
  _am_out : int
am output level
SiOPMChannelFM
 Inherited_basePipe : SLLint
base pipe
SiOPMChannelBase
 Inherited_bufferIndex : int
buffering index
SiOPMChannelBase
 Inherited_chip : SiOPMModule
chip
SiOPMChannelBase
 Inherited_cutoff : int
cutoff frequency
SiOPMChannelBase
 Inherited_cutoff_offset : int
cutoff frequency
SiOPMChannelBase
  _eg_timer_initial : int
ENV_TIMER_INITIAL freq_ratio
SiOPMChannelFM
 Inherited_expressionTable : Vector.<int>
expression table
SiOPMChannelBase
 Inherited_filter_eg_cutoff : Vector.<int>
eg level
SiOPMChannelBase
 Inherited_filter_eg_cutoff_inc : int
eg direction
SiOPMChannelBase
 Inherited_filter_eg_next : int
eg phase shift l.
SiOPMChannelBase
 Inherited_filter_eg_state : int
eg state
SiOPMChannelBase
 Inherited_filter_eg_step : int
eg step
SiOPMChannelBase
 Inherited_filter_eg_time : Vector.<int>
eg rate
SiOPMChannelBase
 Inherited_filterOn : Boolean
filter switch
SiOPMChannelBase
 Inherited_filterType : int
filter type
SiOPMChannelBase
 Inherited_filterVriables : Vector.<Number>
filter Variables
SiOPMChannelBase
 Inherited_freq_ratio : int
frequency ratio
SiOPMChannelBase
 Inherited_funcProcess : Function
functor to process
SiOPMChannelBase
  _funcProcessList : Array
process func
SiOPMChannelFM
  _funcProcessType : int
process type
SiOPMChannelFM
 Inherited_hasEffectSend : Boolean
effect send flag
SiOPMChannelBase
 Inherited_inPipe : SLLint
in pipe
SiOPMChannelBase
 Inherited_inputLevel : int
input level
SiOPMChannelBase
 Inherited_inputMode : int
input level
SiOPMChannelBase
 Inherited_isIdling : Boolean
idling flag
SiOPMChannelBase
 Inherited_isNoteOn : Boolean
note on flag
SiOPMChannelBase
 Inherited_lfo_on : int
lfo switch
SiOPMChannelBase
 Inherited_lfo_phase : int
lfo phase
SiOPMChannelBase
 Inherited_lfo_timer : int
lfo timer
SiOPMChannelBase
  _lfo_timer_initial : int
LFO_TIMER_INITIAL freq_ratio
SiOPMChannelFM
 Inherited_lfo_timer_step_ : int
lfo step buffer
SiOPMChannelBase
 Inherited_lfo_timer_step : int
lfo timer step
SiOPMChannelBase
 Inherited_lfo_waveShape : int
lfo wave shape
SiOPMChannelBase
 Inherited_lfo_waveTable : Vector.<int>
lfo wave table
SiOPMChannelBase
 Inherited_mute : Boolean
mute
SiOPMChannelBase
  _operatorCount : int
count
SiOPMChannelFM
 Inherited_outPipe : SLLint
out pipe
SiOPMChannelBase
 Inherited_outputMode : int
output mode
SiOPMChannelBase
 Inherited_pan : int
pan
SiOPMChannelBase
  _pipe0 : SLLint
internal pipe0
SiOPMChannelFM
  _pipe1 : SLLint
internal pipe1
SiOPMChannelFM
  _pm_depth : int
pm depth
SiOPMChannelFM
  _pm_out : int
pm output level
SiOPMChannelFM
 Inherited_prevStepRemain : int
eg step residue
SiOPMChannelBase
 Inherited_resonance : Number
resonance
SiOPMChannelBase
 Inherited_ringmodLevel : Number
ringmod level
SiOPMChannelBase
 Inherited_ringPipe : SLLint
ringmod pipe
SiOPMChannelBase
 Inherited_streams : Vector.<SiOPMStream>
stream
SiOPMChannelBase
 Inherited_table : SiOPMTable
table
SiOPMChannelBase
 Inherited_veocityTable : Vector.<int>
veocity table
SiOPMChannelBase
 Inherited_volumes : Vector.<Number>
volume
SiOPMChannelBase
Public Methods
 MethodDefined By
  
constructor
SiOPMChannelFM
 Inherited
activateFilter(b:Boolean):void
Filter activation
SiOPMChannelBase
 Inherited
buffer(len:int):void
Buffering
SiOPMChannelBase
  
[override] Get SiOPMChannelParam.
SiOPMChannelFM
 Inherited
getStreamSend(streamNum:int):Number
get stream send.
SiOPMChannelBase
  
initialize(prev:SiOPMChannelBase, bufferIndex:int):void
[override] Initialize.
SiOPMChannelFM
  
initializeLFO(waveform:int, customWaveTable:Vector.<int> = null):void
[override] initialize low frequency oscillator.
SiOPMChannelFM
 Inherited
nop(len:int):void
Buffering without processnig
SiOPMChannelBase
  
noteOff():void
[override] Note off.
SiOPMChannelFM
  
noteOn():void
[override] Note on.
SiOPMChannelFM
 Inherited
offsetFilter(i:int):void
LP Filter cutoff offset controled by table envelop (nf)
SiOPMChannelBase
  
offsetVolume(expression:int, velocity:int):void
[override] update all tl offsets of final carriors
SiOPMChannelFM
  
reset():void
[override] Reset.
SiOPMChannelFM
  
[override] Prepare buffering
SiOPMChannelFM
  
setAlgorism(cnt:int, alg:int):void
[override] Set algorism (@al)
SiOPMChannelFM
  
setAllAttackRate(ar:int):void
[override] Attack rate
SiOPMChannelFM
  
setAllReleaseRate(rr:int):void
[override] Release rate (s)
SiOPMChannelFM
 Inherited
setAllStreamSendLevels(param:Vector.<int>):void
set all stream send levels by Vector.<int>.
SiOPMChannelBase
  
setAmplitudeModulation(depth:int):void
[override] Amplitude modulation.
SiOPMChannelFM
  
setChannelNumber(channelNum:int):void
[override] set channel number (2nd argument of %)
SiOPMChannelFM
  
setFeedBack(fb:int, fbc:int):void
[override] Set feedback(@fb).
SiOPMChannelFM
  
setFrequencyRatio(ratio:int):void
[override] set chip "PSEUDO" frequency ratio by [%].
SiOPMChannelFM
 Inherited
setInput(level:int, pipeIndex:int):void
Set input pipe (@i).
SiOPMChannelBase
 Inherited
setLFOCycleTime(ms:Number):void
set LFO cycle time (@lfo).
SiOPMChannelBase
 Inherited
setOutput(outputMode:int, pipeIndex:int):void
Set output pipe (@o).
SiOPMChannelBase
  
setParameters(param:Vector.<int>):void
[override] Set parameters (@ command).
SiOPMChannelFM
  
setPitchModulation(depth:int):void
[override] Pitch modulation.
SiOPMChannelFM
  
setRegister(addr:int, data:int):void
[override] set register
SiOPMChannelFM
 Inherited
setRingModulation(level:int, pipeIndex:int):void
Set ring modulation pipe (@r).
SiOPMChannelBase
  
setSiOPMChannelParam(param:SiOPMChannelParam, withVolume:Boolean, withModulation:Boolean = true):void
[override] Set by SiOPMChannelParam.
SiOPMChannelFM
  
setSiOPMParameters(ar:int, dr:int, sr:int, rr:int, sl:int, tl:int, ksr:int, ksl:int, mul:int, dt1:int, detune:int, ams:int, phase:int, fixNote:int):void
Set sound by 14 basic params.
SiOPMChannelFM
 Inherited
setStreamBuffer(streamNum:int, stream:SiOPMStream = null):void
set stream buffer.
SiOPMChannelBase
 Inherited
setStreamSend(streamNum:int, volume:Number):void
set stream send.
SiOPMChannelBase
 Inherited
setSVFilter(cutoff:int = 128, resonance:int = 0, ar:int = 0, dr1:int = 0, dr2:int = 0, rr:int = 0, dc1:int = 128, dc2:int = 128, sc:int = 128, rc:int = 128):void
SVFilter envelop (@f).
SiOPMChannelBase
  
setType(pgType:int, ptType:int):void
[override] pgType and ptType (@)
SiOPMChannelFM
 Inherited
setVolumeTables(vtable:Vector.<int>, xtable:Vector.<int>):void
set velocity and expression tables
SiOPMChannelBase
  
setWaveData(waveData:SiOPMWaveBase):void
[override] Set wave data.
SiOPMChannelFM
  
toString():String
Output parameters.
SiOPMChannelFM
Protected Methods
 MethodDefined By
 Inherited
_applyRingModulation(pointer:SLLint, len:int):void
ring modulation
SiOPMChannelBase
 Inherited
_applySVFilter(pointer:SLLint, len:int, variables:Vector.<Number> = null):void
state variable filter
SiOPMChannelBase
 Inherited
_nop(len:int):void
No process (default functor of _funcProcess).
SiOPMChannelBase
 Inherited
reset SVFilter
SiOPMChannelBase
 Inherited
shiftSVFilterState(state:int):void
shift SVFilter state
SiOPMChannelBase
Public Constants
 ConstantDefined By
 InheritedFILTER_BP : int = 1
[static] band pass filter
SiOPMChannelBase
 InheritedFILTER_HP : int = 2
[static] high pass filter
SiOPMChannelBase
 InheritedFILTER_LP : int = 0
[static] low pass filter
SiOPMChannelBase
 InheritedINPUT_FEEDBACK : int = 2
[static] input from feedback
SiOPMChannelBase
 InheritedINPUT_PIPE : int = 1
[static] input from pipe
SiOPMChannelBase
 InheritedINPUT_ZERO : int = 0
[static] no input from pipe
SiOPMChannelBase
 InheritedOUTPUT_ADD : int = 2
[static] add to pipe
SiOPMChannelBase
 InheritedOUTPUT_OVERWRITE : int = 1
[static] overwrite pipe
SiOPMChannelBase
 InheritedOUTPUT_STANDARD : int = 0
[static] standard output
SiOPMChannelBase
Property Detail
_algorismproperty
protected var _algorism:int

algorism

_am_depthproperty 
protected var _am_depth:int

am depth

_am_outproperty 
protected var _am_out:int

am output level

_eg_timer_initialproperty 
protected var _eg_timer_initial:int

ENV_TIMER_INITIAL freq_ratio

_funcProcessListproperty 
protected var _funcProcessList:Array

process func

_funcProcessTypeproperty 
protected var _funcProcessType:int

process type

_lfo_timer_initialproperty 
protected var _lfo_timer_initial:int

LFO_TIMER_INITIAL freq_ratio

_operatorCountproperty 
protected var _operatorCount:int

count

_pipe0property 
protected var _pipe0:SLLint

internal pipe0

_pipe1property 
protected var _pipe1:SLLint

internal pipe1

_pm_depthproperty 
protected var _pm_depth:int

pm depth

_pm_outproperty 
protected var _pm_out:int

pm output level

activeOperatorproperty 
public var activeOperator:SiOPMOperator

active operator

activeOperatorIndexproperty 
activeOperatorIndex:int  [write-only] [override]

active operator index (i)


Implementation
    public function set activeOperatorIndex(value:int):void
detuneproperty 
detune:int  [write-only] [override]

detune (@dt)


Implementation
    public function set detune(value:int):void
erstproperty 
erst:Boolean  [write-only] [override]

envelop reset (@er)


Implementation
    public function set erst(value:Boolean):void
fixedPitchproperty 
fixedPitch:int  [write-only] [override]

fixed pitch (@fx)


Implementation
    public function set fixedPitch(value:int):void
fmulproperty 
fmul:int  [write-only] [override]

fine multiple (@ml)


Implementation
    public function set fmul(value:int):void
idlingThresholdproperty 
_sion_internal static var idlingThreshold:int = 5120

eg_out threshold to check idling

operatorproperty 
public var operator:Vector.<SiOPMOperator>

operators

phaseproperty 
phase:int  [write-only] [override]

phase (@ph)


Implementation
    public function set phase(value:int):void
pitchproperty 
pitch:int[override]

pitch = (note << 6) | (kf & 63) [0,8191]


Implementation
    public function get pitch():int
    public function set pitch(value:int):void
registerMapChannelproperty 
_sion_internal var registerMapChannel:int

registerMapTypeproperty 
_sion_internal var registerMapType:int

register map type

rrproperty 
rr:int  [write-only] [override]

release rate (@rr)


Implementation
    public function set rr(value:int):void
ssgecproperty 
ssgec:int  [write-only] [override]

ssgec (@se)


Implementation
    public function set ssgec(value:int):void
tlproperty 
tl:int  [write-only] [override]

total level (@tl)


Implementation
    public function set tl(value:int):void
Constructor Detail
SiOPMChannelFM()Constructor
public function SiOPMChannelFM(chip:SiOPMModule)

constructor

Parameters
chip:SiOPMModule
Method Detail
getSiOPMChannelParam()method
override public function getSiOPMChannelParam(param:SiOPMChannelParam):void

Get SiOPMChannelParam.

Parameters

param:SiOPMChannelParam — SiOPMChannelParam.

initialize()method 
override public function initialize(prev:SiOPMChannelBase, bufferIndex:int):void

Initialize.

Parameters

prev:SiOPMChannelBase
 
bufferIndex:int

initializeLFO()method 
override public function initializeLFO(waveform:int, customWaveTable:Vector.<int> = null):void

initialize low frequency oscillator. and stop lfo

Parameters

waveform:int — LFO waveform. 0=saw, 1=pulse, 2=triangle, 3=noise. -1 to set customized wave table
 
customWaveTable:Vector.<int> (default = null) — customized wave table, the length is 256 and the values are limited in the range of 0-255. This argument is available when waveform=-1.

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

Note off.

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

Note on.

offsetVolume()method 
override public function offsetVolume(expression:int, velocity:int):void

update all tl offsets of final carriors

Parameters

expression:int
 
velocity:int

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

Reset.

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

Prepare buffering

setAlgorism()method 
override public function setAlgorism(cnt:int, alg:int):void

Set algorism (@al)

Parameters

cnt:int — Operator count.
 
alg:int — Algolism number of the operator's connection.

setAllAttackRate()method 
override public function setAllAttackRate(ar:int):void

Attack rate

Parameters

ar:int

setAllReleaseRate()method 
override public function setAllReleaseRate(rr:int):void

Release rate (s)

Parameters

rr:int

setAmplitudeModulation()method 
override public function setAmplitudeModulation(depth:int):void

Amplitude modulation.

Parameters

depth:int — depth = (ams) ? (amd << (ams-1)) : 0;

setChannelNumber()method 
override public function setChannelNumber(channelNum:int):void

set channel number (2nd argument of %)

Parameters

channelNum:int

setFeedBack()method 
override public function setFeedBack(fb:int, fbc:int):void

Set feedback(@fb). This also initializes the input mode(@i).

Parameters

fb:int — Feedback level. Ussualy in the range of 0-7.
 
fbc:int — Feedback connection. Operator index which feeds back its output.

setFrequencyRatio()method 
override public function setFrequencyRatio(ratio:int):void

set chip "PSEUDO" frequency ratio by [%]. 100 means 3.56MHz. This value effects only for envelop and lfo speed.

Parameters

ratio:int

setParameters()method 
override public function setParameters(param:Vector.<int>):void

Set parameters (@ command).

Parameters

param:Vector.<int>

setPitchModulation()method 
override public function setPitchModulation(depth:int):void

Pitch modulation.

Parameters

depth:int — depth = (pms<6) ? (pmd >> (6-pms)) : (pmd << (pms-5));

setRegister()method 
override public function setRegister(addr:int, data:int):void

set register

Parameters

addr:int
 
data:int

setSiOPMChannelParam()method 
override public function setSiOPMChannelParam(param:SiOPMChannelParam, withVolume:Boolean, withModulation:Boolean = true):void

Set by SiOPMChannelParam.

Parameters

param:SiOPMChannelParam — SiOPMChannelParam.
 
withVolume:Boolean — Set volume when its true.
 
withModulation:Boolean (default = true) — Set modulation when its true.

setSiOPMParameters()method 
public function setSiOPMParameters(ar:int, dr:int, sr:int, rr:int, sl:int, tl:int, ksr:int, ksl:int, mul:int, dt1:int, detune:int, ams:int, phase:int, fixNote:int):void

Set sound by 14 basic params. The value of int.MIN_VALUE means not to change.

Parameters

ar:int — Attack rate [0-63].
 
dr:int — Decay rate [0-63].
 
sr:int — Sustain rate [0-63].
 
rr:int — Release rate [0-63].
 
sl:int — Sustain level [0-15].
 
tl:int — Total level [0-127].
 
ksr:int — Key scaling [0-3].
 
ksl:int — key scale level [0-3].
 
mul:int — Multiple [0-15].
 
dt1:int — Detune 1 [0-7].
 
detune:int — Detune.
 
ams:int — Amplitude modulation shift [0-3].
 
phase:int — Phase [0-255].
 
fixNote:int — Fixed note number [0-127].

setType()method 
override public function setType(pgType:int, ptType:int):void

pgType and ptType (@)

Parameters

pgType:int
 
ptType:int

setWaveData()method 
override public function setWaveData(waveData:SiOPMWaveBase):void

Set wave data.

Parameters

waveData:SiOPMWaveBase — SiOPMWavePCMTable to set.

toString()method 
public function toString():String

Output parameters.

Returns
String