toxi.math.waves
Class FMTriangleWave

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

public class FMTriangleWave
extends AbstractWave

Implements a frequency modulated triangular wave with its peak at PI: "/\"


Field Summary
 AbstractWave fmod
           
 
Fields inherited from class toxi.math.waves.AbstractWave
amp, frequency, offset, phase, PI, TWO_PI, value
 
Constructor Summary
FMTriangleWave(float phase, float freq)
           
FMTriangleWave(float phase, float freq, float amp, float offset)
           
FMTriangleWave(float phase, float freq, float amp, float offset, AbstractWave fmod)
           
 
Method Summary
 void pop()
           
 void push()
           
 void reset()
          Resets this wave and its modulating wave as well.
 float update()
          Updates the wave and returns new 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
Constructor Detail

FMTriangleWave

public FMTriangleWave(float phase,
                      float freq)

FMTriangleWave

public FMTriangleWave(float phase,
                      float freq,
                      float amp,
                      float offset)

FMTriangleWave

public FMTriangleWave(float phase,
                      float freq,
                      float amp,
                      float offset,
                      AbstractWave fmod)
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 wave as well.

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

update

public float update()
Description copied from class: AbstractWave
Updates the wave and returns new value. Implementing classes should manually ensure the phase remains in the 0...TWO_PI interval or by calling AbstractWave.cyclePhase().

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