toxi.math.waves
Class AMFMSineWave

java.lang.Object
  extended by toxi.math.waves.AbstractWave
      extended by toxi.math.waves.AMFMSineWave

public class AMFMSineWave
extends AbstractWave

Amplitude and frequency modulated sine wave. Uses 2 secondary waves to modulate the shape of the main wave.

Note: You must NEVER call the update() method on the modulating waves.


Field Summary
 AbstractWave amod
           
 AbstractWave fmod
           
 
Fields inherited from class toxi.math.waves.AbstractWave
amp, frequency, offset, phase, PI, TWO_PI, value
 
Constructor Summary
AMFMSineWave(float phase, float freq, AbstractWave fmod, AbstractWave amod)
          Creates a new instance from
AMFMSineWave(float phase, float freq, float offset, AbstractWave fmod, AbstractWave amod)
           
 
Method Summary
 void pop()
           
 void push()
           
 void reset()
          Resets this wave and its modulating waves as well.
 float update()
          Progresses the wave and updates the result value.
 
Methods inherited from class toxi.math.waves.AbstractWave
cyclePhase, cyclePhase, hertzToRadians, radiansToHertz, setPhase, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fmod

public AbstractWave fmod

amod

public AbstractWave amod
Constructor Detail

AMFMSineWave

public AMFMSineWave(float phase,
                    float freq,
                    AbstractWave fmod,
                    AbstractWave amod)
Creates a new instance from

Parameters:
phase -
freq -
fmod -
amod -

AMFMSineWave

public AMFMSineWave(float phase,
                    float freq,
                    float offset,
                    AbstractWave fmod,
                    AbstractWave amod)
Parameters:
phase -
freq -
offset -
fmod -
amod -
Method Detail

pop

public void pop()
Overrides:
pop in class AbstractWave

push

public void push()
Overrides:
push in class AbstractWave

reset

public void reset()
Resets this wave and its modulating waves as well.

Overrides:
reset in class AbstractWave
See Also:
AbstractWave.reset()

update

public float update()
Progresses the wave and updates the result value. You must NEVER call the update() method on the 2 modulating wave since this is handled automatically by this method.

Specified by:
update in class AbstractWave
Returns:
current (newly calculated) wave value
See Also:
AbstractWave.update()