public class Buffer
extends java.lang.Object
implements java.io.Serializable
BufferFactory
,
Serialized FormModifier and Type | Field and Description |
---|---|
float[] |
buf
The buffer data.
|
static Buffer |
NOISE |
static Buffer |
SAW |
static Buffer |
SINE |
static Buffer |
SQUARE |
static java.util.Hashtable<java.lang.String,Buffer> |
staticBufs
A static storage area for common buffers, such as a sine wave.
|
static Buffer |
TRIANGLE |
Constructor and Description |
---|
Buffer(int size)
Instantiates a new buffer.
|
Modifier and Type | Method and Description |
---|---|
float |
getValueFraction(float fraction)
Returns the value of the buffer at the given fraction along its length (0 = start, 1 = end).
|
float |
getValueFractionNoInterp(float fraction)
Returns the value of the buffer at the given fraction along its length (0 = start, 1 = end).
|
float |
getValueIndex(int index)
Returns the value of the buffer at a specific index.
|
java.lang.String |
toString()
Returns the contents of the buffer as a String over one line.
|
public static java.util.Hashtable<java.lang.String,Buffer> staticBufs
BufferFactory
to keep track of common buffers.public static final Buffer SINE
public static final Buffer SAW
public static final Buffer SQUARE
public static final Buffer TRIANGLE
public static final Buffer NOISE
public final float[] buf
public Buffer(int size)
size
- the size of the buffer.public float getValueFraction(float fraction)
fraction
- the point along the buffer to inspect.public float getValueFractionNoInterp(float fraction)
fraction
- the point along the buffer to inspect.public float getValueIndex(int index)
index
- the index to inspect.public java.lang.String toString()
toString
in class java.lang.Object