footfall.generators
Class SoundGrainModel

java.lang.Object
  extended byfootfall.generators.SoundGrainModel

public class SoundGrainModel
extends java.lang.Object

Generates the sound grains used to simulate footfalls (contact, knocks, thumps etc). The sound grains are usually 25-75ms in duration, depending on the user-selected frames per second.


Constructor Summary
SoundGrainModel()
          Provides functions for generating sound grains
SoundGrainModel(int bitRate)
          Provides functions for generating sound grains at specific bitrate
 
Method Summary
 int getBitRate()
          Returns the bit rate of the sound grains.
 float[] makeFadingSineWave(int bytes, int freq, float startAmp)
          Generate sine wave that starts at given volume and then fades out
 float[] makeWhiteNoise(int bytes, int freq, float maxAmp)
          Generate white noise at given frequency and amplitude
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundGrainModel

public SoundGrainModel()
Provides functions for generating sound grains


SoundGrainModel

public SoundGrainModel(int bitRate)
Provides functions for generating sound grains at specific bitrate

Parameters:
bitRate - Specific bitRate for sound grain generation: 11.025kHz - 44.1kHz
Method Detail

getBitRate

public int getBitRate()
Returns the bit rate of the sound grains. Should be the same as the bit rate of the GrainPlayer and MultiPlayer classes.


makeFadingSineWave

public float[] makeFadingSineWave(int bytes,
                                  int freq,
                                  float startAmp)
Generate sine wave that starts at given volume and then fades out

Parameters:
bytes - Length of the grain
freq - Frequency of the sine wave
startAmp - Starting amplitude of the wave

makeWhiteNoise

public float[] makeWhiteNoise(int bytes,
                              int freq,
                              float maxAmp)
Generate white noise at given frequency and amplitude

Parameters:
bytes - Length of the grain
freq - Frequency of the white noise
maxAmp - Maximum amplitude of the white noise