jass.generators
Class ConstantLoopBuffer

java.lang.Object
  extended by jass.engine.Out
      extended by jass.generators.ConstantLoopBuffer
All Implemented Interfaces:
Source
Direct Known Subclasses:
ConstantOneShotBuffer, GranularConstantLoopBuffer

public class ConstantLoopBuffer
extends Out

Loop through a buffer, loaded from an audio file or provided by caller. No speed or volume control is provided.

Author:
Kees van den Doel (kvdoel@cs.ubc.ca)

Field Summary
protected  int ix
          Current integer position of pointer in buffer.
protected  float[] loopBuffer
          Buffer to loop
protected  int loopBufferLength
          Buffer length
 float srate
          Sampling rate in Hertz of Out.
 
Fields inherited from class jass.engine.Out
buf, bufferSize, bufOld, lock
 
Constructor Summary
ConstantLoopBuffer(float srate, int bufferSize, float[] loopBuffer)
          Construct loop force and provide buffer
ConstantLoopBuffer(float srate, int bufferSize, java.lang.String fn)
          Construct loop force from named file.
ConstantLoopBuffer(float srate, int bufferSize, java.net.URL url)
          Construct loop force from url.
 
Method Summary
 void computeBuffer()
          Compute the next buffer.
 float[] getLoopBuffer()
          Get loopBuffer
 float getSamplingRate()
          Get sampling rate
 
Methods inherited from class jass.engine.Out
clearBuffer, copyToOld, getBuffer, getBuffer, getBufferSize, getTime, peekAtBuffer, resetTime, setBufferSize, setTime, setTimeAndNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loopBuffer

protected float[] loopBuffer
Buffer to loop


loopBufferLength

protected int loopBufferLength
Buffer length


ix

protected int ix
Current integer position of pointer in buffer.


srate

public float srate
Sampling rate in Hertz of Out.

Constructor Detail

ConstantLoopBuffer

public ConstantLoopBuffer(float srate,
                          int bufferSize,
                          java.lang.String fn)
Construct loop force from named file.

Parameters:
srate - sampling rate in Hertz.
bufferSize - bufferSize of this Out
fn - Audio file name.

ConstantLoopBuffer

public ConstantLoopBuffer(float srate,
                          int bufferSize,
                          java.net.URL url)
Construct loop force from url.

Parameters:
srate - sampling rate in Hertz.
bufferSize - bufferSize of this Out
url - Audio file url.

ConstantLoopBuffer

public ConstantLoopBuffer(float srate,
                          int bufferSize,
                          float[] loopBuffer)
Construct loop force and provide buffer

Parameters:
srate - sampling rate in Hertz.
bufferSize - bufferSize of this Out.
loopBuffer - looping buffer.
Method Detail

getLoopBuffer

public float[] getLoopBuffer()
Get loopBuffer

Returns:
loop buffer as float array

getSamplingRate

public float getSamplingRate()
Get sampling rate

Returns:
sampling rate in Hertz

computeBuffer

public void computeBuffer()
Compute the next buffer.

Specified by:
computeBuffer in class Out