jass.generators
Class StickyModalObjectWithOneContact

java.lang.Object
  extended by jass.engine.Out
      extended by jass.engine.InOut
          extended by jass.generators.ModalObjectWithOneContact
              extended by jass.generators.StickyModalObjectWithOneContact
All Implemented Interfaces:
Sink, Source

public class StickyModalObjectWithOneContact
extends ModalObjectWithOneContact

Vibration model of object, capable of playing sound. Modal parameters are fed through a of butterworth filter so if you change them they change slowly.

Author:
Kees van den Doel (kvdoel@cs.ubc.ca)

Field Summary
protected  float[] ampR_old
           
protected  Butter2LowFilter[] butterFiltersAmp
           
protected  Butter2LowFilter[] butterFiltersCos
           
protected  Butter2LowFilter[] butterFiltersR2
           
protected  float butterLowPassFreq
           
protected  boolean hasBeenConverged
           
protected  float[] parQueue
           
protected  float[] R2_old
          old values of low-level parameters
protected  float[] twoRCosTheta_old
           
 
Fields inherited from class jass.generators.ModalObjectWithOneContact
ampR, b1, b2, b3, c_i, modalModel, p1, p2, p3, R2, rollGain, srate, tmpBuf, twoRCosTheta, yt_1, yt_2
 
Fields inherited from class jass.engine.InOut
sourceContainer, sourcePassivity, srcBuffers
 
Fields inherited from class jass.engine.Out
buf, bufferSize, bufOld, lock
 
Constructor Summary
StickyModalObjectWithOneContact(float srate, int nf, int np, int bufferSize)
          Create and initialize, but don't set any modal parameters.
StickyModalObjectWithOneContact(int bufferSize)
          Constructor for derived classes to call super
StickyModalObjectWithOneContact(ModalModel m, float srate, int bufferSize)
          Create and initialize with provided modal data.
 
Method Summary
protected  void allocateOldData(int nf, int np)
          Allocate old data.
protected  void computeModalFilterBank(float[] output, float[] force, int nsamples)
          Apply external force[] and compute response through bank of modal filters.
 float getLowPassControlFilter()
          Get lowpass freq through which modal parameters are fed
 void resetParameterFilter()
          Reset parameter filter
 void setLowPassControlFilter(float freq)
          Set lowpass freq through which modal parameters are fed
 
Methods inherited from class jass.generators.ModalObjectWithOneContact
addSource, allocate, clearHistory, computeBuffer, computeFilter, computeLocation, computeResonCoeff, setDamping, setFrequencyScale, setGain, setLocation, setNf
 
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

butterFiltersR2

protected Butter2LowFilter[] butterFiltersR2

butterFiltersAmp

protected Butter2LowFilter[] butterFiltersAmp

butterFiltersCos

protected Butter2LowFilter[] butterFiltersCos

butterLowPassFreq

protected float butterLowPassFreq

parQueue

protected float[] parQueue

hasBeenConverged

protected boolean hasBeenConverged

R2_old

protected float[] R2_old
old values of low-level parameters


twoRCosTheta_old

protected float[] twoRCosTheta_old

ampR_old

protected float[] ampR_old
Constructor Detail

StickyModalObjectWithOneContact

public StickyModalObjectWithOneContact(int bufferSize)
Constructor for derived classes to call super

Parameters:
bufferSize - Buffer size used for real-time rendering.

StickyModalObjectWithOneContact

public StickyModalObjectWithOneContact(float srate,
                                       int nf,
                                       int np,
                                       int bufferSize)
Create and initialize, but don't set any modal parameters.

Parameters:
srate - sampling rate in Hertz.
nf - number of modes.
np - number of locations.
bufferSize - Buffer size used for real-time rendering.

StickyModalObjectWithOneContact

public StickyModalObjectWithOneContact(ModalModel m,
                                       float srate,
                                       int bufferSize)
Create and initialize with provided modal data.

Parameters:
m - modal model to load.
srate - sampling rate in Hertz.
bufferSize - Buffer size used for real-time rendering.
Method Detail

resetParameterFilter

public void resetParameterFilter()
Reset parameter filter


setLowPassControlFilter

public void setLowPassControlFilter(float freq)
Set lowpass freq through which modal parameters are fed

Parameters:
freq - lowpass cutoff of butterworth filter

getLowPassControlFilter

public float getLowPassControlFilter()
Get lowpass freq through which modal parameters are fed

Returns:
lowpass cutoff of butterworth filter

allocateOldData

protected void allocateOldData(int nf,
                               int np)
Allocate old data.

Parameters:
nf - number of modes.
np - number of locations.

computeModalFilterBank

protected void computeModalFilterBank(float[] output,
                                      float[] force,
                                      int nsamples)
Apply external force[] and compute response through bank of modal filters. Filter modal parameters through the butterworth filter so they change slowly

Overrides:
computeModalFilterBank in class ModalObjectWithOneContact
Parameters:
output - user provided output buffer.
force - input force.
nsamples - number of samples to compute.