jass.contact
Class ARContactForce

java.lang.Object
  extended by jass.engine.Out
      extended by jass.contact.ContactForce
          extended by jass.contact.ARContactForce
All Implemented Interfaces:
Source

public class ARContactForce
extends ContactForce

A force model with impact, slide, and slide modes based on AR2 model for sliding, wavetable model as in ContactForce for rolling and impact.

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

Field Summary
 
Fields inherited from class jass.contact.ContactForce
bangForce, dryRollGain, fLowPass, lowPassFilter, physicalToAudioGainImpact, physicalToAudioGainRoll, physicalToAudioGainSlide, rollForce, rollForceRaw, rollSpeed1, slideSpeed1, vroll0, vroll1, vslide0, vslide1
 
Fields inherited from class jass.engine.Out
buf, bufferSize, bufOld, lock
 
Constructor Summary
  ARContactForce(float srate, int bufferSize, java.lang.String fnImpact, java.lang.String fnSlide, java.lang.String fnRoll)
          Construct contact force from named files.
protected ARContactForce(int bufferSize)
          Constructor intended only for subclass constructors (super(bufferSize);)
 
Method Summary
 void computeBuffer()
          Compute the next buffer.
 void setSlideModelDamping(float d)
          Set slide model damping (usually static property).
 void setSlideProperties(float force, float speed)
          Set slide speed and normal force.
 void setStaticContactModelParameters(float slideFreq0, float slideFreq1, float rollSpeed1, float vslide0, float vslide1, float vroll0, float vroll1, float physicalToAudioGainSlide, float physicalToAudioGainRoll, float physicalToAudioGainImpact, boolean isComplexReson)
          Set model parameters mapping physical units to audio units
 
Methods inherited from class jass.contact.ContactForce
bang, setRollFilter, setRollProperties, setStaticContactModelParameters
 
Methods inherited from class jass.engine.Out
clearBuffer, copyToOld, getBuffer, getBuffer, getBufferSize, getTime, peekAtBuffer, resetTime, setBufferSize, setTime, setTimeAndNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARContactForce

protected ARContactForce(int bufferSize)
Constructor intended only for subclass constructors (super(bufferSize);)


ARContactForce

public ARContactForce(float srate,
                      int bufferSize,
                      java.lang.String fnImpact,
                      java.lang.String fnSlide,
                      java.lang.String fnRoll)
Construct contact force from named files.

Parameters:
srate - sampling rate in Hertz.
bufferSize - bufferSize of this Out.
fnImpact - Audio file name for impact. (For example cos20ms.wav.)
fnRoll - Audio file name for slide. (For example white5.wav.) Will not be pitch shifted but filtered with AR model.
fnRoll - Audio file name for slide. (For example roll.wav.)
Method Detail

setStaticContactModelParameters

public void setStaticContactModelParameters(float slideFreq0,
                                            float slideFreq1,
                                            float rollSpeed1,
                                            float vslide0,
                                            float vslide1,
                                            float vroll0,
                                            float vroll1,
                                            float physicalToAudioGainSlide,
                                            float physicalToAudioGainRoll,
                                            float physicalToAudioGainImpact,
                                            boolean isComplexReson)
Set model parameters mapping physical units to audio units

Parameters:
slideFreq0 - minimum reson freq. (should be zero)
slideFreq1 - maximum reson freq. (should correspond to max velocity)
rollSpeed1 - maximum audio loop speed (1 = original recording)
vslide0 - minimum physical speed (lower than this is considered to be zero)
vslide1 - maximum physical speed (higher than this is set to this value)
vroll0 - minimum physical speed (lower than this is considered to be zero)
vroll1 - maximum physical speed (higher than this is set to this value)
physicalToAudioGainSlide - multiplies normal force to get slide gain
physicalToAudioGainRoll - multiplies normal force to get roll gain
physicalToAudioGainImpact - multiplies impact force to get impact gain
boolean - isComplexReson if is complex reson (all freq negative)

setSlideModelDamping

public void setSlideModelDamping(float d)
Set slide model damping (usually static property). This is actually the damping at maximum velocity and scales down with the reson freq.

Parameters:
d - damping

setSlideProperties

public void setSlideProperties(float force,
                               float speed)
Set slide speed and normal force.

Overrides:
setSlideProperties in class ContactForce
Parameters:
force - normal force.
speed - relative surface velocity. (Audio file is speed = 1.)

computeBuffer

public void computeBuffer()
Compute the next buffer.

Overrides:
computeBuffer in class ContactForce