|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjass.engine.Out
jass.engine.InOut
jass.generators.SingleMode
public class SingleMode
Vibration model of object with 1 mode Changes in freq damping and gains are linearly changed over one buffer rather than abruptly
Field Summary | |
---|---|
protected float |
a
modal parameters |
protected float |
ampR
Reson filter gain. |
protected float |
c_i
Cached values. |
protected float |
cutoffRiseExcitation
Cutoff excitation pulse strength above which a bubble is considered rising |
protected float |
d
modal parameters |
protected float |
f
modal parameters |
protected float |
f_base
modal parameters |
protected float |
f_rise
modal parameters |
protected float |
R2
|
float |
srate
Sampling rate in Hertz. |
protected float[] |
tmpBuf
Temp storage |
protected float |
twoRCosTheta
The transfer function of a reson filter is H(z) = 1/(1-twoRCosTheta/z + R2/z*z). |
protected float |
xi
xi factor for rising bubbles as explained in paper |
protected float |
yt_1
State of filter |
protected float |
yt_2
State of filter |
Fields inherited from class jass.engine.InOut |
---|
sourceContainer, sourcePassivity, srcBuffers |
Fields inherited from class jass.engine.Out |
---|
buf, bufferSize, bufOld, lock |
Constructor Summary | |
---|---|
SingleMode(float f,
float d,
float a,
float srate,
int bufferSize)
Create and initialize with provided modal data. |
|
SingleMode(float srate,
int bufferSize)
Create and initialize, but don't set any modal parameters. |
|
SingleMode(int bufferSize)
Constructor for derived classes to call super |
Method Summary | |
---|---|
java.lang.Object |
addSource(Source s)
Add a Source. |
protected void |
computeBuffer()
Compute the next buffer and store in member float[] buf. |
protected void |
computeModalFilterBank(float[] output,
float[] force,
int nsamples)
Apply external force[] and compute response through bank of modal filters. |
void |
computeResonCoeff()
Compute the reson coefficients from the modal model parameters. |
void |
setDamping(float d)
Set damping |
void |
setFreq(float f)
Set freq |
void |
setGain(float a)
Set gain |
void |
setRiseCutoffExcitation(float x)
Set xi value for rising bubbles |
void |
setXi(float x)
Set xi value for rising bubbles |
Methods inherited from class jass.engine.InOut |
---|
addSource, getBuffer, getSources, removeSource, resetTime |
Methods inherited from class jass.engine.Out |
---|
clearBuffer, copyToOld, getBuffer, getBufferSize, getTime, peekAtBuffer, setBufferSize, setTime, setTimeAndNotify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float srate
protected float xi
protected float cutoffRiseExcitation
protected float twoRCosTheta
protected float R2
protected float ampR
protected float c_i
protected float f
protected float f_rise
protected float f_base
protected float d
protected float a
protected float[] tmpBuf
protected float yt_1
protected float yt_2
Constructor Detail |
---|
public SingleMode(int bufferSize)
bufferSize
- Buffer size used for real-time rendering.public SingleMode(float srate, int bufferSize)
srate
- sampling rate in Hertz.bufferSize
- Buffer size used for real-time rendering.public SingleMode(float f, float d, float a, float srate, int bufferSize)
f
- freq.d
- dampinga
- gainsrate
- sampling rate in Hertz.bufferSize
- Buffer size used for real-time rendering.Method Detail |
---|
public void setXi(float x)
x
- xi value (0.1 is normal)public void setRiseCutoffExcitation(float x)
x
- excitation value above which bubble is considered risingpublic java.lang.Object addSource(Source s) throws SinkIsFullException
addSource
in interface Sink
addSource
in class InOut
s
- Source to add.
SinkIsFullException
public void computeResonCoeff()
#setLocation
.
protected void computeBuffer()
computeBuffer
in class Out
public void setDamping(float d)
d
- damping scale.public void setFreq(float f)
f
- freq.public void setGain(float a)
a
- gainprotected void computeModalFilterBank(float[] output, float[] force, int nsamples)
output
- user provided output buffer.force
- input force.nsamples
- number of samples to compute.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |