uk.org.toot.synth.modules.oscillator
Class SingleWave

java.lang.Object
  extended by uk.org.toot.synth.modules.oscillator.SingleWave
All Implemented Interfaces:
Wave

public class SingleWave
extends java.lang.Object
implements Wave

This class represents the wave for WaveOScillator. The data shiuld have the first sample repeated at the end to allow for efficient linear interpolation.

Author:
st

Constructor Summary
SingleWave(float[] data, float period)
           
 
Method Summary
 float get(float index)
           
 float[] getData()
           
 float getPeriod()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleWave

public SingleWave(float[] data,
                  float period)
Method Detail

getData

public float[] getData()
Specified by:
getData in interface Wave
Returns:
the data

getPeriod

public float getPeriod()
Specified by:
getPeriod in interface Wave
Returns:
the period of the wave signal in samples, which may be less than the wave length for some waves.

get

public float get(float index)
Specified by:
get in interface Wave
Parameters:
index - the floating point index
Returns:
a linearly interpolated sample of the wave


Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.